**Unlike for circles, there isn’t a simple exact closed formula for the perimeter of an ellipse. We compare several well-known approximations, and conclude that a formula discovered by Ramanujan is our favourite, due to its simplicity and extreme accuracy.**

An ellipse satisfies that equation:

$$ \frac{x^2}{a^2}+\frac{y^2}{b^2} =1 $$

For $a=b$, we have a circle, but if $a \neq b$ the result is like a circle that has been elongated in either the horizontal or vertical direction.

Now we know that the area of a circle is $A =\pi r^2$, and some of you might also know that the area of an ellipse with semi-minor and semi-major axes $a,b$ is simply given by $A = \pi a b$.

The fact that these two formulae are very similar is probably not surprising.

Therefore, one might reasonably expect that if the formula for the perimeter of a circle is $P = 2\pi r$, then there would be a similar, and relatively simple formula for the for ellipse.

**Surprisingly, and very unfortunately, this is not the case. There is no simple exact closed formula for the perimeter of an ellipse.**

Now it turns out that there **are** some expressions that give the result exactly, but they are typically in terms of advanced functions that are not studied until the later years of undergraduate mathematics. Specifically, the exact expression for the perimeter of an ellipse is can be written as :

$$ P_{\textrm{exact}}(a,b) \; =\quad 4 a \; E(1-\frac{b^2}{a^2}) \;=\quad 2\pi a \;\; _2F_1 \left( \frac{1}{2}, -\frac{1}{2}; 1;1-\frac{b^2}{a^2} \right) \;=\quad 2\pi \sqrt{ab} \; P_{1/2} \left( \frac{a^2+b^2}{2ab} \right)$$

where $E(\cdot)$ is the complete elliptic integral of the second kind; $_2F_1(\cdot)$ is the Gaussian hypergeometric function; and $P_{\nu}(z)$ is a Legendre Function.

Therefore through the use of specialist mathematical software, we can calculate the perimeter of an ellipse to arbitrary precision, and the compare this value to various simpler approximations.

The following expressions have been proposed over the centuries, with the last one discovered by Ramanujan.

\begin{array}{rl}

P_1(a,b) &= \pi (a+b) \nonumber \\

P_2(a,b) & = \pi \sqrt{2 (a^2+b^2)} \nonumber \\

P_3(a,b) &= \pi \sqrt{2(a^2+b^2)- (a-b)^2/2} \nonumber \\

P_4(a,b) I &= \pi \left( 3(a+b) – \sqrt{(3a+b)(a+3b)} \right) \nonumber \end{array}

Firstly, we note that for $a=b$, these all turn out to be exactly equivalent to $P=2 \pi a$, which is a good start. Therefore, these approximations only differ from the exact value as they become more elongated.

Then for the really elongated ones, such as when it is 8x wider than it is high, the errors for $P_1, P_2, P_3,P_4$ is around 20%, 10%, 3%, 0.3%, respectively. That is, the final expression $P_4$ is by far the most accurate and yet is still relatively simple.

This last equation is traditionally called Ramanujan’s first approximation.

There are several elegant formulae which are all far are more accurate than all of the above-mentioned formulae.

They are typically expressed in terms of the particular ratio, $h = \left( \frac{a-b}{a+b} \right) $ (and sometimes denoted $\lambda$).

Here is Ramanujan’s (more famous) second approximation

$$ P = \pi (a+b) \left( 1+ \frac{3h}{10+\sqrt{4-3h}} \right) $$

However, an even more accurate one derived from Pade approximations (Bronshetein, 1964)

$$ P = \pi (a+b) \frac{64-3h^2}{64-16h} $$.

And an even more accurate one (Jakobsen, 1985)

$$P = \frac{256-48h^2-21h^4}{256-112h^2+3h^4} $$

And finally the one that is used by many computer programs is [Rackauckas]

$$ P= \pi (a+b) \frac{135168-85760h-5568h^2+3687h^3}{135168-119552h+22208h^2-345h^3} $$

***

My name is Martin Roberts. I have a PhD in theoretical physics. I love maths and computing. I’m open to new opportunities – consulting, contract or full-time – so let’s have a chat on how we can work together!Come follow me on Twitter: @Techsparx!

My other contact details can be foundhere.