<s>[INST] $\int_{-\infty}^\infty f(x)dx$ vs. $\lim_{b\rightarrow\infty}\int_{-b}^b f(x)dx$ for odd $f(x)$. I think the below one is a problem which demonstrates a beautiful subtlety (at least for someone like me who's a beginner).
Show that
$$
\int_{-\infty}^\infty \frac{2x}{1+x^2}dx
$$
diverges and
$$
\lim_{b\rightarrow\infty}\int_{-b}^b \frac{2x}{1+x^2}dx=0
$$
My Solution/Proof:
Let's start with
$$
\begin{aligned}
\lim_{b\rightarrow\infty}\int_{-b}^b \frac{2x}{1+x^2}dx &= \lim_{b\rightarrow\infty} \left[\ln(1+x^2)\right]_{-b}^b \\
&= \lim_{b\rightarrow\infty}(0) \\
&= 0
\end{aligned}
$$
That's one part. Next we have
$$
\begin{aligned}
\int_0^\infty \frac{2x}{1+x^2}dx &= \lim_{a\rightarrow\infty}\int_0^a\frac{2x}{1+x^2}dx \\
&= \lim_{a\rightarrow\infty}\ln(1+a^2) \\
&= \infty
\end{aligned}
$$
and also
$$
\begin{aligned}
\int_{-\infty}^0\frac{2x}{1+x^2}dx &= \lim_{b\rightarrow-\infty}\int_b^0\frac{2x}{1+x^2}dx \\
&= \lim_{b\rightarrow-\infty}\left[-\ln(1+b^2)\right] \\
&= -\infty
\end{aligned}
$$
Therefore
$$
\begin{aligned}
\int_{-\infty}^\infty \frac{2x}{1+x^2}dx &= \int_{-\infty}^0\frac{2x}{1+x^2}dx+\int_0^\infty \frac{2x}{1+x^2}dx \\
&= \lim_{b\rightarrow-\infty}\int_b^0\frac{2x}{1+x^2}dx+\lim_{a\rightarrow\infty}\int_0^a\frac{2x}{1+x^2}dx \\
&= -\infty+\infty \\
&= \text{undefined}
\end{aligned}
$$
and hence the assertion is proven. But...but...but...
But consider
$$
\begin{aligned}
\lim_{b\rightarrow-\infty}\int_b^0\frac{2x}{1+x^2}dx+\lim_{a\rightarrow\infty}\int_0^a\frac{2x}{1+x^2}dx &= \lim_{b\rightarrow-\infty}\left[-\ln(1+b^2)\right]+\lim_{a\rightarrow\infty}\ln(1+a^2) \\
& = \lim_{\color{red}{b\rightarrow\infty}}\left[-\ln(1+b^2)\right]+\lim_{a\rightarrow\infty}\ln(1+a^2)
\end{aligned}
$$
because $\ln(1+x^2)$ is even. Now, if $a=b$, this limit would become zero. Right?
If so, what exactly is stopping me from considering $a=b$ and hence the second limit as zero? I mean what's stopping the second integral from converging?
 [/INST] No. The symbols $a$ and $b$ are just variables. You could also write
$$
\int_{-\infty}^{\infty} \frac{2 x}{1 + x^2} \ \text{d}x= \left(\lim_{c \to \infty} - \ln(1 + c^2)\right) 
+ \left(\lim_{c \to \infty} \ln(1 + c^2)\right).
$$
But this is not equal to
$$
\lim_{c \to \infty} \left(- \ln(1 + c^2) + \ln(1 + c^2)\right)
= \lim_{c \to \infty} 0
= 0.
$$
The sum of the limits is only the limit of the sum, if both limits exist and are finite, which is not the case here.
A more simple example for this statement is the following:
$$
0
= \lim_{n \to \infty} 0 
= \lim_{n \to \infty} \left(n + \left(- n\right)\right)
\ne \left(\lim_{n \to \infty} n\right) + \left(\lim_{n \to \infty} - n\right)
= \infty + (- \infty)
= \text{undefined.}
$$
</s>