Improper Real Integral Involving Circular Functions Using Complex Transformation I am trying to calculate the following integral using complex transformation;
$$\int_0^{2\pi}\frac{\cos^3\theta}{1-2a \cos\theta+a^2}d\theta$$
where $$\left\lvert a \right\rvert<1$$
I am comfortable with sine or cosine with their 1st power, but 3rd power gave me a really hard time. Any ideas?
 A: Notice that $1-2a\cos\theta+a^2 = (1-ae^{i\theta})(1-ae^{-i\theta})$, hence
$$\frac{1}{1-2a\cos\theta+a^2}=\sum_{j\geq 0}a^j e^{ji\theta}\sum_{k\geq 0}a^k e^{-ki\theta}\tag{1}$$
has a simple Fourier cosine series. The same holds for $\cos^3\theta$:
$$ \cos^3\theta = \frac{3}{4}\cos(x)+\frac{1}{4}\cos(3x) \tag{2}$$
and since $\int_{0}^{2\pi}\cos(n\theta)\cos(m\theta)\,d\theta=\pi\,\delta(m,n) $,
$$ \int_{0}^{2\pi}\frac{\cos^3\theta}{1-2a\cos\theta+a^2}\,d\theta=\pi\left[\frac{3}{4}\sum_{|j-k|=1}a^{j+k}+\frac{1}{4}\sum_{|j-k|=3}a^{j+k}\right]\tag{3}$$
that simplifies to:
$$ \pi\left[\frac{3}{4}\sum_{j\geq 0}a^{2j+1}+\frac{3}{4}\sum_{j\geq 1}a^{2j-1}+\frac{1}{4}\sum_{j\geq 0}a^{2j+3}+\frac{1}{4}\sum_{j\geq 3}a^{2j-3}\right]$$
then to:
$$\boxed{ \int_{0}^{2\pi}\frac{\cos^3\theta}{1-2a\cos\theta+a^2}\,d\theta = \color{red}{\frac{a (3+a^2)}{1-a^2}\cdot\frac{\pi}{2}}}\tag{4}$$
This question is strictly related with the residue theorem and the Poisson kernel.
A: Mr. Jack D'Aurizio,
S.I. Hayek's book covers this topic and suggests using the residue theorem, by transforming the f(x) function to f(z) in complex plane.
$$z=e^{i\theta}$$
$$ sin\theta=\frac{1}{2i}(z-\frac{1}{z}) $$
$$ cos\theta=\frac{1}{2 }(z+\frac{1}{z}) $$
$$ d\theta=-i\frac{dz}{z} $$
and the integral
$$I=\int_0^{2\pi}F(sin\theta,cos\theta)d\theta$$
becomes
$$I=\int_C{f(z)dz}$$
on a unit circle which is centered at the origin. Still, I am not sure how to transform
$$cos(3\theta)$$
with this method.
