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.
 A: 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}$$
A: You've accomplished the tougher part
Now observe that $$\dfrac{1-\cos x}{\sin x}\cdot\dfrac{1+\cos x}{\sin x}=1$$
and use $\arctan y+\arctan\dfrac1y=$sgn$(y)\cdot\dfrac\pi2$  (Proof)
A: $$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\}$$
