# Find $\int\limits_{0}^{2\pi} \frac{1}{5-3\cos(x)} \,\,dx$

I have to find $$\int_0^{2\pi} \frac{1}{5-3\cos(x)} \,\,dx$$

I tried to do it by substitution $t = \tan(\frac{x}{2})$

Then we have that $$\cos(x) = \frac{1-t^2}{1+t^2} \quad dx = \frac{2\,dt}{1+t^2}$$ but then also limits of integration are changing so we have $$\int\limits_{t(0)}^{t(2\pi)} \frac{1}{5 - \frac{1-t^2}{1+t^2}} \cdot \frac{2dt}{1+t^2} = \int\limits_0^0 \frac{1}{5 - \frac{1-t^2}{1+t^2}} \cdot \frac{2\,dt}{1+t^2} = 0$$ I figured out that it is not correct because $\tan(\frac{\pi}{2})$ is not defined and $t(\pi) = \tan(\frac{\pi}{2})$ and $\pi \in [0, 2\pi]$. How can I "repair" that and do it right?

• $f(x)=f(2\pi-x) \implies I= 2 f(\pi)$ Commented May 7, 2015 at 14:30
• Would you like to expand your thought? Because I do not quite understand your tip :c it looks like I haven't seen your method. Commented May 7, 2015 at 14:36
• Um, It's a property of integration I have proved it for a another function previously similarly, let me send link. Commented May 7, 2015 at 14:40
• math.stackexchange.com/questions/1271281/integration-of-logsinx Commented May 7, 2015 at 14:41
• Five answers have been posted so far (including mine---see below) and yet I am the only person who has up-voted the question. As $x$ goes from $0$ to $\pi$, $t$ goes from $0$ to $+\infty$ and as $x$ goes from $\pi$ to $2\pi$, $t$ goes from $-\infty$ to $0$. So $t$ does go from $0$ to $0$ if you look at it that way. But you need $\displaystyle\int_{-\infty}^\infty \cdots \cdots \,dt$. ${}\qquad{}$ Commented May 7, 2015 at 14:58

Since the function you integrate is periodic you can change the limits and take the same integral from $-\pi$ to $\pi$. After the substitution you'll end up with an integral from -infinity to +infinity. If you want to stick to the original limits you have to break your integral to two parts.

We have $$\dfrac1{5-3\cos(x)} = \dfrac15 \cdot \dfrac1{1-\dfrac{3\cos(x)}5} = \dfrac15 \sum_{k=0}^{\infty} \left(\dfrac35\right)^k \cos^k(x)$$ Hence, the integral becomes $$I = \underbrace{\sum_{k=0}^{\infty} \dfrac15 \cdot \left(\dfrac35\right)^k \int_0^{2\pi} \cos^k(x)dx = \sum_{k=0}^{\infty} \dfrac15 \cdot \left(\dfrac35\right)^{2k} \int_0^{2\pi} \cos^{2k}(x)dx}_{\text{Integral of odd powers of \cos over [0,2\pi] vanish}}$$ From here, we have that $$\int_0^{2\pi} \cos^{2k}(t) = 4\int_0^{\pi/2} \cos^{2k}(t) = \dfrac{\pi}{2^{2k-1}} \dbinom{2k}k$$ Further, we have $$\sum_{k=0}^{\infty} \dbinom{2k}k x^k = \dfrac1{\sqrt{1-4x}}$$ Hence, we obtain $$I = \dfrac{2\pi}5 \sum_{k=0}^{\infty} \dbinom{2k}k \left(\dfrac3{10}\right)^{2k} = \dfrac{2\pi}5 \cdot \dfrac1{\sqrt{1-4 \cdot 9/100}} = \dfrac{2\pi}5 \cdot \dfrac54 = \dfrac{\pi}2$$

• A nice solution. Commented May 7, 2015 at 15:21
• a very dirty way of doing this simple integral (+1) Commented May 7, 2015 at 15:48
• @ADG Simplicity lies in the eye of the beholder. Commented May 7, 2015 at 15:58

While there have been several clean and different approaches shown here, I'm surprised that nobody has shown that contour integration works well also. To that end here we go....

Let $z=e^{ix}$ so that $dx=dz/iz$ and $\cos x = \frac12 (z+z^{-1})$. We have

\begin{align} I&=\int_0^{2\pi} \frac{1}{5-3\cos x}dx\\\\ &=\oint_C \frac{1}{5-3\frac12 (z+z^{-1})}\frac{dz}{iz}\\\\ &=\oint_C \frac{\frac23 i}{(z-3)(z-1/3)}dz\\\\ &=2\pi i \text{Res}_{\text{in C}} \left(\frac{\frac23 i}{(z-3)(z-1/3)}\right) \end{align}

where $C$ is the unit circle in the complex $z$-plane.

Note that the pole at $z=1/3$ is inside the unit circle whereas the pole at $z=3$ is outside the unit circle.

Thus, the residue is given by

$$\text{Res}_{z=1/3} \left(\frac{\frac23 i}{(z-3)(z-1/3)}\right)=\frac23 i\,\lim_{z\to 1/3}\left((z-1/3)\,\frac{1}{(z-3)(z-1/3)}\right)=-i/4$$

which after multiplying by $2\pi i$ shows that

$$I=\pi/2$$

as expected!

Hint:
Substitute u=tan(x/2). Then transform the integrand using sinx = 2u/(u^2+1), cosx = (1-u^2)/(u^2+1)

• The answer should be: π/2 Commented May 7, 2015 at 14:36
• I have actually tried that. Or probably I don't get hint. Commented May 7, 2015 at 14:41
• Yes. It is $\pi/2$ for me too. Most probably. Commented May 7, 2015 at 14:42

As $x$ goes from $0$ to $\pi$, $t$ goes from $0$ to $+\infty$ and as $x$ goes from $\pi$ to $2\pi$, $t$ goes from $-\infty$ to $0$. So $t$ does go from $0$ to $0$ if you look at it that way. But you need $\displaystyle\int_{-\infty}^\infty\cdots\cdots\,dt$.

This is an instance in which one should think of just a single $\infty$ at both ends of the line, making the line topologically a circle. As the point $(\cos x,\sin x)$ goes once around the circle in the plane, the variable $t$ goes once around the circle that is $\mathbb R\cup\{\infty\}$.

This property will help you to simplify: $$\int_0^{2a}f(x)\,dx = \int_0^{a}f(x)\,dx+\int_0^{a}f(2a-x)\,dx$$

Use it with $a=\pi$.

(This is the 14th property on this list)

Here's a easier way

$I=2 \int ^{\pi}_0 \frac{1}{5-3\cos x}.dx$

After substitution,

$I=2 \int ^{b\to \infty}_0 \frac{1}{4t^2+1}.dt$

Which gives,

$I= \left|\tan^{-1}(4t)\right|^{b\to \infty}_0$

From here it's pretty easy. :)

Another method to solve such integrals is usually encountered in the context of harmonic functions and in PDE textbooks. This method uses the Poisson integral formula for a harmonic function inside a disc, that is $u(r,\theta) = \frac{1}{2\pi}\int_0^{2\pi} \frac{a^2-r^2}{a^2-2ar\cos(\theta-\phi)+r^2}h(\phi)d\phi$, where $h(\phi)$ is the boundary value (on the circle). Note that by taking $h=const.$, $\phi=0$, and properly choosing $a$, $r$, and the constant value of $h$ you can end up with the exact integral you are looking for. By invoking the maximum\minimum principle for harmonic functions you can show that the only harmonic function which is constant on the boundary is constant over the entire range, and hence its value in each point (including the particular choice of $r$ and $\theta$ in case) is the same as on the boundary.