# How to integrate $\int_{0}^{2\pi}\frac{\mathrm dx}{(1-a\cos x)^2}$

I'm having a hard time trying to resolve this integral : $$\int_{0}^{2\pi}\frac{\mathrm dx}{(1-a\cos x)^2}$$ where $$a$$ is a positive real constant.

I tried using substitution, but I'm stuck by the fact that the integral must be computed between $$0$$ and $$2\pi$$, which leads to integration between $$X$$ and $$X$$ (where $$X$$ can be $$0$$ or $$1$$ anything following the substitution in the boundaries). I'm not looking for the full result if the computation is complicated, just some lead to start off...

Thanks

UPDATE : seeing the answers proposed, I checked that indeed $$|a|<1$$.

• Do you realize it essentially is the area enclosed by an ellipse? Jan 16, 2019 at 17:24
• Similar : math.stackexchange.com/q/1846774/321264. Jan 16, 2019 at 18:01
• You can start with the standard result $$\int_{0}^{2\pi}\frac{dx}{a-b\cos x} =\frac{2\pi}{\sqrt{a^2-b^2}}$$ and differentiate it with respect to $a$ and then put $a=1$ and replace $b$ by $a$. Jan 17, 2019 at 5:24

The polar equation of an ellipse (with respect to a focus, taking the aphelion as the point associated to $$\theta=0$$) is $$\rho(\theta) = \frac{\ell}{1-e\cos\theta}$$ where, in terms of the standard parameters, $$\ell$$ is the semi-latus rectum $$\frac{b^2}{a}$$ and $$e$$ is the eccentricity $$\frac{c}{a}$$.
The area enclosed by such ellipse is $$\pi a b$$ or $$\frac{1}{2}\int_{0}^{2\pi}\frac{\ell^2}{(1-e\cos\theta)^2}\,d\theta,$$ so we get that for any $$e\in[0,1)$$ the following identity holds: $$\int_{0}^{2\pi}\frac{d\theta}{(1-e\cos\theta)^2}= \frac{2\pi a b}{\ell^2}=2\pi\left(\frac{a}{b}\right)^3=\frac{2\pi}{\left(\frac{b^2}{a^2}\right)^{3/2}}={\frac{2\pi}{(1-e^2)^{3/2}}}.$$ The same holds if, in the LHS, we replace $$e$$ with $$-e$$, since $$\rho(\theta) = \frac{\ell}{1+e\cos\theta}$$ is the polar equation of the same ellipse, with the perihelion being taken as the point associated to $$\theta=0$$. So we get that for any $$a\in(-1,1)$$ $$\int_{0}^{2\pi}\frac{d\theta}{(1-a\cos\theta)^2}= \color{blue}{\frac{2\pi}{(1-a^2)^{3/2}}}.$$

• Thanks a lot for your answer, I did not realized this was the polar equation of an ellipse! This solution looks quite elegant. I also update my post, the coefficient $a$ is indeed always less than 1. Jan 16, 2019 at 20:33
• +1 for polar equation of ellipse. Although I believe computation of area of ellipse is easier if one uses rectangular coordinates. So in effect your answer uses the equivalence/transformation between these coordinate systems. Jan 17, 2019 at 5:15

HINT:

Note that for $$|a|<1$$

\begin{align} \int_0^{2\pi}\frac{1}{(1-a\cos(\theta))^2}\,d\theta&=\frac1{a^2}\int_0^{2\pi}\frac{1}{(1/a-\cos(\theta))^2}\,d\theta\\\\ &=-\frac1{a^2}\frac{d}{d(1/a)}\int_0^{2\pi}\frac{1}{1/a-\cos(\theta)}\,d\theta\tag1\\\\ &= -\frac2{a^2}\frac{d}{d(1/a)}\int_0^{\pi}\frac{1}{1/a-\cos(\theta)}\,d\theta\tag2 \end{align}

Now use the Weierstrass substitution to evaluate the integral on the right-hand side of $$(2)$$ and differentiate to obtain the coveted result.

Alternatively, one could use contour integration to evaluate the integral of interest or evaluate the integral on the right-hand side of $$(1)$$.

• The Weierstrass substitution is going to fail if you apply it to this integral. You have to do something first (integrate on $[-\pi,\pi]$ and split, for instance). Jan 16, 2019 at 17:51
• @Jean-ClaudeArbaut This was meant to be a HINT only. But I've added another line to facilitate. Jan 16, 2019 at 19:52

My goal with this answer is to give you a bunch of different really general integral formulas that you may find very useful.

$$F(a)=\int_0^{\pi}\frac{\mathrm dx}{(1+a\cos x)^2}$$ So your integral is $$2F(-a)$$. First off we will preform the tangent-half-angle substitution $$t=\tan(x/2)$$. Hence we have that $$F(a)=2\int_0^\infty \frac1{(1+a\frac{1-t^2}{1+t^2})^2}\frac{\mathrm dt}{1+t^2}$$ $$F(a)=2\int_0^{\infty}\frac{1+t^2}{[(1-a)t^2+a+1]^2}\mathrm dt$$ Which we can rewrite as $$F(a)=\frac2{1-a}\int_0^\infty\frac{\mathrm dt}{(1-a)t^2+a+1}+\frac{4a}{a-1}\int_0^{\infty}\frac{\mathrm dt}{[(1-a)t^2+a+1]^2}$$

Next we consider the very general integral $$I(m;a,b)=\int_0^\infty \frac{\mathrm dx}{(ax^2+b)^{m+1}}$$ First we integrate by parts with $$\mathrm dv=\mathrm dx$$ to produce $$I(m;a,b)=\frac{x}{(ax^2+b)^{m+1}}\bigg|_0^{\infty}+2(m+1)\int_0^\infty\frac{ax^2}{(ax^2+b)^{m+2}}\mathrm dx$$ $$I(m;a,b)=2(m+1)\int_0^\infty\frac{ax^2+b-b}{(ax^2+b)^{m+2}}\mathrm dx$$ $$I(m;a,b)=2(m+1)I(m;a,b)-2(m+1)bI(m+1;a,b)$$ Then solving for $$I(m+1;a,b)$$ and replacing $$m+1$$ with $$m$$, $$I(m;a,b)=\frac{2m-1}{2bm}I(m-1;a,b)$$ And for the base case: $$I(0;a,b)=\int_0^{\infty}\frac{\mathrm dx}{ax^2+b}$$ The Trig sub $$x=\sqrt{\frac{b}a}\tan u$$ gives $$I(0;a,b)=\frac\pi{2\sqrt{ab}}$$ Which is a special case of $$\int_{x_1}^{x_2}\frac{\mathrm dx}{ax^2+bx+c}=\frac2{\sqrt{4ac-b^2}}\arctan\frac{2ax+b}{\sqrt{4ac-b^2}}\bigg|_{x_1}^{x_2}$$ Anyway, the recurrence has the solution $$I(m;a,b)=\frac\pi{2^{2m+1}b^m\sqrt{ab}}{2m\choose m}$$ Which we will apply very shortly!

Recalling the definition of $$I(m;a,b)$$, we have that $$F(a)=\frac2{1-a}I(0;1-a,1+a)+\frac{4a}{a-1}I(1;1-a,1+a)$$ $$F(a)=\frac\pi{(1-a^2)^{3/2}}$$ And since your integral is given by $$2F(-a)$$, $$\int_0^{2\pi}\frac{\mathrm dx}{(1-a\cos x)^2}=\frac{2\pi}{(1-a^2)^{3/2}}$$

Consider the integral $$C(n;a)=\int_0^\pi \frac{\mathrm dx}{(1+a\cos x)^n}$$ Starting with $$t=\tan\frac{x}2$$, $$C(n;a)=2\int_0^\infty \frac1{\left[1+a\frac{1-t^2}{1+t^2}\right]^n}\frac{\mathrm dt}{1+t^2}$$ $$C(n;a)=2\int_0^\infty \frac{\left(t^2+1\right)^{n-1}}{\left[(1-a)t^2+1+a\right]^n}\mathrm dt$$ Then using the binomial theorem, $$C(n;a)=2\sum_{k=0}^{n-1}{n-1\choose k}\int_0^\infty\frac{x^{2k}}{\left[(1-a)x^2+1+a\right]^n}\mathrm dx$$ $$C(n;a)=\frac2{(1-a)^n}\sum_{k=0}^{n-1}{n-1\choose k}\int_0^\infty\frac{x^{2k}}{\left[x^2+\frac{1+a}{1-a}\right]^n}\mathrm dx$$ We then recall the integral due to my collaborator @DavidG, $$\int_0^\infty\frac{x^{q}}{\left[x^w+b\right]^p}\mathrm dx=\frac{b^{\frac{1+q}{w}-p}}{w}\frac{\Gamma\left(p-\frac{1+q}{w}\right)\Gamma\left(\frac{1+q}{w}\right)}{\Gamma\left(p\right)}$$ Here $$\Gamma(s)$$ is the Gamma function. So with $$w=2$$, $$b=\frac{1+a}{1-a}$$, $$p=n$$, and $$q=2k$$, $$C(n;a)=\frac1{(1-a)^n}\sum_{k=0}^{n-1}{n-1\choose k}\left(\frac{1+a}{1-a}\right)^{\frac{2k+1}{2}-n}\frac{\Gamma\left(n-\frac{2k+1}{2}\right)\Gamma\left(\frac{2k+1}{2}\right)}{\Gamma\left(n\right)}$$ $$C(n;a)=\frac1{(1-a)^n}\sum_{k=0}^{n-1}\left(\frac{1+a}{1-a}\right)^{\frac{2k+1}{2}-n}\frac{\Gamma\left(n-\frac{2k+1}{2}\right)\Gamma\left(\frac{2k+1}{2}\right)}{k!\Gamma(n-k)}$$
By symmetry, we have $$\int_0^{2 \pi} \frac{d x}{(1-a \cos x)^2}=2 \int_0^\pi \frac{d x}{(1-a \cos x)^2}$$ Letting $$x\mapsto \pi-x$$ gives the other form of the integral $$\int_0^\pi \frac{d x}{1-a\cos x}= \int_0^\pi \frac{d x}{1+a\cos x}$$ Averaging them yields \begin{aligned} \int_0^\pi \frac{d x}{1-a \cos x}=&\frac{1}{2} \int_0^\pi\left(\frac{1}{1-a \cos x}+\frac{1}{1+a\cos x}\right) \\ = & \int_0^\pi \frac{1}{1-a^2 \cos ^2 x} d x \\ = & 2 \int_0^{\frac{\pi}{2}} \frac{\sec ^2 x}{\sec ^2 x-a^2} d x \\ = & 2 \int_0^{\infty} \frac{d t}{t^2+\left(1-a^2\right)}, \quad \textrm{ where }t=\tan x \\ = & \frac{2}{\sqrt{1-a^2}}\left[\tan ^{-1}\left(\frac{t}{\sqrt{1-a^2}}\right)\right]_0^{\infty} \end{aligned} $$\therefore \int_0^\pi \frac{d x}{1-a \cos x}= \frac{\pi}{\sqrt{1-a^2}} \tag*{(*)}$$ Differentiating both sides w.r.t. $$a$$ yields $$\int_0^\pi \frac{\cos x}{(1-a \cos x)^2} d x= \frac{\pi a}{\left(1-a^2\right)^{\frac{3}{2}}}\tag*{(**)}$$ Noticing that \begin{aligned} a \int_0^\pi \frac{\cos x}{(1-a \cos x)^2} d x & =\int_0^\pi \frac{1-(1-a \cos x)}{(1-a \cos x)^2} d x \\ & =\int_0^\pi \frac{d x}{(1-a\cos x)^2} d x-\int_0^\pi \frac{d x}{1-a \cos x} \end{aligned} Combining $$(*)$$ and $$(**)$$ gives $$\int_0^{\pi} \frac{d x}{(1-a \cos x)^2}=\frac{ \pi}{\left(1-a^2\right)^{\frac{3}{2}}}$$
Hence for any $$|a|<1,$$ $$\boxed{\int_0^{2 \pi} \frac{d x}{(1-a \cos x)^2}=\frac{2 \pi}{\left(1-a^2\right)^{\frac{3}{2}}}}$$
• Hope you don't mind, I added a line break to get the \boxed portion at the end to display properly :) Feb 4 at 7:37