# Perimeter of an ellipse

Unlike most other elementary shapes, such as the circle and square, there is no algebraic equation to determine the perimeter of an ellipse. Throughout history, a large number of equations for approximations and estimates have been made for the perimeter of an ellipse.

## Mathematical background
### Elliptic integral

An ellipse is defined by two axes: the major axis (the longest diameter) of length $2a$ and the minor axis (the shortest diameter) of length $2b$, where the quantities $a$ and $b$ are the lengths of the semi-major and semi-minor axes respectively. The exact perimeter $P$ of an ellipse is given by the integral:
$P=4a\int _{0}^{\frac {\pi }{2}}{\sqrt {1-e^{2}sin^{2}\theta }}\ d\theta$
where $e$ is the eccentricity of the ellipse, defined as
$e={\sqrt {1-{\frac {b^{2}}{a^{2}}}}}$
If we define the function
$E(x)=\int _{0}^{\frac {\pi }{2}}{\sqrt {1-x\sin ^{2}\theta }}\ d\theta$
known as the complete elliptic integral of the second kind, the perimeter can be expressed in terms of that function as simply
$P=4aE(e^{2})$.
The integral used to find the perimeter does not have a closed-form solution in terms of elementary functions.

### Infinite sums

Another solution for the perimeter, this time using the sum of a infinite series, is:
$P=2a\pi \left(1-\sum _{n=1}^{\infty }{\frac {(2n!)^{2}}{(2^{n}\cdot n!)^{4}}}\cdot {\frac {e^{2n}}{2n-1}}\right)$
where $e$ is the eccentricity of the ellipse.
More rapid convergence may be obtained by expanding in terms of $h=(a-b)^{2}/(a+b)^{2}.$ Found by James Ivory, Bessel and Kummer, there are several equivalent ways to write it. The most concise is in terms of the binomial coefficient with $n=1/2$, but it may also be written in terns of the double factorial or integer binomial coefficients: ${\begin{aligned}{\frac {P}{\pi (a+b)}}&=\sum _{n=0}^{\infty }{{\frac {1}{2}} \choose n}^{2}h^{n}\\&=\sum _{n=0}^{\infty }\left({\frac {(2n-3)!!}{(2n)!!}}\right)^{2}h^{n}\\&=\sum _{n=0}^{\infty }\left({\frac {(2n-3)!!}{2^{n}n!}}\right)^{2}h^{n}\\&=\sum _{n=0}^{\infty }\left({\frac {1}{(2n-1)4^{n}}}{\binom {2n}{n}}\right)^{2}h^{n}\\&=1+{\frac {h}{4}}+{\frac {h^{2}}{64}}+{\frac {h^{3}}{256}}+{\frac {25\,h^{4}}{16384}}+{\frac {49\,h^{5}}{65536}}+{\frac {441\,h^{6}}{2^{20}}}+{\frac {1089\,h^{7}}{2^{22}}}+\cdots .\end{aligned}}$ The coefficients are slightly smaller (by a factor of $2n-1$) than the preceding, but also $e^{4}/16\leq h\leq e^{4}$ is numerically much smaller than $e^{2}$ except at $h=e=0$ and $h=e=1$. For eccentricities less than 0.5 ($h<0.005$), the error is at the limits of double-precision floating-point after the $h^{4}$ term.

## Approximations

Because the exact computation involves elliptic integrals, several approximations have been developed over time.

### Ramanujan's approximations

Indian mathematician Srinivasa Ramanujan proposed multiple approximations:
First approximation:
$P\approx \pi \left(3(a+b)-{\sqrt {(3a+b)(a+3b)}}\right)$
Second approximation:
$P\approx \pi (a+b)\left(1+{\frac {3h}{10+{\sqrt {4-3h}}}}\right)$
where $h={\frac {(a-b)^{2}}{(a+b)^{2}}}$
Final approximation:
The final approximation in Ramanujan's notes on the perimeter of the ellipse is regarded as one of his most mysterious equations. It is
$P=\pi \left((a+b)+{\frac {3(a-b)^{2}}{10(a+b)+{\sqrt {a^{2}+14ab+b^{2}}}}}+\varepsilon \right)$
where
$\varepsilon \approx {\dfrac {3ae^{20}}{68719476736}}$
and $e$ is the eccentricity of the ellipse.
Ramanujan did not provide any rationale for this formula.

### Simple arithmetic-geometric mean approximation

$P\approx 2\pi {\sqrt {\frac {a^{2}+b^{2}}{2}}}$
This formula is simpler than most perimeter formulas but less accurate for highly eccentric ellipses.

### Approximations made from programs

In more recent years, computer programs have been used to find and calculate more precise approximations of the perimeter of an ellipse. In an online video about the perimeter of an ellipse, recreational mathematician and YouTuber Matt Parker, using a computer program, calculated numerous approximations for the perimeter of an ellipse. Approximations Parker found include:
$P\approx \pi \left({\frac {6a}{5}}+{\frac {3b}{4}}\right)$
$P\approx \pi \left({\frac {53a}{3}}+{\frac {717b}{35}}-{\sqrt {269a^{2}+667ab+371b^{2}}}\right)$