figure 1

From the diagram, we may derive the following equations:

\begin{equation} c = p + q \end{equation}

\begin{equation} c^2 = a^2 + b^2 \end{equation}

\begin{equation} h^2 = b^2 - p^2 \end{equation}

\begin{equation} h^2 = a^2 - q^2 \end{equation}

By adding the last two equations we have:

\begin{equation} 2 h^2 = a^2 + b^2 - p^2 - q^2 = c^2 - p^2 - q^2 \end{equation}

and using (1) we have:

\begin{equation} 2 h^2 = 2 pq \implies h = \sqrt{pq} \end{equation}

Corollary: the AM-GM inequality

Since the diagram corresponds to a circle with radius \(\frac{p+q}{2}\) and the altitude \(h\) is always less than or equal to the radius, we have:

\begin{equation} \sqrt{pq} \leq \frac{p+q}{2} \end{equation}

which is the AM-GM inequality for \(n=2\).