How can I study the convergence of the improper integral $\int_{0}^{ \infty} \frac{\sin(x)}{x+1} \, \mathrm dx\,$? I need to study the convergence of the following improper integral:
$$\int_{0}^{\infty} \dfrac{\sin(x)}{x+1}\, \mathrm dx$$
I did the following:
$$ -1 \leq \sin(x)  \leq 1  \\
\implies \dfrac{-1}{x+1}  \leq \dfrac{\sin(x)}{x+1}  \leq \dfrac{1}{x+1} \\   
\implies \left|\dfrac{\sin(x)}{x+1}\right|  \leq \dfrac{1}{x+1} \\
 \implies \int_{0}^{\infty} \left|\dfrac{\sin(x)}{x+1}\right| \, \mathrm dx   \leq \int_{0}^{\infty}\dfrac{1}{x+1}\, \mathrm dx = \infty  $$
I planned to use the comparison criterion and then the absolute convergence criterion. However, the idea did not work for me.
 A: Notice that
$$\int_0^\infty \frac{\sin x}{x+1}\,dx = \frac{-\cos x}{x+1}\Bigg|_0^\infty - \int_0^\infty \frac{\cos x}{(x+1)^2}\,dx = 1 - \int_0^\infty \frac{\cos x}{(x+1)^2}\,dx$$
and the last integral converges absolutely since
$$\int_0^\infty \frac{\left|\cos x\right|}{(x+1)^2}\,dx \le \int_0^\infty \frac{dx}{(x+1)^2} = \int_1^\infty \frac{dx}{x^2} < +\infty.$$
The original integral however does not converge absolutely. Namely, we have $$x \in \bigcup_{k \in \mathbb{N}_0} \left[\frac\pi6+k\pi,\frac{5\pi}6+k\pi\right] \implies \left|\sin x\right| \ge \frac12$$
so
$$\int_0^\infty \frac{\left|\sin x\right|}{x+1}\,dx \ge \frac12\sum_{k=0}^\infty \int_{\frac\pi6+k\pi}^{\frac{5\pi}6+k\pi} \frac{dx}{x+1} = \frac12\sum_{k=0}^\infty \ln \frac{\frac{5\pi}6+k\pi+1}{\frac\pi6+k\pi+1} = +\infty.$$
A: The Cauchy criterion for improper integrals is:

An improper integral $\int_0^\infty f(x) \, dx$ is convergent if and
only if  for any $\epsilon > 0$ there exists $C_\epsilon > 0$ such that $\left|\int_a^b f(x) \, dx \right| < \epsilon$
for
all $b > a> C_\epsilon.$

Since $x \mapsto \frac{1}{1+x}$is decreasing, by the second mean value theorem for integrals, there exists $\xi \in (a,b)$ such that
$$\left|\int_a^b \frac{\sin x}{1+x} \, dx\right| = \left|\frac{1}{1+a}\int_a^\xi \sin x\, dx\right| = \frac{|\cos a - \cos \xi|}{1+a}\leqslant \frac{2}{1+a}$$
For all $b > a > C_\epsilon = \frac{2}{\epsilon}-1$ we have the RHS less than $\epsilon$ and the Cauchy criterion is satisfied.
A: Granted, the integral does not converge in the sense of Lebesgue. As a proper Riemann integral it does.
Here is another solution based which uses elementary facts about alternating series.

*

*The sequence $a_n=\Big|\int^{(n+1)\pi}_{n\pi}\frac{\sin x}{x+1}\,dx\Big|$  is non decreasing and $a_n\xrightarrow{n\rightarrow\infty}0$. This is because on $[\pi n,\pi(n+1)]$, $\sin x=(-1)^n|\sin x|$, and so
$$
\begin{align}
a_{n+1}&=\int^{(n+2)\pi}_{(n+1)\pi}\frac{|\sin x|}{x+1}\,dx=\int^{(n+1)\pi}_{n\pi}\frac{|\sin(x+\pi)|}{x+\pi+1}\,dx\\
&\leq \int^{(n+1)\pi}_{n\pi}\frac{|\sin x|}{x+1}=a_n\leq\frac{\pi}{\pi n +1}\xrightarrow{n\rightarrow\infty}0
\end{align}$$


*The series $s=\sum_{n\geq0}(-1)^na_n$ has partial sums $s_n=\int^{n\pi}_0\frac{\sin x}{1+x}\,dx$. Being a nice alternating series, $s_n$ converges.


*In general, for $T>0$, let $[T]$ be its integer part. Then
$$
\Big|\int^{T\pi}_0\frac{\sin x}{x+1}\,dx - \int^{[T]\pi}_0\frac{\sin x}{x+1}\,dx\Big|\leq \int^{\pi T}_{[T]\pi}\frac{|\sin x|}{x+1}\leq
\frac{\pi}{[T]\pi+1}\xrightarrow{T\rightarrow\infty}0$$
Therefore $\lim_{A\rightarrow\infty}\int^{A}_0\frac{\sin x}{x+1}\,dx$ exists and equal $s$.
A: Let
$$
a_n = \int_{\pi n}^{\pi(n+1)}\frac{|\sin x|}{x+1}dx.
$$
Note that
$$
\int_0^\infty \frac{\sin x}{x+1}dx = \sum_{n=0}^\infty (-1)^n a_n.
$$
If the series converges, then the integral must also converge. For any $n\in\mathbb{N}$, we can see that $a_n$ is positive, and we can rewrite it the following way:
$$
\begin{align}
a_n = \int_{\pi n}^{\pi(n+1)}\frac{|\sin x|}{x+1}dx &= \int_{\pi n}^{\pi(n+1)}\frac{\sin (x - \pi n)}{x+1}dx\\
&= \int_0^\pi\frac{\sin x}{x+1+\pi n}dx.
\end{align}
$$
This makes it clear that the denominator of $a_{n+1}$ is larger than the denominator of $a_n$ over the entire interval of integration; thus, $a_n$ must be decreasing. Furthermore, it is easy to see that $\lim_{n\to\infty} a_n=0$. Therefore, by the alternating series test, the integral converges.
