Proving the AM-GM inequality for 2 numbers $\sqrt{xy}\le\frac{x+y}2$

I am having trouble with this problem from my latest homework.

Prove the arithmetic-geometric mean inequality. That is, for two positive real numbers $x,y$, we have $$ \sqrt{xy}≤ \frac{x+y}{2} .$$ Furthermore, equality occurs if and only if $x = y$.

Any and all help would be appreciated.


Since $x$ and $y$ are positive, we can write them as $x=u^2$, $y=v^2$. Then

$$(u-v)^2 \geq 0 \Rightarrow u^2 + v^2 \geq 2uv$$

which is precisely it.


Note that $$\frac{x+y}{2}-\sqrt{xy}=\frac{(\sqrt{x}-\sqrt{y})^2}{2}.$$