# Complex integration $\int_{-\pi}^{\pi} \frac{\sin^2 t}{3+\cos t}dt$

I'm trying to evaluate the integral $$\int_{-\pi}^{\pi} \frac{\sin^2 t}{3+\cos t}dt$$ using complex numbers.

Meaning, instead of calculating $$\int_{-\pi}^{\pi} \frac{\sin^2 t}{3+\cos t}dt,$$ I want to calculate the integral $$\int_\Gamma \frac{\sin^2 z}{3+\cos z}dz$$ where $\Gamma$ is half the circle with center at origin and radius $\pi$ (in the positive direction), and then the straight line on the $x$ axis from $-\pi$ to $\pi$.

We know that this integral is $0$ because $$\frac{\sin^2 z}{3+\cos z}$$ is analytic in the entire area bounded by $\Gamma$. So that's not an issue, but to evaluate our original integral, we need to now calculate $$\int_\gamma \frac{\sin^2 z}{3+\cos z}dz$$ where $\gamma$ is just the upper half of the circle I mentioned above. Without the line that goes from $-\pi$ to $\pi$ on the $x$ axis.

How do I calculate this integral?

Edit: A good parametrization might be $z=\pi e^{i\theta}$ where $0 \leq \theta \leq \pi$. And then we need to calculate the integral $$\int_{0}^{\pi} \frac{\sin^2 (\pi e^{i \theta})}{3+\cos (\pi e^{i\theta})}i\pi e^{i\theta} d\theta.$$ Doesn't seem easy to do.

• You need to find the simple poles inside the region of $\Gamma$. – Thomas Andrews Jan 5 '15 at 16:05
• I think you want to use a different contour. Try a change of variable instead: $z = e^{it}$, then $[-\pi,\pi]$ gets mapped to a circular contour. – Cameron Williams Jan 5 '15 at 16:06
• I think this is an integral you want to convert to a $z$-integral to use Cauchy's formula or the residue calculus. The point is to identify the integrand as the parametrized form of a particular contour integral, it is not as you attempt it I think. See Section 7.3 of supermath.info/GuideToGamelin.pdf for examples of the technique. – James S. Cook Jan 5 '15 at 16:07
• There are no poles. It's analytic in $\Gamma$. – Oria Gruber Jan 5 '15 at 16:08
• A simple approach is to calculate the integral over the real interval $[-\pi,\pi]$. The integrand has an antiderivative which can be found explicitly. – Hans Engler Jan 5 '15 at 16:51

By setting $z=e^{it}$, we have $dz=i e^{it} dt$, so $dt=-\frac{i}{z}dz$ and:
$$I = \int_{-\pi}^{+\pi}\frac{\sin^2 t}{3+\cos t}\,dt = -i\oint \frac{\left(\frac{z-1/z}{2i}\right)^2}{z\left(3+\frac{z+1/z}{2}\right)}\,dz=i\oint\frac{(1-z^2)^2}{z^2(1+6z+z^2)}\,dz$$ where the path of integration is the unit circle. The integrand function $f(z)=\frac{(1-z^2)^2}{z^2(1+6z+z^2)}$ has two poles inside the unit disk, in $z=0$ and $z=-3+\sqrt{8}$. The last integral can be computed by applying the residue theorem:
$$I = -2\pi\cdot\sum_{\xi\in\{0,-3+\sqrt{8}\}}\operatorname{Res}(f(z),z=\xi)=-2\pi(-3+2\sqrt{2})=\color{red}{2\pi(3-\sqrt{8})}.$$