I was trying to evaluate $ {\int_0^{\infty}\frac{\cos (x)}{1+x^2}}\text{d}x$ by Feynman's trick
It has been solved here, but I have a specific question at one of the steps while doing it. (Not a duplicate) (My question is about why I get 2 different results when solving it in 2 different methods in a particular step.)
So I defined $I(t)= \int_0^{\infty}\frac{\cos (xt)}{1+x^2}\text{d}x$ and arrived at $I(t)= I''(t)$
so this means
$I(t) = \alpha e^t + \beta e^{-t}$
Method 1:
$I(0) = \alpha + \beta $
and from the integral $I(0) = \int_0^{\infty}\frac{1}{1+x^2}\text{d}x$ = $\frac{\pi}{2}$
so $\alpha + \beta = \pi/2 \tag1 $ and $I'(t) = \alpha e^t -\beta e^{-t}$, so $I'(0) = \alpha -\beta $
from the integral $I'(t)= \int_0^{\infty}\frac{-x \sin (xt)}{1+x^2}\text{d}x$
so $I'(0)= 0 $ $\alpha - \beta = 0\tag2$
By (1) and (2) we get $$\boxed{I(t) = \frac{\pi}{4}e^t + \frac{\pi}{4} e^{-t}}$$
Method 2:
$I(0) = \alpha + \beta $
and from the integral $I(0) = \int_0^{\infty}\frac{1}{1+x^2}\text{d}x$ = $\frac{\pi}{2}$
so $\alpha + \beta = \pi/2 \tag3 $
$I(t)= \int_0^{\infty}\frac{\cos (xt)}{1+x^2}\text{d}x$
using integration by parts,
$$u=\frac{1}{{{x}^{2}}+1}\quad,\quad dv=\cos tx$$
we have
$$I(t)=\frac{\sin (t x)}{t({{x}^{2}}+1)}\left| \begin{matrix}
\infty \\
0 \\
\end{matrix} \right.+\frac{2}{t}\int_{0 }^{+\infty }{\frac{x\sin (t x)}{{{({{x}^{2}}+1)}^{2}}}}\,dx
$$
as a result
$$I(t )=\int_{0}^{\infty }{\frac{2}{t} \frac{x\sin tx}{{{({{x}^{2}}+1)}^{2}}}\,}dx \,$$
As t tends to infinity we can see I(t) will tend to 0, which should mean $\alpha$ is 0, or else it will exponentially increase.
So now we get $$\boxed{I(t) = \frac{\pi}{2e^t}}$$
What's going wrong? Both seem valid and correct. This seeming loophole has been annoying me for a long time