Calculating the perimeter of an ellipse The hydraulic diameter is defined as $$D_h=\dfrac{4A}{P}$$ 
where $A$ is the area and $P$ is the perimeter.
The area of an ellipse is simply $\pi ab$.
The perimeter has many many different representations.... However doing some googling I found that the Hydraulic diameter is $$\dfrac{4ab(64-16e^2)}{(a+b)(64-e^4)}$$
Where $$e=(a-b)/(a+b)$$
And $a$ is the major axis and $b$ is the minor axis
How did they derive this? What is the procedure for calculating the perimeter of the ellipse?
 A: This is not an answer but a supplement to Claude Leibovici's answer about
complete elliptic integrals.
A few years ago ($2011$), a pretty efficient (and simple to implement) way to compute complete elliptic integral of second kind has been found${}^{\color{blue}{[1]}}$. Start from any two positive numbers $x,y$, 


*

*Construct two sequences $x_n, y_n$:
$$( x_{n}, y_{n} ) = 
\begin{cases}
\left( \frac{x_{n-1}+y_{n-1}}{2}, \sqrt{x_ny_n} \right), & n > 0\\
(x,y), & n = 0
\end{cases}$$
The two sequences $x_n, y_n$ will converge to a common limit, let us call it $\verb/AGM/(x,y)$.

*Construct three sequences $u_n, v_n, w_n$:
$$(u_n, v_n, w_n ) =
\begin{cases}
\left( 
\frac{u_{n-1}+v_{n-1}}{2}, w_{n-1} + \Delta_{n-1}, w_{n-1} - \Delta_{n-1} \right),& n > 0\\
(x,y,0),& n = 0
\end{cases}
$$
where $\Delta_k = \sqrt{(u_k-w_k)(v_k-w_k)}$.
The two sequences $u_n, v_n$ will also converge to a common limit, let us call it $\verb/MAGM/(x,y)$.
In terms of them, the complete elliptic integral of first and second kind has following simple representation${}^{\color{blue}{[2]}}$:
$$\begin{align}
K(\gamma) \stackrel{def}{=}
\int_0^1 \frac{dx}{\sqrt{(1-x^2)(1-\gamma^2x^2)}} &= \frac{\pi}{2\verb/AGM/(1,\beta)}\\
E(\gamma)  \stackrel{def}{=}
\int_0^1 \sqrt{\frac{1-\gamma^2 x^2}{1-x^2}}dx
&= \frac{\pi \verb/MAGM/(1,\beta^2)}{2\verb/AGM/(1,\beta)}
\end{align}
\quad\text{ where }\quad\beta = \sqrt{1-\gamma^2}$$
These formulas allow us to compute the values of $E(\gamma)$ and $K(\gamma)$
with exponential increase of accuracy per iteration. 
For example, consider the case $a = 10, b = 4$, with $\gamma = e = \sqrt{\frac{21}{25}} \iff \beta = \frac25$.
If one replace $\verb/AMG/(1,\beta)$ with $x_n$ and $\verb/MAGM/(1,\beta)$ by $u_n$ for $n = 1,\ldots, 6$ in above formula,
one obtain following approximations for perimeter $P = 4aE(e){}^{\color{blue}{[2]}}$:
$$
52.06067825948801,
46.21183561479164,
46.02628966588497,\\
46.02622519133314,
46.0262251913297,
46.0262251913297,
\ldots
$$
As one can see, we only need 5 iterations to converge to the desired value (for the accuracy shown).
Notes/References


*

*$\color{blue}{[1]}$ An Eloquent Formula for the Perimeter of an Ellipse by Semjon Adlaj.

*$\color{blue}{[2]}$ There are two conventions of the parameter passed to $E(\cdot)$ and $K(\cdot)$. The $E(e^2)$ in Claude Leibovici's answer is $E(e)$ here. I'm using a convention consistent with the one in paper above.
A: The formula for the perimeter of an ellipse is rather simple using the  arc length integrals just as Guido A. commented.
The result is $$P=4a\, E\left(1-\frac{b^2}{a^2}\right)=4a\, E\left(e^2\right)\tag 1$$ where appears the elliptic integral of the second kind. But this is rather difficult to evaluate. So, to overcome the difficulty and to avoid series expansions, approximations have been proposed using parameter $$h=\left(\frac{a-b}{a+b} \right)^2 $$ As far as I can remember, all the most common approximations are based on Padé approximants (ratios of two polynomials of differents degrees).
From my old notes, the simplest are $$P_{(1,1)}=\pi(a+b)\,\frac{16+3h}{16-h}\tag 2$$ 
$$P_{(1,2)}=\pi(a+b)\,\frac{64+16h}{64-h^2}\tag 3$$ $$P_{(2,1)}=\pi(a+b)\,\frac{64-3h^2}{64-16h}\tag 4$$ $$P_{(2,2)}=\pi(a+b)\,\frac{256-48h-21h^2}{256-112h+3h^2}\tag 5$$ but I am sure that many more have been proposed.
Just to check how good they are, let us consider $a=10$, $b=4$. The results are $$(1) \rightarrow 46.0262252$$ $$(2) \rightarrow 46.0253458$$ $$(3) \rightarrow 46.0261539$$ $$(4) \rightarrow 46.0261924$$ $$(5) \rightarrow 46.0262237$$
The formula you show is $(3)$.
Edit
Outside the Padé approximants, do not forget the beautiful $$P\approx a\pi  \left(3 (x+1)-\sqrt{(x+3) (3 x+1)}\right)\qquad (x=\frac ba)$$  gievn by the great Ramanujan. For $x >\frac 14$, the error is less than $0.01$%. Applied to the example, this would give $$P=2 \left(21-\sqrt{187}\right) \pi\approx 46.0256246$$
