<s>[INST] Find the range of the function,$f(x)=\int_{-1}^{1}\frac{\sin x}{1-2t\cos x+t^2}dt$ Find the range of the function,$f(x)=\int_{-1}^{1}\frac{\sin x}{1-2t\cos x+t^2}dt$
I tried to solve it,i got range $\frac{\pi}{2}$ but the answer is ${\frac{-\pi}{2},\frac{\pi}{2}}$
$f(x)=\int_{-1}^{1}\frac{\sin x}{1-2t\cos x+t^2}dt=\int_{-1}^{1}\frac{\sin x}{(t-\cos x)^2+\sin^2x}dt=\sin x\int_{-1}^{1}\frac{1}{(t-\cos x)^2+\sin^2x}dt$
$=\frac{\sin x}{\sin x}\left[\tan^{-1}\frac{t-\cos x}{\sin x}\right]_{-1}^{1}=\tan^{-1}\frac{1-\cos x}{\sin x}+\tan^{-1}\frac{1+\cos x}{\sin x}$
$=\tan^{-1}\tan\frac{x}{2}+\tan^{-1}\cot\frac{x}{2}=\frac{\pi}{2}$
But i am not getting $\frac{-\pi}{2}$.Have i done some wrong?Please enlighten me.
 [/INST] $$f(x)=\int_{-1}^{1}\frac{\sin x}{t^2-2t\cos x+1}\ dt$$
$$=\int_{0}^{1}\frac{\sin x}{t^2-2t\cos x+1}+\frac{\sin x}{t^2+2t\cos x+1}\ dt$$
$$=2\sin x\int_{0}^{1}\frac{t^2+1}{(t^2+1)^2-4t^2\cos^2 x}\ dt$$
$$=2\sin x\int_{0}^{1}\frac{1+\frac {1}{t^2}}{\biggl(t+\frac {1}{t}\biggr)^2-4\cos^2 x}\ dt$$
$$=2\sin x\int_{0}^{1}\frac{1}{\biggl(t-\frac {1}{t}\biggr)^2+(2\sin x)^2}\ d\biggl(t-\frac {1}{t}\biggr)$$
$$=\biggl(\arctan \biggl(\frac{t-\frac {1}{t}}{2\sin x}\biggr)\biggr)_{0}^{1}$$
$$=\frac {\pi}{2} \text { for } \sin x>0$$
Or 
$$=-\frac {\pi}{2} \text { for } \sin x<0$$
Hence Range of $$f(x)=\biggl\{-\frac {\pi}{2},\frac {\pi}{2}\biggr\}$$
</s>