Cauchy's Theorem- Trigonometric application any help would be very much appreciated. The question asks to evaluate the given integral using Cauchy's formula. I plugged in the formulas for $\sin$ and $\cos$ ($\sin= \frac{1}{2i}(z-1/z)$ and $\cos= \frac12(z+1/z)$) but did not know how to proceed from there.
$$\int_0^{2\pi} \frac{dθ}{3+\sinθ+\cosθ}$$
Thanks. 
 A: Real Method
Often, this type of integral is workable using the substitution
$$
z=\tan(\theta/2)\quad\text{and}\quad\mathrm{d}\theta=\frac{\mathrm{2\,d}z}{1+z^2}\\
\sin(\theta)=\frac{2z}{1+z^2}\quad\text{and}\quad\cos(\theta)=\frac{1-z^2}{1+z^2}
$$
then
$$
\begin{align}
\int_0^{2\pi}\frac{\mathrm{d}\theta}{3+\sin(\theta)+\cos(\theta)}
&=\int_{-\pi}^\pi\frac{\mathrm{d}\theta}{3+\sin(\theta)+\cos(\theta)}\\
&=\int_{-\infty}^\infty\frac{2\mathrm{d}z}{3(1+z^2)+2z+(1-z^2)}\\
&=\int_{-\infty}^\infty\frac{\mathrm{d}z}{z^2+z+2}\\
&=\int_{-\infty}^\infty\frac{\mathrm{d}z}{(z+1/2)^2+7/4}\\
&=\frac{2\pi}{\sqrt7}
\end{align}
$$

Complex Method
$$
\begin{align}
\int_0^{2\pi}\frac{\mathrm{d}\theta}{3+\sin(\theta)+\cos(\theta)}
&=\oint\frac1{3+\frac1{2i}(z-\frac1z)+\frac12(z+\frac1z)}\frac{\mathrm{d}z}{iz}\\
&=\oint\frac{2z}{6z-i(z^2-1)+(z^2+1)}\frac{\mathrm{d}z}{iz}\\
&=\oint\frac{-2i}{(1-i)z^2+6z+(1+i)}\mathrm{d}z\\
\end{align}
$$
The singularities of the integrand are at $\frac{-3+\sqrt7}{2}(1+i)$ and $\frac{-3-\sqrt7}{2}(1+i)$. The second is outside the unit circle, so we only need to compute the residue at the first, which is
$$
\frac{-2i}{2(1-i)z+6}=\frac{-2i}{2\sqrt7}
$$
Thus, the integral is $2\pi i$ times the residue:
$$
\int_0^{2\pi}\frac{\mathrm{d}\theta}{3+\sin(\theta)+\cos(\theta)}=\frac{2\pi}{\sqrt7}
$$
A: $$\begin{align} \int_0^{2 \pi} \frac{d\theta}{3+\sin{\theta}+\cos{\theta}} &= -i \oint_{|z|=1} \frac{dz}{z} \frac{1}{3+(z-z^{-1})/(2 i) + (z+z^{-1})/2}  \\&=  -2 i \oint_{|z|=1}  \frac{dz}{(1-i) z^2+6 z+(1+i)}  \end{align}$$
The poles of  the above integrand  are at 
$$z_{\pm}=\frac{-3 \pm \sqrt{7}}{2}(1+i)$$
Of these, only $z_+$  is inside the unit circle.  The residue at this pole is
$$\frac{-2 i}{ (1-i)((\sqrt{7}-3)(1+i)+6} = \frac{-i}{\sqrt{7}}$$
Therefore, by the residue theorem
$$\int_0^{2 \pi} \frac{d\theta}{3+\sin{\theta}+\cos{\theta}}  = \frac{2 \pi}{\sqrt{7}}$$
A: \begin{align}
z & = e^{i\theta} \\[8pt]
dz & = ie^{i\theta}\,d\theta \\[8pt]
-i\frac{dz}{z} & = d\theta
\end{align}
$$
\int_0^{2\pi}\frac{d\theta}{3+\sin\theta+\cos\theta} = \int\limits_C \frac{-i\,dz}{z\left(3-\frac i2\left(z-\dfrac1z\right)+\frac12\left(z+\dfrac1z\right)\right)}
$$
$$
=\int\limits_C \frac{-i\,dz}{6z + (1-i)z^2 + (1+i)}.
$$
The quadratic polynomial on the bottom has two zeros: one outside the unit disk and one inside.  Specifially, they are at
$$
z = \frac{-3\pm2\sqrt{7}}{1-i} = \frac{-3\pm\sqrt{7}}{2}(1+i).
$$
You can write
$$
\frac{-i}{(1-i)z^2 + 6z +(1+i)} = \frac{A}{z+\left(\frac{3+\sqrt{7}}{2}(1+i)\right)} + \frac{B}{z+\left(\frac{3-\sqrt{7}}{2}(1+i)\right)}.
$$
You need to find $B$.  The integral of the second fraction around the circle will be $2i\pi B$.  Then integral of the first fraction around the circle will be $0$ since it doesn't vanish anywhere in the disk.
