First step of solving this improper integral.
$$\int_{-\infty}^{+\infty}\frac{dx}{x^2+1} = \lim_{a\mapsto\infty}\int_{-a}^{a}\frac{dx}{x^2+1}$$
I believe the correct way to proceed is:
$$\lim_{a\mapsto-\infty}\int_{a}^{0}\frac{dx}{x^2+1} +\lim_{b\mapsto+\infty}\int_{0}^{b}\frac{dx}{x^2+1}$$
But why is the first one incorrect?