What is the reason that $\int_{-\infty}^{\infty}f(x) \Bbb dx$ may not be the same as $\lim_{b \to \infty} \int_{-b}^{b}f(x) \Bbb dx$? Given question:
Calculus by Thomas, Chp 8, pg 501, No. 66:

$\int_{-\infty}^{\infty}f(x) \Bbb dx$ may not equal $\lim_{b \to \infty} \int_{-b}^{b}f(x) \Bbb dx$ Show that
$$\int_{0}^{\infty} \frac{2x\Bbb dx}{x^2 + 1}$$ diverges and hence
that $$\int_{-\infty}^{\infty} \frac{2x\Bbb dx}{x^2 + 1}$$ diverges.
Then show that $$\lim_{b\to \infty} \int_{-b}^{b} \frac{2x\Bbb dx}{x^2
 + 1} = 0$$

My attempt:

$$\begin{align} \int_{0}^{\infty} \frac{2x\Bbb dx}{x^2 + 1} &=
 \ln\left(x^2+1\right)\Bigg|_0^{\infty}\\ &= \ln(\infty)-\ln(1)\\ &=
 \infty \quad \text{(Diverges)} \end{align}$$
Since $\int_{0}^{\infty} \frac{2x\Bbb dx}{x^2 + 1}$ diverges, then
$\int_{-\infty}^{\infty} \frac{2x\Bbb dx}{x^2 + 1}$ also diverges.
Regarding to the second question:
$$\begin{align} \lim_{b\to \infty} \int_{-b}^{b} \frac{2x\Bbb dx}{x^2
 + 1} &= \lim_{b\to \infty} \ln\left(x^2+1\right)\Bigg|_{-b}^{b}\\ &=  \lim_{b\to \infty} \ln\left(b^2+1\right) - \lim_{b\to \infty}
 \ln\left(b^2+1\right)\\ &= 0\quad \text{(Converges)} \end{align}$$

Here i feel confused. Does that mean $f(x) = \frac{2x}{x^2
 + 1}$ is a counterexample of $\int_{-\infty}^{\infty}f(x) \Bbb dx = \lim_{b \to \infty} \int_{-b}^{b}f(x) \Bbb dx$ or what? And does it converge?
Please explain to me. Thanks!
 A: Your questions are the point of the exercise.  We define
$$\int_{-\infty}^{\infty}f(x) \Bbb dx = \lim_{b \to \infty} \int_{-b}^{0}f(x) \Bbb dx+ \lim_{b \to \infty} \int_{0}^{b}f(x) \Bbb dx$$
which requires that each limit exist separately.  You have shown that one of them diverges, which means the left side diverges as well.  When you take the symmetric limit $ \lim_{b \to \infty} \int_{-b}^{b}f(x) \Bbb dx$ you are integrating an odd function over an interval symmetric around $0$, so the integral is constantly $0$ and converges nicely.  The problem is that this is an artifact of the use of the symmetric interval.  You could do a $u$ substitution that makes the interval asymmetric in $x$ and the integral will diverge.  This is why we require that the one sided limits converge separately.
In the case where the symmetric limit converges we call the limit the Cauchy principal value.  It is sometimes useful.
A: Your second question answer is more complicated than needed and includes a falsehood : $\lim (A - B) = \lim(A) - \lim(B)$ only if the two limits on the right exist, which does not happen in your answer.
Make the change of variable $x \mapsto -x$ in either integral over half the interval to discover \begin{align*}
\int_{-b}^b \frac{2x\,\mathrm{d}x}{x^2 + 1}
    &= \int_{-b}^0 \frac{2x\,\mathrm{d}x}{x^2 + 1} + \int_0^b \frac{2x\,\mathrm{d}x}{x^2 + 1}  \\
    &= \int_{-b}^0 \frac{2x\,\mathrm{d}x}{x^2 + 1} + \int_0^{-b} \frac{-2x}{x^2 + 1} \cdot (-1) \mathrm{d}x  \\
    &= \int_{-b}^0 \frac{2x\,\mathrm{d}x}{x^2 + 1} + -\int_{-b}^0 \frac{2x\,\mathrm{d}x}{x^2 + 1}  \\
    &= 0  \text{.}
\end{align*}
Then, of course, $\lim_{b \rightarrow \infty} 0 = 0$.
This shows that while there may be one way that we can carefully balance integrals diverging in opposite directions to give an apparently finite answer, we don't do that generically in the definition of an improper integral.  In the definition, we require each side of each improper behaviour be assigned to one limit and that these several limits independently exist.
It may be helpful to compare/contrast the application of the definition of the improper integral,
$$  \int_{-1}^1 \frac{\mathrm{d}x}{x} = 
\lim_{a \rightarrow 0^-} \int_{-1}^a \frac{\mathrm{d}x}{x} + \lim_{b \rightarrow 0^+} \int_{b}^1 \frac{\mathrm{d}x}{x}  \text{,}  $$ where we require each of these two (independent) limits exist, to tying the two limits together to sneakily arrange for cancellation at each step,
$$  \int_{-1}^1 \frac{\mathrm{d}x}{x} \neq \lim_{a \rightarrow 0^-} \left( \int_{-1}^a \frac{\mathrm{d}x}{x} +  \int_{-a}^1 \frac{\mathrm{d}x}{x} \right) = 0 \text{.}  $$
Maybe it will help if we write the version using two limits as a version using "one" limit (using the idea that the point $(a,b)$ on the plane is allowed to wander around so long as $a$ is always in the left half-plane, $b$ is always in the upper half-plane, so the point is in the second quadrant, and the point goes to $(0,0)$),
$$  \int_{-1}^1 \frac{\mathrm{d}x}{x} = 
\lim_{(a,b) \rightarrow (0^-, 0^+)} \left( \int_{-1}^a \frac{\mathrm{d}x}{x} + \int_{b}^1 \frac{\mathrm{d}x}{x} \right)  \text{.}  $$  This says exactly the same thing as the version directly from the definition of the improper integral.  It also says that $a$ and $b$ go to their limits independently.  It does not say that the point $(a,b)$  must lie on the a curve that causes carefully tuned cancellation of the two integrals.
Yet another fragility of the forced to be symmetric version is this:  These are integrals, which are limits of Riemann sums.  To get the detailed cancellation to also work in the Riemann sums, we would (generically) require that the partition for the one integral is the mirror image of the partition in the other integral.  It should be clear that you have never required the partitions in the limits of two integrals to have any relation -- each integral independently wanders through the lattice of partitions towards partitions with diameter $0$.  Similarly, for improper integrals, the limiting bounds in two different limits are independent, the two limiting variables do not have any relations -- each limiting bound independently wanders through its half-line towards its target.
