Prove $\int_0^{2\pi}\frac{3a\sin^2\theta}{(1-a\cos \theta)^4}$ or $\int_0^{2\pi}\frac{\cos\theta}{(1-a\cos\theta)^3}=\frac{3a\pi}{(1-a^2)^{5/2}}$ While doing some mathematical modelling of planetary orbits I have come up with two definite integrals $D_1$ and $D_2$ which appear to produce the same result R when tested with various values of $a$  ( where $0<a<1$).
$$
D_1
\, =\,
\int_0^{2\pi}f_1\,\mathrm{d}\theta
\, =\,
\int_0^{2\pi}\frac{3a\sin^2\theta}{(1-a\cos \theta)^4}\mathrm{d}\theta
\,=\,
\frac{3a\pi}{(1-a^2)^{5/2}}
\, =\,R
$$
and
$$D_2\, =\,\int_0^{2\pi}f_2\,\mathrm{d}\theta
\, =\,
\int_0^{2\pi}\frac{\cos \theta}{(1-a\cos \theta)^3}\,\mathrm{d}\theta
\, =\,
\frac{3a\pi}{(1-a^2)^{5/2}}
\, =\,R$$
The hypothesis: $D_1$ = $D_2$ has been proved in a separate question Prove $\int_0^{2\pi}\frac{3a\sin^2\theta}{(1-a\cos \theta)^4}\mathrm{d}\theta = \int_0^{2\pi}\frac{\cos \theta}{(1-a\cos \theta)^3}\,\mathrm{d}\theta$  .
The remaining hypotheses $D_1$ = $R$ and $D_2$ = $R$ have not been proved.  So the question is:-
Prove $D_1$ = $R$ or $D_2$ = $R$.
Only one proof is required because the other can then be obtained from $D_1$ = $D_2$.

For information
WolframAlpha computes expressions for the indefinite integrals $I_1,I_2$ as follows:-
$$I_1
\, =\,
\int\frac{3a\sin^2\theta}{(1-a\cos \theta)^4}\mathrm{d}\theta
\,=\,
$$
$$constant1 + \frac
{a\,\sqrt{a^2-1}\sin\theta\,[-(2a^3+a)\cos^2\theta+3(a^2+1)cos\theta+a(2a^2-5)]}
{2(a^2-1)^{5/2}(a\cos\theta-1)^3}
$$
$$-\frac
{6a\,(a\cos\theta-1)^3\,\tanh^-1
\left(
\frac{(a+1)\tan(\theta/2)}{\sqrt{a^2-1}}
\right)
}
{(2(a^2-1)^{5/2}\,(a\cos\theta-1)^3}
$$
and
$$I_2
\, =\,
\int\frac{\cos \theta}{(1-a\cos \theta)^3}\,\mathrm{d}\theta
\, =\,
$$
$$constant2 -
\frac
{2a^2\sin\theta-sin\theta}
{2(a^2-1)^2(a\cos\theta-1)}
-\frac
{\sin\theta}
{2(a^2-1)(a\cos\theta-1)^2}
$$
$$
-\frac
{3a\tanh^-1\left(\frac{(a+1)\tan(\theta/2)}{\sqrt{a^2-1}}\right)}
{(a^2-1)^{5/2}}
$$
Note that the final terms of each expression ( i.e. the terms involving $\tanh^{-1} $ and $\tan$ ) are equivalent to each other.
Also, note that
$$\int\frac{\cos\theta}{(1-a\cos\theta)^3}\,d\theta=
\frac{-\sin\theta}{(1-a\cos\theta)^3}
+\int \frac{3a\sin^2\theta}{(1-a\cos\theta)^4}\,d\theta.
$$

Written with StackEdit.

UPDATE 20141028
I have accepted TenaliRaman's answer. I don't yet understand all the steps but his helpful exposition gives me confidence that with time I can understand it because the methods cited (binomials, series) are ones I have learned (at high school).
The answer of M.Strochyk also appears to give a good proof. But the residue method is too advanced for me to understand at present.
UPDATE 20220713
I have now accepted Quanto's answer (because it is simple enough for me to understand).  I have also added an answer based on Quanto's but with the intermediate steps written out.
 A: According to Brian Bóruma's suggestion, integral can be evaluated using the residue theorem
$$\int\limits_0^{2\pi}\frac{\cos \theta}{(1-a\cos \theta)^3}\,{d\theta}=\dfrac{1}{2}\int\limits_{|z|=1}{\dfrac{z+\frac{1}{z}}{\left[1-\frac{a}{2}\left(z+\frac{1}{z}\right)\right]^3} \frac{dz}{iz}}=\\
=-4i\int\limits_{|z|=1}{\dfrac{z^3+z}{\left(-az^2+2z-a\right)^3}dz}= \\
=-4i\int\limits_{|z|=1}{\dfrac{z^3+z}{-a^3\left(z-z_1\right)^3 \left(z-z_2\right)^3}dz}=-\dfrac{8\pi}{a^3}{\operatorname{Res}\limits_{z=z_1}{\dfrac{z^3+z}{\left(z-z_1\right)^3 \left(z-z_2\right)^3}}},$$
where $z_1=\dfrac{1-\sqrt{1-a^2}}{a}, \;\; z_2=\dfrac{1+\sqrt{1-a^2}}{a}.$ Only the point $z_1$ lies in the unit disc and it is a third-order pole for the integrand function.
The residue can be calculated in a standard way:
$$ \operatorname{Res}\limits_{z=z_1}{\dfrac{z^3+z}{\left(z-z_1\right)^3 \left(z-z_2\right)^3}}=\\= \dfrac{1}{2!} \lim\limits_{z\to z_1}{\dfrac{d^2}{dz^2}\left(\dfrac{\left(z-z_1\right)^3 \left(z^3+z \right)}{\left(z-z_1\right)^3 \left(z-z_2\right)^3} \right)} 
=\dfrac{1}{2!} \lim\limits_{z\to z_1}{\dfrac{d^2}{dz^2}\left(\dfrac{z^3+z }{ \left(z-z_2\right)^3} \right)} = \\
=\left. \left[\frac{3 z}{{\left(z - \frac{1+\sqrt{1-a^{2}}} {a}\right)}^{3}} - \frac{3 {\left(3 z^{2} + 1\right)}}{{\left(z - \frac{1+\sqrt{1-a^{2}} }{a}\right)}^{4}} + \frac{6 {\left(z^{3} + z\right)}}{{\left(z - \frac{1+\sqrt{1-a^{2}}}{a}\right)}^{5}}\right] \right|_{z=z_1}. 
$$
A: Lemma 1: If $|x| < 1$, then we know that, $\frac{1}{1 - x} = \sum_{n = 0}^{\infty}x^n$. Using this, we can further show that, $\frac{1}{(1 - x)^3} = \sum_{n = 0}^{\infty}\frac{(n+1)(n+2)}{2}x^n$.
Proof: The first sum is just the GP. The second sum can be obtained by simply counting the different ways to get $x^n$ in $(\sum x^n)(\sum x^n)(\sum x^n)$.

Lemma 2: $$\int_{0}^{2\pi}\cos^{2k}\theta d\theta = {2k \choose k}\frac{2}{4^k}\pi$$
Proof: From Reduction Formula, we can see that,
$$\int_{0}^{2\pi}\cos^{2k}\theta d\theta = \frac{2k - 1}{2k}\int_{0}^{2\pi}\cos^{2k - 2}\theta d\theta$$
Continuing in this fashion, gives us the result.

Lemma 3: $$\int_{0}^{2\pi}\cos^{2k+1}\theta d\theta = 0$$
Proof: This result also follows from Reduction Formula.

Lemma 4: $$\frac{3}{(1 - x)^{5/2}} = \sum_{n = 0}^{\infty} (2n + 3)(2n+1){2n \choose n}\left(\frac{x}{4}\right)^n$$
Proof: We can show that, when $|x| < 1$,
$$\frac{1}{\sqrt{1 - x}} = \sum_{n = 0}^{\infty} {2n \choose n}\left(\frac{x}{4}\right)^n$$
Differentiating once, we obtain,
$$\frac{1}{(1 - x)^{3/2}} = \sum_{n = 1}^{\infty} n{2n \choose n}\left(\frac{x^{n - 1}}{4^n}\right) = \sum_{n = 0}^{\infty} (n + 1){2(n+1) \choose (n+1)}\left(\frac{x^{n}}{4^{n+1}}\right)$$
$$= \frac{1}{2}\sum_{n = 0}^{\infty} (2n + 1){2n \choose n}\left(\frac{x}{4}\right)^n$$
Differentiating again, we get,
$$\frac{3}{(1 - x)^{5/2}} = 2\sum_{n = 1}^{\infty} n(2n + 1){2n \choose n}\left(\frac{x^{n-1}}{4^{n}}\right) = \sum_{n = 0}^{\infty} (2n + 3)(2n+1){2n \choose n}\left(\frac{x}{4}\right)^n$$

Theorem: $$\int_{0}^{2\pi}\frac{\cos\theta}{(1 - a\cos\theta)^3}d\theta = \frac{3a\pi}{(1 - a^2)^{5/2}}$$
Proof: Given, $0 < a < 1$, therefore $|a \cos\theta| < 1$
 Hence, from Lemma 1, by replacing $x$ with $a\cos\theta$, we get
$$\frac{1}{(1 - a\cos\theta)^3} = \sum_{n = 0}^{\infty}\frac{(n+1)(n+2)}{2}a^n\cos^n\theta$$
This gives us,
$$\int_{0}^{2\pi}\frac{\cos\theta}{(1 - a\cos\theta)^3}d\theta = \int_{0}^{2\pi} \cos\theta\left(\sum_{n = 0}^{\infty}\frac{(n+1)(n+2)}{2}a^n\cos^n\theta\right)d\theta$$
$$=\sum_{n = 0}^{\infty}\frac{(n+1)(n+2)}{2}a^n\int_{0}^{2\pi}\cos^{n+1}\theta d\theta$$
Using Lemma 2 and 3 and setting $n = 2k + 1$, we get,
$$\sum_{n = 0}^{\infty}\frac{(n+1)(n+2)}{2}a^n\int_{0}^{2\pi}\cos^{n+1}\theta d\theta = \sum_{k = 0}^{\infty}\frac{(2k + 2)(2k + 3)}{2}a^{2k + 1} {2(k+1) \choose k+1}\frac{2}{4^{k+1}}\pi$$
$$=\frac{a\pi}{2}\sum_{k = 0}^{\infty}(k + 1)(2k + 3)a^{2k} {2(k+1) \choose k+1}\frac{1}{4^{k}}$$
$$= \frac{a\pi}{2}\sum_{k = 0}^{\infty}(2k+3)(2k+2)(2k+1)\frac{(2k)!}{k!(k+1)!}\left(\frac{a}{2}\right)^{2k}$$
$$= a\pi\sum_{k = 0}^{\infty}(2k+3)(2k+1)\frac{(2k)!}{k!k!}\left(\frac{a^2}{4}\right)^{k} = a\pi\sum_{k = 0}^{\infty}(2k+3)(2k+1){2k \choose k} \left(\frac{a^2}{4}\right)^{k}$$
Finally, we use Lemma 4 to obtain the result.
A: I try to tackle the second integral
$$
\int_{0}^{2\pi} \frac{\cos \theta}{(1-a \cos \theta)^{3}} d \theta
$$
by the result in my post
$$I_n(a)=\int_{0}^{\pi} \frac{d x}{(a-\cos x)^{n}}=\frac{(-1)^{n-1} \pi}{(n-1) !} \frac{d^{n-1}}{d a^{n-1}}\left(\frac{1}{\sqrt{a^{2}-1}}\right) $$
I start with the integral
$$
\int_{0}^{\pi} \frac{1}{(1-a \cos \theta)^{2}} d \theta =\frac{1}{a^{2}} \int_{0}^{\pi} \frac{1}{\left(\frac{1}{a}-\cos \theta\right)^{2}} d \theta=\frac{1}{a^{2}}\left(\frac{\pi\left(\frac{1}{a}\right)}{\left(\frac{1}{a^{2}}-1\right)^{\frac{3}{2}}}\right)
=\frac{\pi}{\left(1-a^{2}\right)^{\frac{3}{2}}}
$$
Differentiating both sides w.r.t. $a$ yields
$$
2 \int_{0}^{\pi} \frac{\cos \theta}{(1-a \cos \theta)^{3}} d \theta =\frac{3 \pi a}{\left(1-a^{2}\right)^{\frac{5}{2}}}
$$
By symmetry, we get
$$
\boxed{\int_{0}^{2 \pi} \frac{\cos \theta}{(1-a \cos \theta)^{3}} d \theta=2 \int_{0}^{\pi} \frac{\cos \theta}{(1-a \cos \theta)^{3}} d \theta= \frac{3 \pi a}{\left(1-a^{2}\right)^{\frac{5}{2}}}}
$$
A: With
$$
\int_{0}^{2\pi} \frac{1}{1-a \cos \theta} d \theta=\frac{2\pi}{\sqrt{1-a^2}}
$$
evaluate the following integrals successively
\begin{align}\int_{0}^{2\pi} \frac{1}{(1-a \cos \theta)^2} d\theta
=&\frac{d}{da} \int_{0}^{2\pi} \frac{a}{1-a \cos \theta} d \theta=\frac{2\pi}{(1-a^2)^{3/2}}\\
\int_{0}^{2\pi} \frac{\cos \theta}{(1-a \cos \theta)^3} d\theta
=&\frac{d}{da} \int_{0}^{2\pi} \frac{1}{2(1-a \cos \theta)^2 }d \theta=\frac{3a\pi}{(1-a^2)^{5/2}}\\
\int_0^{2\pi} \frac{3a\sin^2\theta}{(1-a\cos\theta)^4}\,d\theta 
=&\int_0^{2\pi} \sin\theta \ d\left(-\frac{1}{(1-a\cos \theta)^3}\right)\\
\overset{ibp}=&\int_0^{2\pi}\frac{\cos\theta}{(1-a\cos\theta)^3}d\theta=\frac{3a\pi}{(1-a^2)^{5/2}}\\
\end{align}
A: NOTE: This is a continuation (the easy bit!) of M.Strochyk's answer.
using $$z = \frac{1-\sqrt{1-a^{2}}} {a}
\mathrm{and}\,\mathrm{ defining}\, Q=\sqrt{1-a^2}$$
so that $$\left(
z - \frac{1+\sqrt{1-a^{2}}} {a}
\right) = \frac{-2Q}{a}$$
We can analyze the three terms of the Residue separately and merge them later
$$$$
TERM 1
$$
\frac
{3 z}{{\left(
z - \frac{1+Q} {a}
\right)}^{3}} 
= \frac
{3  \frac{1-Q} {a}}
{{\left(
\frac{-2Q}{a}
\right)}^{3}} 
= \frac
{3 a^2 \left(1-Q \right) (-2Q)^{2}}
{{(-2Q)}^{5}} 
$$TERM 2$$
- \frac{3 {\left(3 z^{2} + 1\right)}}{{\left(z - \frac{1+Q }{a}\right)}^{4}} 
=- \frac{3a^4 {\left(3 (\frac{1-Q}{a})^{2} + 1\right)  (-2Q) }}
 {{\left(-2Q\right)}^{5}} 
$$
TERM 3
$$
+ \frac{6 {\left((z)^{3} + z\right)}}{{\left(z - \frac{1+Q}{a}\right)}^{5}}
=+ \frac{6a^5 {\left((\frac{1-Q}{a})^{3} + (\frac{1-Q} {a})\right)}}
{{\left(-2Q\right)}^{5}}
$$
Summing together the three terms
$$
= \frac
{3 a^2 \left(4Q^2-4Q^3 \right) 
+6Qa^2 {\left( 3(1-2Q+Q^2)+a^2\right)  } 
+6a^2 {\left((1-Q)^3+a^2(1-Q) \right)}
}
{{(-2Q)}^{5}} 
$$
reducing to
$$
= \frac
{ \left(12a^2Q^2-12a^2Q^3 \right) 
+{\left( 18a^2Q-36a^2Q^2+18a^2Q^3+6a^4Q\right)  } 
+6a^2 {\left((1-3Q+3Q^2-Q^3)+a^2-Qa^2 \right)}
}
{{(-2Q)}^{5}} 
$$
and
$$
= \frac
{ \left(12a^2Q^2-12a^2Q^3 \right) 
+{\left( 18a^2Q-36a^2Q^2+18a^2Q^3+6a^4Q\right)  } 
+ \left(6a^2-18a^2Q+18a^2Q^2-6a^2Q^3+6a^4-6a^4Q \right)
}
{{(-2Q)}^{5}} 
$$
then
$$
= \frac
{
-6a^2Q^2
+ 6a^2+6a^4 
}
{{(-2Q)}^{5}} 
$$
So
$$
=\frac{6}{32} \frac
{(
a^2Q^2
- a^2-a^4 )
}
{Q^5}
$$
Multiplying by $-8\pi/a^3$ gives
$$
=-\frac{3\pi}{2a} \frac
{(
Q^2
- 1-a^2 )
}
{Q^5}
$$
but $Q^2$ = $1-a^2$ so
$$
=-\frac{3\pi}{2a} \frac
{(
-2a^2 )
}
{Q^5}
$$
giving
$$
= \frac
{3a\pi }
{(1-a^2)^{5/2}}
$$
which is the hypothesised result.
A: Here I have taken the compact answer by /u/Quanto (to whom all credit is due) and simply filled in some intermediate steps.  His trick was to (twice) differentiate inside the integral  ( a special case of the Leibniz integral rule ).
Using the known definite integral:- $\int_0^{2\pi}\frac{1}{E+F\cos x}\mathrm{d}x= \frac{2\pi}{\sqrt{E^2-F^2}}$  with $E=1$, $F=-a$ and $x=\theta$, we can write:-
$$
\int_{0}^{2\pi} \frac{1}{1-a \cos \theta} d \theta=\frac{2\pi}{\sqrt{1-a^2}}
$$
We can multiply both sides by $a$ (so long as $a$ is not a function of $\theta$) to give:-
$$
\int_{0}^{2\pi} \frac{a}{1-a \cos \theta} d \theta=\frac{2a\pi}{\sqrt{1-a^2}}
$$
now differentiate both sides (within the integral on the LHS) with respect to $a$:-
$$\int_{0}^{2\pi} \frac{1}{(1-a \cos \theta)^2} d\theta
=\frac{2\pi}{(1-a^2)^{3/2}}
$$
again, differentiate both sides (within the integral on the LHS) with respect to $a$:-
$$\int_{0}^{2\pi} \frac{2\cos \theta}{(1-a \cos \theta)^3} d\theta
=\frac{6a\pi}{(1-a^2)^{5/2}}
$$
Hence:-
$$\int_{0}^{2\pi} \frac{\cos \theta}{(1-a \cos \theta)^3} d\theta
=\frac{3a\pi}{(1-a^2)^{5/2}}.
$$
