# Evaluate the integral $\int_0^{2 \pi} {\cos^2 \theta \over a + b \cos \theta}\; d\theta$

Given $a > b > 0$ what is the fastest possible way to evaluate the following integral using Residue theorem. I'm confused weather to take the imaginary part of $z^2$ or whole integral. $$\int_0^{2 \pi} {\cos^2 \theta \over a + b \cos \theta}\; d\theta$$

-

## 3 Answers

If $z=e^{i\theta}$, then $\cos\theta=\dfrac 1 2\left(z+\dfrac1z\right)$, and $dz=ie^{i\theta}\,d\theta/2=iz\,d\theta/2$, so $-2i\dfrac{dz}{z} = d\theta$. Then $$\int_0^{2\pi} \frac{\cos^2\theta}{a+b\cos\theta} d\theta = \int\limits_\text{circle} \frac{\frac14\left(z+\frac1z\right)^2}{a+\frac b2\left(z+\frac1z\right)}(-i)\frac{dz}{z} = -i\int\limits_\text{circle} \frac{z^4+2z^2+1}{2z^2(2az+b(z^2+1))} dz.$$

This function has a double pole at $z=0$ and simple poles at $\dfrac{-a\pm\sqrt{a^2-b^2}}{b}$. So the question is: for which values of $a,b$ are the simple poles inside the circle? If there's just one simple pole inside the circle at $c$, then the integral becomes $$\int\limits_\text{circle} \frac{g(z)}{z-c} dz = 2\pi i g(c),$$ where $g(z)$ is whatever's left after you've factored out $1/(z-c)$. If there's more than one simple pole, you need a sum: take values of $g$ at those points and sum them.

-
Actually I found I could substitute $\cos^2 \theta = Im(z^2)$ and simplify things a lot :D the whole integral will be $Im ( \int z^2/...)$ – hasExams Sep 1 '12 at 17:41
We have $e^{2i\theta}=\cos[2\theta]+i\sin[2\theta]$. You take the real part ($\cos^{2}[\theta]-\sin^{2}[\theta]$), not the imaginary part (which is $2\sin[\theta]\cos[\theta]$ instead). – user32240 Sep 2 '12 at 6:17

1
@Michael: We have $\cos[\theta]=\frac{1}{2}(\cos[\theta]+i\sin[\theta])+(\cos[\theta]-i\sin[\theta‌​])$, you missed a factor. – user32240 Sep 2 '12 at 6:27
@user32240 : Fixed now, I hope. – Michael Hardy Sep 2 '12 at 18:34

We should have

$$\frac{\cos^{2}\theta}{a+b\cos\theta}=\frac{1}{b}\cos\theta-\frac{\frac{a}{b}\cos\theta}{a+b\cos\theta}.$$

The first part of the definite integral is easily evaluated. The second part is the same as evaluating

$$\int \frac{\cos\theta}{a+b\cos\theta}d\theta=\int\frac{1}{b}\left(1-\frac{a}{a+b\cos\theta}\right)d\theta.$$

So we only need to evaluate

$$\int\frac{1}{a+b\cos\theta}d\theta.$$

This can be done by various trignometry identities such as using $\tan(\theta/2)$. A detailed step by step proof can be found here (click show steps).

-

thanks for idea ... I think i can evaluate $\frac{1}{a+b\cos[\theta]}d\theta$ very easily – hasExams Sep 1 '12 at 8:25
well, I am not sure if this is the "fastest possible" way to do it. I guess you are expecting some contour integral or manipulations involving $\Gamma$ functions. – user32240 Sep 1 '12 at 8:28
I'm supposed to use contour integral ... the $z^2$ part is awful – hasExams Sep 1 '12 at 8:40

Hint: put $z={\rm e}^{i\theta}$ and change the integral to the form $\int_{|z|=1}f(z)\,dz \,,$ then use residue theorem. Exploit the identity $$\cos\theta = \frac{1}{2}\left({\rm e}^{i \theta} + {\rm e}^{- i \theta}\right)\,.$$

-

Are you suggesting doing an integral of the form $\int_{|z|=1}\frac{z^{2}}{a+bz}$? But though it has an obvious pole at $z=-\frac{a}{b}$(which is outside of the contour), I do not see how to get the original integral from $\cos[\theta]=\frac{z+\overline{z}}{2}$. But thanks for the hint. – user32240 Sep 1 '12 at 8:37
yeah ... kinda something like that. But instead of squaring ... you can take Real part of $z^2$ which makes the problem very simple. Kinda confused on that – hasExams Sep 1 '12 at 8:38
I am not sure how to deal with the bottom part, $(a+b\cos[\theta])$ is not easily treatable. – user32240 Sep 1 '12 at 8:45
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 31, "mathjax_display_tex": 7, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9097309708595276, "perplexity_flag": "head"}