<s>[INST] Let $0 < a \le b$. Then $a^2 \le \left (\frac{2ab}{a+b} \right) ^2 \le ab \le \left( \frac{a+b}{2} \right) ^2 \le b^2$ In a introductory text about real analysis, in a chapter about the axioms of order (I hope this is the correct translation), I was faced with the following
Problem: Let $0 < a \le b$. Show that $a^2 \le \left (\frac{2ab}{a+b} \right) ^2 \le ab \le \left( \frac{a+b}{2} \right) ^2 \le b^2$. If, at any point of this chain of inequalities, we have equality, then $a = b$.
There was no solution given. I came to the following
Solution: The first inequality follows from
$$ \begin{align} a^2 & \le ab\\
a^2 + ab & \le 2ab \\
a(a+b) & \le 2ab \\
a & \le \frac{2ab}{a+b} \\
a^2 & \le \left( \frac{2ab}{a+b} \right) ^2 \end{align}$$
By the same reasoning, if equality holds, $a^2=ab$ implies that $a=b$.
We get the second inequality from
$$ \begin{align} 0 & \le (a-b)^2\\
0 & \le a^2 - 2ab + b^2 \\
4ab & \le a^2 + 2ab + b^2 \\
\frac{4a^2b^2}{ab} & \le (a+b)^2 \\
\frac{4a^2b^2}{(a+b)^2} & \le ab \\
\left( \frac{2ab}{a+b} \right) ^2 & \le ab \end{align}$$
an similarly for the third inequality with
$$ \begin{align} 0 & \le (a-b)^2\\
0 & \le a^2 - 2ab + b^2 \\
4ab & \le a^2 + 2ab + b^2 \\
ab & \le \frac{(a+b)^2}{4} \\
ab & \le \left( \frac{(a+b)}{2} \right) \\ \end{align}$$
In both cases, $0 = (a-b)^2$ implies that $a=b$.
Finally we have
$$ \begin{align} a & \le b \\
a + b & \le 2b \\
\frac{a+b}{2} & \le b \\
\left( \frac{a+b}{2} \right) ^2 & \le b^2 \end{align}$$
and equality directly leads to $a=b$. $\blacksquare$
I have three questions to this:

*

*Is my solution correct?

*Do I have to take additional steps for the second part of the problem, that equality implies $a=b$?

*Are there shorter and more elegant solutions to this?

Thanks in advance!
 [/INST] It look quite correct for me, and the equality part is good since $a,b$ are both positive.
Just for showing a shorter (maybe) version for this by using two important but simple inequalies:
(1). $(a+b)^2 \geq 4ab$
And its variation in case of $a>0,b>0$ :
(2). $ 1 \geq \frac{4ab}{(a+b)^2}$
We have:
$$
b^2 \geq (\frac{a+b}{2})^2 \ \ (\text{because } b \geq a > 0) \\
= \frac{(a+b)^2}{4} \geq \frac{4ab}{4}=ab \ \ \ (\text{because (1) }) \\
= ab \times 1 \geq ab \times \frac{4ab}{(a+b)^2} = (\frac{2ab}{a+b})^2  \ \ \ (\text{because (2) }) \\
\geq (\frac{2ab}{b+b})^2 = a^2  \ \ \ (\text{because } b \geq a >0 )
$$
Actually, the first and the last inequalites use $a\geq b>0$, the second and third ones use HM-GM-AM-QM inequalities mentioned by @mrtechtroid.
</s>