# π(PI) and the AGM: Legendre's Identity

While studying elliptic integrals (refer to previous post for an introduction to elliptic integrals) Legendre discovered a remarkable identity connecting the elliptic integrals of the first and second kinds. This identity at the same time connects these integrals to the mathematical constant $\pi$. This relation to $\pi$ was exploited by Gauss to derive a formula for $\pi$ based on AGM (which is the main topic of this series of posts).

### Legendre's Identity

Let $k$ and $k^{\prime}$ be such that
$$k^{2} + k^{\prime 2} = 1$$ then the following relation holds
$$K(k)E(k^{\prime}) + K(k^{\prime})E(k) - K(k)K(k^{\prime}) = \frac{\pi}{2}$$

#### Proof

Legendre demonstrated the L.H.S. of the identity to be a constant by showing its derivative with respect to $k$ to be zero identically. Almost all the usual proofs use this idea and the difference between these proofs lies in calculating the derivative (which is quite cumbersome if done directly and is not easily shown to be equal to zero identically) using some trick. We present a proof here by Bruce C. Berndt.

Berndt does not use differentiation with respect to $k$, but rather the parameters $m = k^{2}$ and $m^{\prime} = 1 - m$. To simplify writing lets just use $K, E, K^{\prime}, E^{\prime}$ for $K(k), E(k), K(k^{\prime}), E(k^{\prime})$ respectively. Then we have \begin{align}\frac{d}{dm}(E - K) &= -\frac{d}{dm}\int_{0}^{\pi / 2}\frac{m\sin^{2}\theta}{\sqrt{1 - m\sin^{2}\theta}}\,d\theta\notag\\ &= \int_{0}^{\pi / 2}\left(\frac{m\sin^{4}\theta - 2\sin^{2}\theta}{2(1 - m\sin^{2}\theta)^{3 / 2}}\right)d\theta\notag\\ &= \int_{0}^{\pi / 2}\left(\frac{(1 + m^{2}\sin^{4}\theta - 2m\sin^{2}\theta) - 1}{2m(1 - m\sin^{2}\theta)^{3 / 2}}\right)d\theta\notag\\ &= \int_{0}^{\pi / 2}\left(\frac{(1 - m\sin^{2}\theta)^{2} - 1}{2m(1 - m\sin^{2}\theta)^{3 / 2}}\right)d\theta\notag\\ &= \frac{1}{2m}\int_{0}^{\pi / 2}\sqrt{1 - m\sin^{2}\theta}\,d\theta - \frac{1}{2m}\int_{0}^{\pi / 2}\frac{d\theta}{(1 - m\sin^{2}\theta)^{3 / 2}}\notag\\ &= \frac{E}{2m} - \frac{1}{2m}\int_{0}^{\pi / 2}\frac{d\theta}{(1 - m\sin^{2}\theta)^{3 / 2}}\notag\end{align}
Now Berndt uses the fact that $$\frac{d}{d\theta}\left(\frac{\sin\theta\cos\theta}{\sqrt{1 - m\sin^{2}\theta}}\right) = \frac{1}{m}\sqrt{1 - m\sin^{2}\theta} - \frac{m^{\prime}}{m}\frac{1}{(1 - m\sin^{2}\theta)^{3 / 2}}$$ to get \begin{align}\frac{d}{dm}(E - K) &= \frac{E}{2m} - \frac{E}{2mm^{\prime}} + \frac{1}{2m^{\prime}}\int_{0}^{\pi / 2}\frac{d}{d\theta}\left(\frac{\sin\theta\cos\theta}{\sqrt{1 - m\sin^{2}\theta}}\right)d\theta\notag\\ &= \frac{E}{2m}\left(1 - \frac{1}{m^{\prime}}\right) = - \frac{E}{2m^{\prime}}\notag\end{align} Replacing $m$ by $m^{\prime}$ (and vice versa) we get $$\frac{d}{dm^{\prime}}(E^{\prime} - K^{\prime}) = - \frac{E^{\prime}}{2m}$$ and noting that $$\frac{d}{dm^{\prime}} = - \frac{d}{dm}$$ we get $$\frac{d}{dm}(E^{\prime} - K^{\prime}) = \frac{E^{\prime}}{2m}$$ Also we have \begin{align}\frac{dE}{dm} &= \int_{0}^{\pi / 2}\left(\frac{d}{dm}\sqrt{1 - m\sin^{2}\theta}\right)d\theta\notag\\ &= \int_{0}^{\pi / 2}\frac{-\sin^{2}\theta}{2\sqrt{1 - m\sin^{2}\theta}}\,d\theta\notag\\ &= \int_{0}^{\pi / 2}\frac{(1 - m\sin^{2}\theta) - 1}{2m\sqrt{1 - m\sin^{2}\theta}}\,d\theta\notag\\ &= \frac{1}{2m}\int_{0}^{\pi / 2}\sqrt{1 - m\sin^{2}\theta}\,d\theta - \frac{1}{2m}\int_{0}^{\pi / 2}\frac{d\theta}{\sqrt{1 - m\sin^{2}\theta}}\notag\\ &= \frac{E - K}{2m}\notag\end{align} and therefore (by replacing $m$ by $m^{\prime}$) $$\frac{dE^{\prime}}{dm} = -\frac{E^{\prime} - K^{\prime}}{2m^{\prime}}$$ The L.H.S. of the Legendre's identity can be written as $$L = KE^{\prime} + K^{\prime}E - KK^{\prime} = EE^{\prime} - (E - K)(E^{\prime} - K^{\prime})$$ and therefore its derivative $dL / dm$ given by $$\frac{(E - K)E^{\prime}}{2m} - \frac{E(E^{\prime} - K^{\prime})}{2m^{\prime}} + \frac{E(E^{\prime} - K^{\prime})}{2m^{\prime}} - \frac{(E - K)E^{\prime}}{2m} = 0$$ This establishes the fact that $L$ is a constant independent of $m$ (or equivalently $k$). To find the constant value of $L$ we evaluate its limit as $m \rightarrow 0$. To do so we write $L$ as
$$L = (E - K)K^{\prime} + E^{\prime}K$$ As $m \rightarrow 0$ we have $$E - K = - m \int_{0}^{\pi / 2}\frac{\sin^{2}\theta}{\sqrt{1 - m\sin^{2}\theta}}\,d\theta = O(m)$$ and $$K^{\prime} = \int_{0}^{\pi / 2}\frac{d\theta}{\sqrt{1 - m^{\prime}\sin^{2}\theta}} \leq \int_{0}^{\pi / 2}\frac{d\theta}{\sqrt{1 - m^{\prime}}}$$ so that $$K^{\prime} = O(m^{-1 / 2})$$ which finally leads to $$(E - K)K^{\prime} = O(m^{1 / 2})$$ Thus \begin{align}\lim_{m \rightarrow 0} L &= \lim_{m \rightarrow 0} \{(E - K)K^{\prime} + E^{\prime}K\}\notag\\ &= \lim_{m \rightarrow 0} \left\{ O(m^{1 / 2}) + 1\cdot \frac{\pi}{2}\right\} = \frac{\pi}{2}\notag\end{align} This establishes the Legendre's identity $$L = KE^{\prime} + K^{\prime}E - KK^{\prime} = \frac{\pi}{2}$$
Print/PDF Version

#### Post a Comment

1. Hi,
I've having trouble transforming the derivative with sin * cos on top to the form you show. Can you help ? Thanks, --gjk

2. @Glenn Keller

We have the equation $$\frac{d}{d\theta}\left(\frac{\sin\theta\cos\theta}{\sqrt{1 - m\sin^{2}\theta}}\right) = \frac{1}{m}\sqrt{1 - m\sin^{2}\theta} - \frac{m^{\prime}}{m}\frac{1}{(1 - m\sin^{2}\theta)^{3 / 2}}$$ and integrating this we get $$\frac{\sin\theta\cos\theta}{\sqrt{1 - m\sin^{2}\theta}} = \frac{1}{m}\int\sqrt{1 - m\sin^{2}\theta}\,d\theta - \frac{m^{\prime}}{m}\int\frac{d\theta}{(1 - m\sin^{2}\theta)^{3 / 2}}$$ Using limits $0, \pi/2$ in the above integration we get the LHS as $0$ (because of $\sin\theta\cos\theta$) and thus we get $$\frac{m^{\prime}}{m}\int_{0}^{\pi/2}\frac{d\theta}{(1 - m\sin^{2}\theta)^{3 / 2}} = \frac{1}{m}\int_{0}^{\pi/2}\sqrt{1 - m\sin^{2}\theta}\,d\theta = \frac{E}{m}$$ This integral is then used in calculation of $\dfrac{d}{dm}(E - K)$. I hope this helps.

Regards,
Paramanand

3. Sorry, Paramanand, I didn't explain my problem correctly. I apologize for wasting your time. I had trouble deriving the initial derivative, the one you label with "we have the equation". After making the same mistake 5 times, I eventually I found my problem by working backwards from the end.

After that, the rest of the page went pretty smoothly.

On another topic, do you have the syntax of whatever it is I have to type to make the equations come out nicely instead of plain text ?

Thanks for your time, --gjk

4. @Glenn Keller,
Glad that you found the problem and fixed it yourself. BTW in case you want the mathematical equations to appear properly in the comments you need to learn a little bit of Latex. There are many online tutorials for the same. Also this blog uses MathJax software to handle Latex. For that you need to write all the mathematical latex code between two dollar symbols. For example if you write $\$$\dfrac{1}{2}\$$ then it will be seen as$\dfrac{1}{2}$and if you write$\$$\int_{0}^{1}f(x)\,dx\$$ then it will be seen as $\int_{0}^{1}f(x)\,dx$

Regards,
Paramanand

5. @Glenn Keller,
You can learn some latex by the equations already given in my post. Just do a right click any of the equations here and you will get a MathJax menu. Then in this menu use the "Show Math As -> Tex Commands" option and it will give you the Latex code for that equation (without the dollar symbols, you need to add those at beginning and end yourself because those are part of the syntax to start Latex processing by MathJax). You can get more information by visiting MathJax web page (www.mathjax.org)

Regards,
Paramanand

6. Ok, thanks for the hints. I'll try it on next question on following page.