# How can the AM-GM inequality be used in this case if the given variables are real numbers?

I was wondering - if we are given a question like this:

Prove that for any $$a, b \in ℝ$$ and $$ε > 0$$,
$$ab \leq \frac{a^2}{2ε}+\frac{εb^2}{2}$$.

Since $$a, b \in ℝ$$, how can we make use of $$\sqrt{ab} \leq \frac{a+b}{2}$$? Because as I understand, this inequality can not be used right away since $$a, b$$ can be negative numbers and this inequality only holds if $$a,b \ge 0$$.
I thought about using $$ab \leq (\frac{a+b}{2})^2$$, but if we let $$a = \frac{a^2}{2ε}$$ and $$b = \frac{εb^2}{2}$$, we will get $$\frac{a^2b^2}{4} \leq (\frac{\frac{a^2}{2ε}+\frac{εb^2}{2}}{2})^2$$ which isn't what we want to show. If we were allowed to square both sides, this $$\sqrt{ab} \leq \frac{a+b}{2}$$ inequality could be used, but as stated above $$a,b$$ might be negative so this step is illegal.

So, my question is: what can be done in this case?

If you set $$a' = \frac{a}{\sqrt{\epsilon}}$$ and $$b' = \sqrt{\epsilon}b$$, you get $$ab= a'b'$$.

Hence, it is equivalent with showing

$$ab = a'b' \leq \frac{a'^2 +b'^2}{2} \Leftrightarrow (a'-b')^2\geq 0$$

• I am just wondering - how did you know to let $a' = \frac{a}{\sqrt{\epsilon}}$ and $b' = \sqrt{\epsilon}b$? Were you able to recognize that by doing so, you could proceed like you did? Commented Jan 15, 2020 at 4:52
• @FlavioEsposito : The idea behind it is as follows: We know because of $(a'-b')^2\geq 0$, we have $a'^2+b'^2 \geq 2a'b'$. So, your inequality "suggests" to "bend" $a$ and $b$ in a way, such that we have $2$ squares. The only thing is to check whether $ab = a'b'$, which is obviously true by the way how $\epsilon$ is put into the given inequality. Commented Jan 15, 2020 at 5:02

We can establish $$\dfrac{x^2+y^2}2\ge xy$$ for all real $$x,y$$

Set $$x^2=a^2/\epsilon,y^2=\epsilon b^2$$

$$x^2y^2=a^2b^2\implies xy=\pm ab$$

• But wouldn't this only cover one case? When $a,b > 0$? Commented Jan 15, 2020 at 4:23
• @Flavio, updated the post Commented Jan 15, 2020 at 4:25
• I am not really sure why you picked $x^2=a^2/\epsilon$ and $y^2=\epsilon b^2$. Was it just based on your intuition? Commented Jan 15, 2020 at 4:43

So:

By AM-GM: $$\frac{a^2}{2ε}+\frac{εb^2}{2}\geq2\sqrt{ \frac{a^2}{2ε}\cdot\frac{εb^2}{2}}=|ab|\geq ab.$$

• @Rozenberg I am a little confused as to why this can be done? Will this inequality still hold if $a,b<0$? Commented Jan 15, 2020 at 4:42
• Doesn't $\sqrt{ab} \leq \frac{a+b}{2}$ only work if $a,b \ge 0$? Commented Jan 15, 2020 at 4:51