Is it possible to do the improper integral or not? I was solving the following $\int_{1}^{\infty}\frac{t\cos^2(t)}{1+t^3} dt$. I found it exists by comparison test for integrals with $\frac{1}{t^3}$. Then, I was trying to see what happened if we changed a little bit like $\int_{1}^{\infty}\frac{t\cos^2(t)}{1+t^2}dt$   but I was not able to do it. Any idea?
 A: We have $$\cos^2t={1\over 2}[\cos 2t+1]\qquad (*)$$ The integral $$\int\limits_1^\infty {t\over 1+t^2}\cos 2t \,dt$$ is convergent due to the Dirichlet test, 17.5. On the other hand the integral $$\int\limits_1^\infty{t\over 1+t^2}\,dt={1\over 2}\ln(1+t^2)\mid_1^\infty=\infty$$ is divergent. In view of $(*)$ the integral $$\int\limits_1^\infty {t\cos^2t\over 1+t^2}\,dt$$ is divergent.
A: $$I=\int\frac{t\cos^2(t)}{1+t^2}dt$$
$$\frac{t}{1+t^2}=\frac{t}{(t+i)(t-i)}=\frac{1}{2 (t+i)}+\frac{1}{2 (t-i)}$$ Changing variables $t=x \pm i$
$$\cos(x+i)=\frac{\left(1+e^2\right) \cos (x)}{2 e}-\frac{i \left(e^2-1\right) \sin (x)}{2 e}$$
$$\cos^2(x+i)=\frac{1}{2} (\cosh (2) \cos (2 x)\color{red}{+1})-\frac{1}{2} i \sinh (2) \sin (2 x)$$
$$\cos^2(x-i)=\frac{1}{2} (\cosh (2) \cos (2 x)\color{red}{+1})+\frac{1}{2} i \sinh (2) \sin (2 x)$$ The $\color{red}{+1}$ will lead to logarithms. Back to $t$
$$I=\frac{1}{4} \left(\cosh (2) (\text{Ci}(2 i-2 t)+\text{Ci}(2 t+2 i))+i \sinh (2)
   (\text{Si}(2 i-2 t)+\text{Si}(2 t+2 i))+\color{red}{\log \left(t^2+1\right)}\right)$$
But, moving the $\large 2$,
$$\int_1^\infty \frac{t \cos (2 t)}{1+t^2}\,dt=-\frac{e^4 (\text{Ei}(-2-2 i)+\text{Ei}(-2+2 i))+\text{Ei}(2-2 i)+\text{Ei}(2+2 i)}{4
   e^2}$$ does not make any problem.
