Integrate from $0$ to $2\pi$ with respect to $\theta$ the following $(\sin \theta +\cos \theta)^n$ $$\int_0^{2\pi} (\sin \theta +\cos\theta)^n d\theta$$
First I think about De Moivre's formula given by 
$$(\cos x +i \sin x)^n=\cos (nx)+i\sin (nx)$$
I tried to apply it but I found myself lost !
Any tips or information how to solve this integral ? Thanks in advance !
 A: That won't help. Use $\sin\theta+\cos\theta=\sqrt{2}\sin(\theta+\pi/4)$. The phase shift doesn't affect integrals over a period, so your integral is $2^{n/2}\int_0^{2\pi}\sin^{2n}\theta d\theta$, which is $0$ for odd $n$. For even $n$, say $n=2k$, it's $$2^k\int_0^{2\pi}\sin^{2k}\theta d\theta=2^k\int_0^{2\pi}\sin^{2k}\theta d\theta=2^{k+2}\int_0^{\pi/2}\sin^{2k}\theta d\theta.$$To evaluate that, we use Beta functions:$$2^{k/2+2}\int_0^{\pi/2}\sin^{2k}\theta d\theta=2^{k/2+1}\operatorname{B}(k+\tfrac12,\,\tfrac12)=2^{k/2+1}\frac{\Gamma(k+\tfrac12)\sqrt{\pi}}{k!}=\frac{(2k)!}{k!^22^{3k/2-1}}\pi.$$This is $\frac{n!}{(n/2)!^22^{3n/4-1}}\pi$.
A: Hint :
Let : 
$$I=\int_0^{2\pi} (\sin \theta +\cos \theta)^n d\theta$$ 
Using Euler's definition :
$$\sin \theta =\frac{e^{i\theta}-e^{-i\theta}}{2i} \ \ \ \ \cos\theta=\frac{e^{i\theta}+e^{-i\theta}}2$$
So : 
$$I=\int_0^{2\pi}\bigg(\frac{e^{i\theta}-e^{-i\theta}}{2i}+\frac{e^{i\theta}+e^{-i\theta}}2\bigg)^nd\theta$$
Let $z=e^{i\theta}$ and $d\theta=\frac{dz}{iz}$:
Your integral is : 
$$\begin{align} I&=\oint_{|z|=1} \bigg(\frac{z-z^{-1}}{2i}+\frac{z+z^{-1}}2\bigg)^n\frac{dz}{iz} \\
&=\frac{1}{2^n i^{n+1}}\oint_{|z|=1}\frac{\big((1+i)z+(i-1)z^{-1}\big)^n}{z}dz \end{align}$$
To go further use the binomial theorem to simplify it ! good luck :) !
