# Direct evaluation of complete elliptic integral

In comments to this question, @RobertIsrael asserted that, for $-1<x<1$, $$\int_0^{2\pi} \frac{1-x \cos(\phi)}{\left(1 - 2 x \cos(\phi) + x^2\right)^{3/2}} \mathrm{d} \phi = \frac{4}{1-x^2} \operatorname{E}(x^2) \tag{1}$$ where $E(m)$ is the complete elliptic integral of the second kind: $E(m) = \int_0^{\pi/2} \sqrt{1-m \sin^2(\theta)} \mathrm{d} \theta$.

It is easy to verify that the series expansion of the integrand, integrated term-wise, agrees with the series expansion of Robert's elegant answer.

I am very much interested if there is a way to directly establish $\text{eq. (1)}$ from the integral.

-
@J.M. Why do you think special-functions tag is more appropriate than the elliptic-functions one? – Sasha May 10 '12 at 16:29
Because elliptic integrals are not elliptic functions. Elliptic functions are doubly-periodic functions (e.g. Jacobi's and Weierstrass's functions), and the elliptic integrals aren't doubly periodic. The inverse of the incomplete elliptic integral of the first kind is however used as the basis of the Jacobi elliptic functions... – J. M. May 10 '12 at 16:35
In any event: I haven't tried it out yet, but it looks to me that either of the Landen or Gauss transformations are what will be needed to establish Robert's expression. (Not surprisingly, these are specializations of the quadratic transformations satisfied by the Gaussian hypergeometric function...) – J. M. May 10 '12 at 16:37
I don't know if this is of any help, but this is the force exerted by a charged circle of radius $x$ on a charge at distance $1$ from the centre. That suggests writing it as the derivative of the potential: \begin{align} \int_0^{2\pi} \frac{1-x \cos\phi}{\left(1 - 2 x \cos\phi + x^2\right)^{3/2}} \mathrm{d} \phi &= \left[\int_0^{2\pi} \frac{d-x \cos\phi}{\left(d^2 - 2 dx \cos\phi + x^2\right)^{3/2}} \mathrm{d} \phi\right]_{d=1} \\&= \left[-\frac{\partial}{\partial d}\int_0^{2\pi} \frac1{\left(d^2 - 2 dx \cos\phi + x^2\right)^{1/2}} \mathrm{d} \phi\right]_{d=1} \;. \end{align} – joriki May 10 '12 at 18:39

The first step towards the goal is to perform a rational transformation. As in the previous question, using the symmetry $\phi \to (2\pi - \phi)$ and the change of variables $t = \sin^2\left(\phi/2\right)$: $$\mathcal{I} = \int_0^{2 \pi} \frac{1-x \cos(\phi)}{\left(1-2 x \cos(\phi) + x^2\right)^{3/2}} \mathrm{d} \phi = \frac{2}{(1-x)^2} \int_0^1 \frac{1+\frac{ 2 x}{1-x} t}{1+\frac{4x}{(1-x)^2} t} \frac{\mathrm{d} t}{\sqrt{ t(1-t)\left( 1+\frac{4x}{(1-x)^2} t\right)}}$$ Now, perform a rational substitution: $$t = \frac{1-x}{2} \frac{y+1}{1- x y} \qquad \text{with} \qquad \mathrm{d} t = \frac{1-x^2}{( 1-x y)^2} \frac{\mathrm{d} y}{2}$$ which maps $0 <t<1$ into $-1<y<1$. With it: $$t (1-t) \left( 1+\frac{4x}{(1-x)^2} t\right) = \frac{(1+x)^2}{4 (1-x y)^4} (1-y^2) (1- x^2 y^2)$$ and $$\frac{1+\frac{ 2 x}{1-x} t}{1+\frac{4x}{(1-x)^2} t} = \frac{1-x}{1+ x y}$$ Combining, and using $1-x>0$ and $1-x y>0$: $$\mathcal{I} = \frac{2}{1-x} \int_{-1}^1 \frac{(1-x)^2}{(1+ x y)} \frac{\mathrm{d} y}{\sqrt{(1-y^2)(1-x^2 y^2)}} = 2(1-x) \int_{-1}^1 \frac{1}{1 + x y} \frac{\mathrm{d} y}{\sqrt{(1-y^2)(1-x^2 y^2)}}$$ The integral above is reduced to the rational form with substitution $y = \operatorname{sn}(u| x^2)$, where $\operatorname{sn}(u|m)$ stands for the Jacobi elliptic sine function. Indeed: $$(1-y^2)(1-x^2 y^2) = \left( 1- \operatorname{sn}^2(u|x^2)\right)\left( 1- x^2 \operatorname{sn}^2(u|x^2)\right) = \operatorname{cn}^2(u|x^2) \operatorname{dn}^2(u|x^2)$$ $$\mathrm{d} y = \operatorname{cn}(u|x^2) \operatorname{dn}(u|x^2) \mathrm{d} u$$ The substitution maps $-1<y<1$ into $-K(x^2) < u < K(x^2)$, where $K(x^2)$ is the complete elliptic integral of the first kind, and both $\operatorname{cn}(u|x^2) > 0$ and $\operatorname{dn}(u|x^2) > \sqrt{1-x^2} > 0$ on this interval: $$\mathcal{I} = \int_{-K(x^2)}^{K(x^2)} \frac{2(1-x) \mathrm{d u}}{1 + x \operatorname{sn}(u| x^2) } = \frac{2}{1-x^2} \left. \left(\operatorname{E}\left( \operatorname{am}(u|x^2), x^2\right) + x \frac{\operatorname{cn}(u|x^2) \operatorname{dn}(u|x^2) }{1+ x \operatorname{sn}(u|x^2)} \right) \right|_{-K(x^2)}^{K(x^2)}$$ Since $\operatorname{cn}\left( \pm K(x^2)| x^2\right) = 0$, and $\operatorname{am}(\pm K(x^2)| x^2) = \pm \frac{\pi}{2}$ we arrive at the desired result: $$\mathcal{I} = \frac{4}{1-x^2} \operatorname{E}(x^2)$$

-
Checking Byrd and Friedman, it seems that there's a more direct Jacobian substitution to resolve your integral, which I'm now trying to write out (see pages 176-177 if you have a copy). In the meantime, you might want to check your notation for the Jacobian elliptic functions; $\mathrm{sn}(u,k)$ and $\mathrm{sn}(u\mid m)$ are two different conventions, and it seems you've conflated one with the other. (The latter convention, which uses the parameter as the second argument, is the one Mathematica uses.) – J. M. May 11 '12 at 3:04
@J.M. Thanks for the reference, I should have a copy. I have changed the notation per your suggestion. – Sasha May 11 '12 at 3:26

\begin{align} \int_0^{2\pi} \frac{1-x \cos\phi}{\left(1 - 2 x \cos\phi + x^2\right)^{3/2}} \mathrm{d} \phi &= \left[\int_0^{2\pi} \frac{d-x \cos\phi}{\left(d^2 - 2 dx \cos\phi + x^2\right)^{3/2}} \mathrm{d} \phi\right]_{d=1} \\ &= \left[-\frac{\partial}{\partial d}\int_0^{2\pi} \frac1{\left(d^2 - 2 dx \cos\phi + x^2\right)^{1/2}} \mathrm{d} \phi\right]_{d=1} \\ &= \left[-\frac{\partial}{\partial d}\int_0^{2\pi} \frac1{\left((d-x)^2 +4dx\sin^2\dfrac\phi2\right)^{1/2}} \mathrm{d} \phi\right]_{d=1} \\ &= \left[-4\frac{\partial}{\partial d}\int_0^{\pi/2} \frac1{\left((d-x)^2 +4dx\sin^2\theta\right)^{1/2}} \mathrm{d} \theta\right]_{d=1} \\ &= \left[-4\frac{\partial}{\partial d}\frac{K\left(\dfrac{2\mathrm i\sqrt{dx}}{|d-x|}\right)}{|d-x|} \right]_{d=1} \;. \end{align}
I'm not sure whether this gets us any closer to the result, but you could try using the derivative and differential equation given at Wikipedia, noting that $k=\dfrac{2\mathrm i\sqrt{dx}}{|d-x|}$ leads to $\sqrt{1-k^2}=\dfrac{d+x}{|d-x|}$.
Mathworld has some more equations that might be useful, e.g. equation $(141)$ here or equation $(13)$ here‌​. – joriki May 10 '12 at 20:02
+1 This is nice, however, assuming $-1<x<1$ the expression I gave as an answer to the parent question is obtained, i.e. $\frac{2}{1+x} E\left(-\frac{4x}{(1-x)^2}\right) + \frac{2}{1-x} K\left(-\frac{4x}{(1-x)^2}\right)$, and yours is much nicer way to getting it. But your solution is not a direct way to get Robert's expression. I have posted a solution of mine, which derives Robert's nice formula directly from the integral. – Sasha May 10 '12 at 21:35