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.

• 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? 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$$

which is precisely it.

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

I am surprised no one has given the following very straightforward algebraic argument: \begin{align} 0\leq(x-y)^2&\Longleftrightarrow 0\leq x^2-2xy+y^2\tag{expand}\\[0.5em] &\Longleftrightarrow 4xy\leq x^2+2xy+y^2\tag{add $4xy$ to both sides}\\[0.5em] &\Longleftrightarrow xy\leq\left(\frac{x+y}{2}\right)^2\tag{div. sides by 4 & factor}\\[0.5em] &\Longleftrightarrow \sqrt{xy}\leq\frac{x+y}{2}.\tag{since $x,y\in\mathbb{R}^+$} \end{align} In regards to equality, notice that $\sqrt{xy}\leq\frac{x+y}{2}\leftrightarrow 2\sqrt{xy}\leq x+y$, and it becomes clear that equality holds if and only if $x=y$. $\blacksquare$

• I have, in a duplicate of this question, see math.stackexchange.com/a/906130/11994. As I explain there, I write this proof up-side-down, to reduce surprises for the reader, by making it essentially a simplification proof. Jan 15 '18 at 5:25
• @MarnixKlooster You can do that, but it's often considered bad form (and oftentimes introduces logical errors). See this write up from a Stanford prof about proof writing--what you did was mistake #1. In my proof, I start with the common knowledge that the square of any real number is nonnegative from which I work out the rest of the argument. In fact in my argument above, the last $\iff$ should be a $\implies$. Oh well. Such is life. But just know you always want to work towards the conclusion and not the other way round, even to simplify Jan 15 '18 at 21:32
• I take the liberty to disagree here. :-) Presenting a proof to follow the intuition that led you to the proof, and thus removing unnecessary surprises ("rabbits") for the reader, makes a proof easier to read. See Dijkstra's EWD1300. What do you think of the readability and clarity of your proof presentation vs mine? Jan 18 '18 at 23:09
• By the way, this probably belongs elsewhere, perhaps in a new question on proof presentation. Perhaps I could quote your comment above in such a question, for concreteness? Jan 18 '18 at 23:10
• @MarnixKlooster I don't think we are necessarily "disagreeing" here. Your response to mine had to do with readability and clarity, something I said nothing about in my comment. My comment had to do with logical correctness and proof presentation. In that regard, it does not make logical sense to work from something you are trying to prove to something you already know. As that linked write up indicates, do whatever you want in the process of figuring something out, but final presentation should be polished...even if it's "pedagogically broken." Rudin is a great example of what I mean. [...] Jan 19 '18 at 2:00

$\phantom{Proof without words.........}$ $$0\le ({\sqrt x}-{\sqrt y})^{2}$$ $$0\le x-2{\sqrt {xy}}+y$$ $$2{\sqrt {xy}}\le x+y$$ $${\sqrt {xy}}\le {x+y\over2}$$