<s>[INST] Evaluate the definite integral $I = \int_0^\pi \frac{\sin^2(\theta) d\theta}{10-6\cos(\theta)}$ I'm studying for my upcoming complex analysis qualifying exam by working through problems in past exams. For this problem, I'd like to know (1) if my answer is correct and complete (i.e. whether I've made any errors/omissions), and (2) if there are any better/faster ways of evaluating this integral. Thanks!
Problem:
Evaluate the definite integral
$$I = \int_0^\pi \frac{\sin^2(\theta) d\theta}{10-6\cos(\theta)}.$$
Attempted Solution:
We first note that the integrand is an even function, thus
$$I = \int_0^\pi \frac{\sin^2(\theta) d\theta}{10-6\cos(\theta)} = \frac{1}{2}\int_{-\pi}^{\pi} \frac{\sin^2(\theta) d\theta}{10-6\cos(\theta)}. $$
Let $z=e^{i\theta} \implies d\theta = \frac{dz}{iz}$, then we have
$$\sin\theta =\frac{e^{i\theta} - e^{-i\theta}}{2i} =\frac{z-z^{-1}}{2i} \implies \sin^2\theta = \frac{z^2-2+z^{-2}}{-4} $$
and
$$\cos\theta = \frac{e^{i\theta} + e^{-i\theta}}{2} = \frac{z+z^{-1}}{2}. $$
We can now substitute such that for the unit circle $\gamma(\theta) = e^{i\theta}, \;\theta\in[-\pi,\pi]$, we have
\begin{align*}
\frac{1}{2}\int_{-\pi}^{\pi} \frac{\sin^2(\theta) d\theta}{10-6\cos(\theta)} &= \frac{1}{2}\oint_\gamma \frac{(-\frac{1}{4})(z^2-2+z^{-2})}{10-3(z+z^{-1})}\frac{dz}{iz} \\
&= \frac{i}{8} \oint_\gamma \frac{z^2-2+z^{-2}}{z(10-3z-3z^{-1})} dz \\
&= \frac{i}{8} \oint_\gamma \frac{z^4 - 2z^2 + 1}{z^2(10z-3z^2 -3)} dz \\
&= -\frac{i}{24} \oint_\gamma \frac{z^4-2z^2 + 1}{z^2(z^2-\frac{10}{3}z + 1)} dz \\
&= -\frac{i}{24} \oint_\gamma \frac{z^4-2z^2 + 1}{z^2(z-3)(z-\frac{1}{3})} dz
\end{align*}
It's clear that our integrand has a pole of order 2 at $z=0$, and two simple poles at $z=3$ and $z=1/3$. Using the Residue Theorem, we can evaluate this integral as $2\pi i$ times the sum of the residues at $z=0$ and $z=1/3$, disregarding $z=3$ since this pole is outside of the curve $\gamma$.
At the simple pole $z=1/3$, we calculate
\begin{align*}
\text{Res}(1/3) &= \lim_{z\to\frac{1}{3}} (z-\frac{1}{3})\left(-\frac{i}{24} \frac{z^4-2z^2 + 1}{z^2(z-3)(z-\frac{1}{3})} \right) \\
&= -\frac{i}{24}\lim_{z\to\frac{1}{3}} \left( \frac{z^4-2z^2 + 1}{z^2(z-3)} \right) \\
&= \frac{i}{9}
\end{align*}
The pole at $z=0$ is of order 2, therefore we calculate
\begin{align*}
\text{Res}(0) &= \lim_{z\to 0}\frac{d}{dz} z^2 \left(-\frac{i}{24} \frac{z^4-2z^2 + 1}{z^2(z-3)(z-\frac{1}{3})} \right) \\
&= -\frac{i}{24} \lim_{z\to 0}\frac{d}{dz} \left( \frac{z^4-2z^2 + 1}{(z-3)(z-\frac{1}{3})} \right) \\
&= -\frac{i}{24} \lim_{z\to 0} \frac{(4z^3-4z)(z-3)(z-\frac{1}{3})-(z^4-2z^2+1)(2z-\frac{10}{3})}{(z-3)^2(z-\frac{1}{3})^2}\\
&= \frac{-5i}{36}
\end{align*}
Finally, we calculate
$$
I=2\pi i\Big(\text{Res}(0) + \text{Res}(\frac{1}{3})\Big) = 2\pi i\Big(\frac{-5i}{36} + \frac{i}{9}\Big) = \frac{\pi}{18}
$$
 [/INST] I think is perfect. Another way is to use the Weierstrass substitution $u=\tan(x/2)$. But is cumbersome and also your way is the apropiate way for a complex analysis course
</s>