<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] Notice, second last line, 
$$\frac{\sin x}{\sin x}\left[\tan^{-1}\left(\frac{t-cos x}{\sin x}\right)\right]_{-1}^{1}$$
$$=\tan^{-1}\left(\frac{1-cos x}{\sin x}\right)-\tan^{-1}\left(\frac{-1-cos x}{\sin x}\right)$$
$$=\tan^{-1}\left(\frac{1-cos x}{\sin x}\right)+\tan^{-1}\left(\frac{1+cos x}{\sin x}\right)$$
$$=\tan^{-1}\left(\frac{\frac{1-cos x}{\sin x}+\frac{1+cos x}{\sin x}}{1-\frac{1-cos x}{\sin x}\frac{1+cos x}{\sin x}}\right)$$
$$=\tan^{-1}\left(\frac{\frac{2}{\sin x}}{1-\frac{1-cos^2 x}{\sin^2 x}}\right)$$
$$=\tan^{-1}\left(\frac{\frac{2}{\sin x}}{1-\frac{sin^2 x}{\sin^2 x}}\right)$$
$$=\tan^{-1}\left(\frac{\frac{2}{\sin x}}{1-1}\right)=\tan^{-1}(\infty)=\frac{\pi}{2}$$
</s>