# Proving the AM-GM inequality for 2 numbers

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.

-
One way is the following. Let $\sqrt{x} = a$ and $\sqrt{y} = b$. Substitute for $x$ and $y$ in terms of $a$ and $b$. Collect all the terms together on the right side, and factor. Do you recognize a familiar inequality? –  Srivatsan Sep 15 '11 at 19:51

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$$
Note that $$\frac{x+y}{2}-\sqrt{xy}=\frac{(\sqrt{x}-\sqrt{y})^2}{2}.$$