Is there a more elegant way to solve this integral? I was considering proposing the integral 
$$
\int \left(\frac{1}{1-\varepsilon \cos{\theta}}\right)^{2} \, d\theta
$$
to an advanced high school physics class to show the derivation of Kepler's laws. As of now, my solution uses partial fraction decomposition and is not particularly simple. Is there a better way to evaluate this integral, even if it uses advanced math?
 A: Use the substitution $$(1-\epsilon \cos\theta) (1+\epsilon\cos\phi) =1-\epsilon^2$$ so that $$\sin\theta =\frac{\sqrt{1-\epsilon ^2}\sin\phi}{1+\epsilon \cos\phi}$$ and note that $$\frac{d\theta} {d\phi} =\frac{\sqrt{1-\epsilon^2}}{1+\epsilon\cos\phi}$$ and thus the integral reduces to $$(1-\epsilon ^2)^{-3/2}\int(1+\epsilon \cos\phi)\, d\phi$$ which is integrated easily. For back substitution note that $$\cos\phi=\frac{\cos\theta-\epsilon }{1-\epsilon \cos\theta}, \sin\phi=\frac{\sqrt{1-\epsilon ^2}\sin\theta} {1-\epsilon\cos\theta} $$ and thus the final answer is $$\frac{1}{(1-\epsilon ^2)^{3/2}}\arccos\left(\frac{\cos\theta-\epsilon}{1-\epsilon \cos\theta} \right)+\frac{\epsilon} {1-\epsilon ^2}\cdot\frac{\sin\theta}{1-\epsilon \cos\theta} +C$$
A: Assuming this is meant to be the integral over a full period, I worked out four versions of it in this AoPS thread (posts #6 and #8).
First, there was the elementary method, applying the Weierstrass substitution $t=\tan\frac{\theta}{2}$ and later another trig substitution to find an antiderivative. It's about ten lines of routine but messy calculus.
Second, complex analysis. We convert it to an integral of a rational function on the circle and apply the residue theorem using partial fractions. Fundamentally routine, but complicated algebraically; it takes even more space than the real version finding the antiderivative.
Third, Fourier series. We use the series expansion $\frac1{(1-t)^2}=1+2t+3t^2+\cdots$ to expand the integrand into a trigonometric series, convert to complex form and expand out each $\cos^n$ term. Then, extract the coefficient of $e^{0i\theta}$ as a series, which is the only one that contributes to the integral. We recognize this series as a case of a known power series, and there's the answer. It's the shortest of these methods, but it requires a lot of cleverness.
Fourth, there's the area of an ellipse. There's a lot of setup to start with, deriving the equation $r=\frac{D^2-f^2}{2D}\cdot\frac{1}{1-\epsilon\cos\theta}$ for an ellipse with focus at the origin in polar coordinates ($f$ is the focal length, $D$ is the major axis, $\sqrt{D^2-f^2}$ is the minor axis). But then, if you're going to do Kepler's laws, you need this setup anyway. Once that's done, we use the polar area formula $\frac12\int_a^b r^2\,d\theta$ and compare to the rectangular area formula for the ellipse:
\begin{align*}\frac12\int_0^{2\pi}\left(\frac{D^2-f^2}{2D}\cdot\frac{1}{1-\varepsilon\cos\theta}\right)^2\,d\theta &= \frac{\pi}{4}D\sqrt{D^2-f^2}\\
\frac{(D^2-f^2)^2}{8D^2} I(\varepsilon) &= \frac{\pi}{4}D\sqrt{D^2-f^2}\\
I(\varepsilon) &= \frac{\pi}{4} D\sqrt{D^2-f^2}\cdot\frac{8D^2}{(D^2-f^2)^2}\\
I(\varepsilon) &= 2\pi \frac{D^3}{(D^2-f^2)^{3/2}}\\
I(\varepsilon) &= 2\pi\frac{D^3}{\left(D^2(1-\varepsilon^2)\right)^{3/2}} = \frac{2\pi}{(1-\varepsilon^2)^{3/2}}\end{align*}
I followed this last one with my own derivation of Kepler's laws. It's definitely my choice for the purpose indicated in the question.
