Integral $\int_0^{\infty}\frac{1}{(1+x^2)(3-\cos x)}dx$ Greetings I tried to evaluate $$I=\int_0^{\infty}\frac{1}{(1+x^2)(3-\cos x)}dx$$ Here is my try, it is abit longer, but I wrote it all so that I wont have a silly mistake. My main ideea was to expand into fourier series $$g(t)=\frac{1}{3-\cos t}$$ so I took(I am not sure if it's correct but that is how I learned) $$a_0=\frac{1}{\pi}\int_0^{2\pi}\frac{1}{3-\cos t}dt$$ $$a_n=\frac{1}{\pi}\int_0^{2\pi}\frac{\cos(nt)}{3-\cos t}dt$$$$b_n=\frac{1}{\pi}\int_0^{2\pi}\frac{\sin(nt)}{3-\cos t}dt$$ $$a_n+ib_n=\frac{1}{\pi}\int_0^{2\pi}\frac{e^{int} }{3-\cos t}dt$$ we let $$e^{it}=z \rightarrow dt=\frac{dz}{iz}\, ; |z|=1$$ And we can write $\cos t=\frac{z^2+1}{2z}$ $$a_n+ib_n=\frac{2}{i\pi}\int_{|z|=1} \frac{z^n}{-z^2+6z-1}dz$$our function $$g(z)= \frac{z^n}{-z^2+6z-1}$$ has in the interior of the circle $|z|=1$ simple poles at: $$-z^2+6z-1=0\rightarrow-(z-3)^2+8=0$$giving $$z_1=3-2\sqrt{2}$$ the other pole is not in the circle. So $$\frac{2}{i\pi}\int_{|z|=1} g(z)dz=2\pi i Res(g;z_1)$$ $$Res(g;3-2\sqrt 2)=\lim_{z\to 3-2\sqrt 2} \, \frac{z^n}{z-(3+2\sqrt 2)}=\frac{(3-2\sqrt 2)^n}{-4\sqrt 2}+i\cdot 0$$ Thus the $b_n$ term vanishes and $$a_n=\frac{(3-2\sqrt 2)^n}{-4\sqrt 2}\rightarrow a_0=-\frac{1}{4\sqrt 2}$$ so as a fourier series we have $$g(t)=-\frac{1}{8\sqrt 2}-\frac{1}{4\sqrt 2} \sum_{n=1}^{\infty}\frac{\cos(nt)}{(3+2\sqrt2)^n}$$ So we can rewrite the original integral as $$I=-\frac{1}{8\sqrt 2}\int_0^{\infty}\frac{1}{1+x^2}dx-\frac{1}{4\sqrt 2} \sum_{n=1}^{\infty}\frac{1}{(3+2\sqrt 2)^n}\int_0^{\infty}\frac{\cos(nx)}{1+x^2}dx$$ The first integral is simple, and the second one is well known around here to be $\frac{\pi}{2e^n}$ see for example: Integral evaluation $\int_{-\infty}^{\infty}\frac{\cos (ax)}{\pi (1+x^2)}dx$ so I get $$I=-\frac{\pi}{8\sqrt 2}\left(\frac{1}{2}+\sum_{n=1}^{\infty} \frac{1}{(e(3+2\sqrt 2))^n}\right)=-\frac{\pi}{16\sqrt 2}\left(\frac{3 e+2e\sqrt 2+ 1}{3e+2e\sqrt 2 - 1}\right) $$
Now since wolfram fails to compute this I am not sure, also for sure there is a sign mistake because the integral is positive... Could you please correct my answer?
 A: By following the same approach given by Random Variable in Prove $\int\limits_{0}^{\pi/2}\frac{dx}{1+\sin^2{(\tan{x})}}=\frac{\pi}{2\sqrt{2}}\bigl(\frac{e^2+3-2\sqrt{2}}{e^2-3+2\sqrt{2}}\bigr)$ , we have that if $1<|a|<e$ then
$$\begin{align} \frac{1}{2a}\int_{0}^{\infty} \frac{1}{(1+x^{2})(\frac{1+a^2}{2a}-\cos x )} \ dx &= \frac{1}{1-a^{2}} \int_{0}^{\infty} \Big(1+2 \sum_{k=1}^{\infty} a^{k} \cos(kx) \Big) \ \frac{1}{1+x^{2}} \ dx \\ &= \frac{\pi}{2} \frac{1}{1-a^{2}} + \frac{2}{1-a^{2}} \sum_{k=1}^{\infty} a^{k} \int_{0}^{\infty} \frac{\cos(kx)}{1+x^{2}} \ dx \\  &= \frac{\pi}{2} \frac{1}{1-a^{2}} + \frac{\pi}{1-a^{2}} \sum_{k=1}^{\infty} \Big(\frac{a}{e} \Big)^{k} \\ &= \frac{\pi}{2} \frac{1}{1-a^{2}} + \frac{\pi}{1-a^{2}}\cdot \frac{a/e}{1-a/e} = \frac{\pi}{2} \frac{1}{1-a^{2}} \cdot\frac{e+a}{e-a} \end{align}$$
Since  $\frac{1+a^2}{2a}=3$ for $a=3-2\sqrt{2}$ and $|a/e|<1$ we get
$$\int_{0}^{\infty} \frac{1}{(1+x^{2})(3-\cos x )} \ dx
=\frac{a\pi}{1-a^{2}} \cdot\frac{e+a}{e-a}=\frac{\sqrt{2}\pi}{8} \cdot\frac{e+3-2\sqrt{2}}{e-3+2\sqrt{2}}\approx 0.630190099$$
which is $-4$ times your result. 
