When I attempted trying to evaluate $$\int_{0}^{\infty} \frac{\sin^{2}{x}}{x(x^{2}+1)} dx$$, I first tried partial fractions to exploit the fact that an inverse tangent might be able to be found, which resulted in two integrals, the first one of which I highly suspect to be integrated using the Leibniz Integral rule, but I have no clue how to evaluate the second part which is $$\int_{0}^{\infty} \frac{x\sin^{2}{x}}{x^{2}+1} dx$$. I then attempted using infinite geometric series but it didn't really go anywhere. Is there something I'm missing here?
How would you calculate the integral of $\int_{0}^{\infty} \frac{\sin^{2}{x}}{x(x^{2}+1)} dx$
calculusintegration
Related Solutions
Regularization is a way to make a divergent integral into a parametric family of finite integrals. Say, we need to evaluate $\int f(x) \mathrm{d} x$. We introduce (and this is a craft in itself) $f_\alpha(x)$, such that $\lim_{\alpha \to 0} f_\alpha(x) = f(x)$, such that $\int f_\alpha(x) \mathrm{d} x$ exists. We then perform, unjustified, interchanging of integration and taking the limit: $$ \int f(x) \mathrm{d} x = \int \lim_{\alpha \to 0} f_\alpha(x) \mathrm{d} x \stackrel{?}{=} \lim_{\alpha \to 0} \int f_\alpha(x) \mathrm{d} x $$
In your particular case, integral can be defined using Abel summations, since $$ \int_0^\infty \sin(x) \mathrm{d} x = \sum_{n=0}^\infty \int_{\pi n}^{\pi (n+1)} \sin(x) \mathrm{d} x = \sum_{n=0}^\infty 2 (-1)^n \stackrel{\text{Abel}}{=} 1 $$ Different regularization of divergent series do not need to give the same result, however, under certain conditions they do.
Coming back to your integral, its regularization is done, just like you did, by taking advantage of the hypergeometric nature of the integrand, and representing the integral as limit of Mellin convolutions (i.e. $\int_0^\infty h_\alpha(x) \sin(x) \mathrm{d} x$, where $h_\alpha(x)$ is another hypergeometric function, that makes the integral convergent, and such that $\lim_{\alpha \downarrow 0} h_\alpha(x) = 1$): $$ \lim_{\alpha \downarrow 0} \int_0^\infty \frac{\sin(x)}{x^\alpha}\mathrm{d} x = \lim_{\alpha \downarrow 0} \left( \Gamma(1-\alpha) \cos\left( \frac{\pi \alpha}{2} \right) \right) = 1 $$ $$ \lim_{\alpha \downarrow 0} \int_0^\infty \mathrm{e}^{-\alpha x} \sin(x) \mathrm{d} x = \lim_{\alpha \downarrow 0} \frac{1}{\alpha^2 + 1} = 1 $$ $$ \lim_{\alpha \downarrow 0} \int_0^\infty \frac{\sin(x)}{1+\alpha x} \mathrm{d} x = \lim_{\alpha \downarrow 0} \left( \frac{2 \sin \left(\frac{1}{\alpha }\right) \text{Ci}\left(\frac{1}{\alpha }\right)+\cos \left(\frac{1}{\alpha }\right) \left(\pi -2 \text{Si}\left(\frac{1}{\alpha }\right)\right)}{2 \alpha } \right) = 1 $$
Yes, you can apply Differentiation Under the Integral Sign as I show you bellow. Just a quick note, I'm applying a slightly modified version of Leibniz Rule, but in essence it's pretty much the same.
$$f(\alpha,\beta)=\int_{0}^{\infty}\frac{\arctan(\alpha x)\arctan(\beta x)}{x^2}dx$$
$$=\int_{0}^{\infty}\int_{0}^{\alpha}\int_{0}^{\beta}\frac{dydzdx}{(1+y^2x^2)(1+z^2x^2)}=\int_{0}^{\alpha}\int_{0}^{\beta}dydz\int_{0}^{\infty}\frac{dx}{(1+y^2x^2)(1+z^2x^2)}$$
$$=\int_{0}^{\alpha}\int_{0}^{\beta}\frac{dydz}{y^2-z^2}\int_{0}^{\infty}\left(\frac{y^2}{1+y^2x^2}-\frac{z^2}{1+z^2x^2}\right)dx$$
$$=\int_{0}^{\alpha}\int_{0}^{\beta}dydz\left[\frac{y\arctan(yx)-z\arctan(zx)}{(y-z)(y+z)}\right]^{\infty}_{0}=\frac{\pi}{2}\int_{0}^{\alpha}\int_{0}^{\beta}\frac{dydz}{y+z}$$
$$=\frac{\pi}{2}\int_{0}^{\alpha}dz[log(z+\beta)-log(z)]=\frac{\pi}{2}[(\beta+z)log(\beta+z)-z-zlog(z)+z]^{\alpha}_{0}$$
$$\boxed{f(\alpha,\beta)=\int_{0}^{\infty}\frac{\arctan(\alpha x)\arctan(\beta x)}{x^2}dx=\frac{\pi}{2}log\left(\frac{\left(\alpha+\beta\right)^{\alpha+\beta}}{\alpha^\alpha\beta^\beta}\right)}$$
Best Answer
$$I=\int\frac{\sin^{2}(x)}{x(x^{2}+1)}\, dx=\frac 12 \int\frac{1-\cos(2x)}{x(x^{2}+1)} \,dx$$ $$I=\frac 12\log (x)-\frac{1}{4} \log \left(x^2+1\right)-\frac 12\int\frac{\cos(2x)}{x(x^{2}+1)}\, dx$$
$$\frac{1}{x(x^{2}+1)}=\frac{1}{x(x+i)(x-i)}=\frac{1}{x}-\frac{1}{2 (x-i)}-\frac{1}{2 (x+i)}$$ So, we face three integrals $$J_a=\int \frac{\cos(2x)}{x+a}\, dx$$ $$x=t-a \quad \implies \quad J_a=\cos(2a)\int \frac{\cos(2t)}{t}\, dt+\sin(2a)\int \frac{\sin(2t)}{t}\, dt$$ and here appear the trigonometric integrals $$\int \frac{\cos(2t)}{t}\, dt=\text{Ci}(2 t)\qquad \text{and} \qquad \int \frac{\sin(2t)}{t}\, dt=\text{Si}(2 t)$$ which, for sure, are related to the exponential integral function (use Euler representation of the sine and cosine function).
Recombine all terms and simplify before using the limits and you will obtain Wolfram Alpha result or some other equivalent formulae.
Edit
The antiderivative is then given by $$8\,e^2\,I(x)=\left(1+e^4\right) \text{Ci}(2 i-2 x)-4 e^2 \text{Ci}(2 x)+e^4 \text{Ci}(2 x+2 i)+$$ $$\text{Ci}(2 x+2 i)+i e^4 \text{Si}(2 i-2 x)-i \text{Si}(2 i-2 x)+$$ $$i e^4 \text{Si}(2 x+2 i)-i \text{Si}(2 x+2 i)-2 e^2 \log \left(x^2+1\right)+4 e^2 \log (x)$$
Which gives $$8\,e^2\,I=-2 (\text{Shi}(2)+\text{Ci}(2 i))+e^4 (-2 \text{Ci}(2 i)+2 \text{Shi}(2)+i \pi )+i \pi +4 e^2 (\gamma +\log (2))$$ which is $$I=\frac{\gamma +\log (2)}{2}-\frac{e^4 \text{Ei}(-2)+\text{Ei}(2)}{4 e^2} $$