# Evaluate $\int_{-\infty}^{\infty}\frac{\cos x+x \sin x}{x^2+\cos^2x} dx$

Given that $$\int_{-\infty}^{\infty}\frac{\cos x+x \sin x}{x^2+\cos^2x} dx$$

I've tried many methods but ended up it didn't work. Is there any substitution which is good for this problem? I've looked WA, if this question is in indefinite integral,its answer will be $\tan^{-1}(x\sec (x))+c$ which is a pretty decent answer.

Hope someone would point me for it. Thanks in advance.

• are you sure that this integral exists? – Dr. Sonnhard Graubner May 21 '17 at 10:53
• Please consider using some non-TeX component in your title. – Mark McClure May 21 '17 at 11:10

$$\int \dfrac{\cos x+x\sin x}{x^2+\cos^{2}x}dx = \int \dfrac{\cos x+x\sin x}{\cos^{2}x\left(\left(\dfrac {x} {\cos x} \right)^{2}+1\right)}dx,$$
then apply the substitution $t := \dfrac x {\cos x}$ $\ldots$
• good one $(+1)$! We could add that the integral is of the general form $\int dx f'(x)/(f(x)^2+1)=\arctan(f(x))$ – tired May 21 '17 at 11:21