Example 2.44. Investigate the conditional and absolute convergence of the improper integral

$$
I=\int_{0}^{2}\left[2 x \sin \left(\frac{\pi}{x^{2}}\right)-\frac{2 \pi}{x} \cos \left(\frac{\pi}{x^{2}}\right)\right] d x
$$
Solution.

$$
\begin{gathered}
I=\lim _{a \rightarrow+0} \int_{a}^{2}\left(2 x \sin \left(\frac{\pi}{x^{2}}\right)-\frac{2 \pi}{x} \cos \left(\frac{\pi}{x^{2}}\right)\right) d x= \\
=\lim _{a \rightarrow+0} \int_{a}^{2}\left(x^{2} \sin \left(\frac{\pi}{x^{2}}\right)\right)^{\prime} d x= \\
=\lim _{a \rightarrow+0}\left(2^{2} \sin \left(\frac{\pi}{2^{2}}\right)-a^{2} \sin \left(\frac{\pi}{a^{2}}\right)\right)=4 \sin \left(\frac{\pi}{4}\right)-0=2 \sqrt{2}
\end{gathered}
$$

The integral converges. Now let's investigate the integral of the modulus of the previous integrand.

$$
\begin{aligned}
\int_{0}^{2} \left|2 x \sin \left(\frac{\pi}{x^{2}}\right) - \frac{2 \pi}{x} \cos \left(\frac{\pi}{x^{2}}\right)\right| d x= \\
& =\lim _{a \rightarrow+0} \int_{a}^{2}\left|2 x \sin \left(\frac{\pi}{x^{2}}\right)-\frac{2 \pi}{x} \cos \left(\frac{\pi}{x^{2}}\right)\right| d x
\end{aligned}
$$

If $x \in\left[\sqrt{\frac{2}{2+4 n}}, \sqrt{\frac{2}{1+4 n}}\right]$, then $\frac{\pi}{x^{2}} \in\left[\frac{\pi}{2}+2 \pi n, \pi+2 \pi n\right]$ and therefore the integrand will be positive for these values of $x$. Let's estimate the integral from below.

$$
\begin{aligned}
& \int_{0}^{2}\left|2 x \sin \left(\frac{\pi}{x^{2}}\right)-\frac{2 \pi}{x} \cos \left(\frac{\pi}{x^{2}}\right)\right| d x=\int_{0}^{2}\left|x^{2} \sin \left(\frac{\pi}{x^{2}}\right)\right|^{\prime} d x> \\
> & \sum_{k=0}^{n} \int_{\sqrt{2 /(2+4 k)}}^{\sqrt{2 /(1+4 k)}}\left(x^{2} \sin \left(\frac{\pi}{x^{2}}\right)\right)^{\prime} d x=\sum_{k=0}^{n} \frac{2}{1+4 k},(n=0,1,2, \ldots)
\end{aligned}
$$

We will show that $\lim _{n \rightarrow \infty} \sum_{k=0}^{n} \frac{2}{1+4 k}=+\infty$. For this, consider the integral

$$
\int_{0}^{n} \frac{2 d x}{1+4 x}=\sum_{k=0}^{n-1} \int_{k}^{k+1} \frac{2 d x}{1+4 x}
$$

And we verify that

$$
\begin{gathered}
\frac{2}{1+4 x} \leqslant \frac{2}{1+4 k}, x \in[k, k+1], \int_{k}^{k+1} \frac{2 d x}{1+4 x} \leqslant \frac{2}{1+4 k} \\
\int_{0}^{n} \frac{2 d x}{1+4 x}=\sum_{k=0}^{n-1} \int_{k}^{k+1} \frac{2 d x}{1+4 x} \leqslant \sum_{k=0}^{n-1} \frac{2}{1+4 k}
\end{gathered}
$$

However, the integral on the left tends to infinity as $n \rightarrow \infty$:

$$
\int_{0}^{n} \frac{2 d x}{1+4 x}=\left.\frac{1}{2} \ln (1+4 x)\right|_{0} ^{n}=\frac{1}{2} \ln (1+4 n) \rightarrow+\infty(n \rightarrow+\infty)
$$

The convergence is conditional.