$\int_{0}^\pi \frac{\sin(nx)}{\sin x} dx$ How do I integrate :$\int_{0}^\pi \frac{\sin(n\theta)}{\sin \theta} d\theta $
I did the following:
$\int_{0}^\pi \frac{\sin(n \theta)}{\sin \theta}d\theta = \mbox{Im} \int_{0}^{\pi} \frac{e^{i n \theta}}{\sin \theta} d\theta = \mbox{Im} \int_{0}^{\pi} 2i \frac{e^{i n \theta}}{e^{i \theta}-e^{- i \theta}} d\theta$ 
Put $ z=e^{i \theta}$ then
$ \mbox{Im} \int_{|z|=1} \frac{z^n}{(z^2-1)} dz$
Now I have problem , because the function $f(z)= \frac{z^n}{(z^2-1)}$ is not analytic on the boundary of the unit disk. Now I can not use the Cauchy Residue Theorem.
The answer is $0$ if $n$ is even and $ \pi$ if $n$ is odd.
I stuck: 
Any suggestions ?
 A: There is a much simpler way using only a single trig identity by deriving a reduction formula. I'm not sure if you were specifically looking for a complex analysis method but I'll post it here anyway.
$$ I_n = \int_0^\pi \frac{\sin(nt)}{\sin t} dt \\ I_{n+2}-I_n =\int_0^\pi \frac{\sin((n+2)t)-\sin(nt)}{\sin t} dt $$
Using $ \ \sin a - \sin b = 2 \sin(\frac{a-b}{2})\cos(\frac{a+b}{2})$:
$$I_{n+2}-I_n = 2 \int_0^\pi \frac{\sin t\cos((n+1)t)}{\sin t} dt = 2\int_0^\pi \cos((n+1)t)dt =0$$
Thus $\ I_{n+2}=I_n \ for \ n \ge 2 \ $ and it only suffices to evaluate the integral for n=2 and n=3 and all other larger values of n follow by induction.
$$ I_2 = \int_0^\pi \frac{\sin 2t}{\sin t} dt = 2\int_0^\pi \frac{\sin t \cos t}{\sin t} dt = 2\int_0^\pi \cos t dt = 0 \ $$ For I3, use the same identity as above but rearranged: $ \ \sin 3t - \sin t= 2\cos 2t \sin t  \ \therefore \ \sin 3t = \sin t (2 \cos 2t +1)$
$$ I_3 = \int_0^\pi \frac{\sin 3t}{\sin t} dt =\int_0^\pi 2 \cos 2t+1 dt  =\pi \\ I_n = 0 \  for  \ even \ n \ge 2 \\ I_n = \pi \  for  \ odd \ n \ge 3$$
A: You certainly can use Cauchy's theorem here.
The integral is equal to
$$\begin{align}-\frac{i}{2} \oint_{|z|=1} \frac{dz}{z^n} \frac{z^{2 n}-1}{z^2-1} &= \frac{\pi}{(n-1)!} \frac{d^{n-1}}{dz^{n-1}}\left [ 1+z^2+z^4+\cdots+z^{2 n-2}\right ]_{z=0}\end{align}$$
The poles at $z=\pm 1$ cancel out, so the only pole is at $z=0$.  When $n$ is even, the derivative term is clearly zero, as an odd derivative evaluated at zero is zero.  When $n$ is odd, however, say $n=2 k+1$, then the result is
$$\frac{\pi}{(2 k)!} \frac{d^{2 k}}{dz^{2 k}} \left [ 1+z^2+z^4+\cdots+z^{4 k}\right ]_{z=0}$$
which is indeed $\pi$, as the only surviving derivative is attached to the $z^{2 k}$ term.
A: $$I=\int_{0}^\pi \frac{\sin(n\theta)}{\sin \theta} d\theta =\frac12 \int_{-\pi}^\pi \frac{\sin(n\theta)}{\sin \theta} d\theta $$
$$= \frac12 \int_{-\pi}^\pi \frac{e^{in\theta}-e^{-in\theta}}{e^{i\theta}-e^{-i\theta}}  d\theta  $$
$$= \frac12 \int_{-\pi}^\pi \sum_{k=0}^{n-1} e^{i\theta (2k+1-n)}  d\theta  $$
$$= \frac12  \sum_{k=0}^{n-1} \int_{-\pi}^\pi e^{i\theta (2k+1-n)}  d\theta  $$
If $2k+1-n \ne 0$ then this integral is zero (because $e^{i\pi m}-e^{-i\pi m}=0$ for any integer $m$).
Therefore we get
$$I=0 \;\;\text{if n is even}$$
$$I=\pi \;\;\text{if n is odd}$$
A: Hint:
$$\frac{\sin ((n+1)\theta)}{\sin\theta} = T_n(\cos\theta)
$$
where $T_n$ is the second kind Tchebychev polynomial.
Then you can use the relation:
$$
\frac1{t^2 - 2tx + 1} = \sum_{n=0}^\infty T_n(x)t^n
$$
