A improper integral Can someone tell me what is wrong with this I cant seem to find the error
\begin{eqnarray*}
\int_{-\infty}^{\infty} \frac{2x}{1+x^{2}} dx &=& \displaystyle\int_{-\infty}^{0} \frac{2x}{1+x^{2}} dx + \int_{0}^{\infty} \frac{2x}{1+x^{2}} dx  \\ 
&=& \lim_{a \rightarrow -\infty}\int_{a}^{0} \frac{2x}{1+x^{2}} dx + \lim_{b \rightarrow \infty}\int_{0}^{b} \frac{2x}{1+x^{2}} dx \\ 
&=& \lim_{a \rightarrow -\infty}\int_{1+a^{2}}^{1} \frac{du}{u} + \lim_{b \rightarrow \infty}\int_{1}^{1+b^{2}} \frac{du}{u} \\ 
&=& \lim_{a \rightarrow -\infty} \Big[ \ln u \Big]_{1+a^{2}}^{1} + \lim_{b \rightarrow \infty}\Big[ \ln u \Big]_{1}^{1+b^{2}} \\ & = & \Big[0-\ln (1+a^{2})\Big]_{a\rightarrow \infty}+\Big[ \ln (1+b^{2})-0 \Big]_{b\rightarrow \infty}  \\ &=& -\infty + -\infty.
\end{eqnarray*} 
which is an indeterminate form, but by definition of a convergent improper integral we can conclude that this integral is divergent. 
On the other hand
\begin{eqnarray*}
\int_{-\infty}^{\infty} \frac{2x}{1+x^{2}} dx &=& \lim_{a \rightarrow \infty}\int_{-a}^{a} \frac{2x}{1+x^{2}} dx \\ 
&=&  \lim_{a \rightarrow \infty} \Big[ \ln u \Big]_{1+a^{2}}^{1+a^{2}}   \\ &=& \lim_{a \rightarrow \infty} 0 = 0
\end{eqnarray*} 

You have discovered conditional convergence.  You will also find that for this function,
$$
\lim_{a\to\infty} \int_{-a}^a \ne \lim_{a\to\infty} \int_{-a}^{2a\quad \longleftarrow \text{ “}2a\text{'', not “}a\text{''}}.
$$
This sort of thing happens only if the integral of the absolute value is infinite.  One has
$$
\int_{-\infty}^\infty \left| \frac{2x}{1+x^2} \right| \,dx = \infty. 
$$
When the integral of the absolute value is infinite, then the value of the integral can be changed by rearrangement.  Another example is this:
$$
\int_0^1\int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2}\, \underbrace{ \, dx\,dy} \ne \int_0^1\int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2}\, \underbrace{ \, dy\,dx} \quad (dx\,dy\  \text{ versus }\  dy\,dx)
$$
