$$
\int_0^\infty \frac{5x}{1+x^2} \, dx = \infty \text{ and } \int_{-\infty}^0 \frac{5x}{1+x^2}\,dx = -\infty. \tag 1
$$
If you take
$$
\lim_{C\to\infty} \int_{-C}^C \frac{5x}{1+x^2}\,dx, \tag 2
$$
you get $0$. But
$$
\lim_{C\to\infty} \int_{-C}^{2C} \frac{5x}{1+x^2}\,dx = \frac 5 2 \log_e 4.
$$
When the positive and negative parts are both infinite, then "rearranging" the integral can change its value.
This is analogous to the fact that conditionally convergent sums like $\displaystyle\sum_{n=1}^\infty \frac{(-1)^n}{n}$ (in which the sum of the positive terms and the sum of the negative terms are both infinite) can be made to converge to different things by changing the order of the terms.
The limit in $(2)$ is an example of a "Cauchy principal value" of an integral.