It's because the first integral contains an odd function and is therefore zero as if f(x) is odd.
The second integral contains an even function so if f(x) is even.
also it should be noted that contains no asymptotes over the domain of integration so the above holds.
For example, the same argument 'proves' that (the Cauchy Principle value). However, a more rigorous analysis proves that this integral does not in fact exist. (You can research this yourself by researching the fact that the mean of a Cauchy distribution does not exist).
As long as f is an odd function (f(-x)= -f(x)) and the integral exists, .
In the first integral, let u= -x so du= -dx and x= -a gives u= a. The integral becomes so since the "x" and "u" are just dummy variables.
With f an even function, f(-x)= f(x), you can do the same thing and get "+" between the integrals rather than "-". .
Of course, for that to work all those integrals have to exist.