Proving that inequality holds under condition. 
Let $a$ and $b$ be positive numbers. Prove that inequality $$\frac{ax+by}{2} \leqslant \sqrt{\frac{ax^2+by^2}{2}}$$
holds for all real $x$ and $y$ only and only if $a+b \leqslant2$

Problem needs to be done using "basic" algebraic methods.
I tried expanding this into form $$2ax^2+2by^2-a^2x^2-b^2y^2-2abxy \geqslant 0$$
and then take oustide parenthesis $2-a-b$. Inequalities between means did not help either.
Can you give me some clues?
 A: Suppose $\frac{ax+by}2 \le \sqrt{\frac{ax^2+by^2}{2}}$ is true, let $x=y=1$,
$$\frac{a+b}2\le \sqrt{\frac{a+b}2}$$
$$\frac{(a+b)^2}{4}\le \frac{a+b}2$$
Hence we must have $a+b \le 2$.

Suppose we have $a+b \le 2$, we want to investigate when does
$$(2a-a^2)x^2+(2b-b^2)y^2-2abxy \ge 0, \forall x, y$$
View it as a quadratic equation in $x$, since the coefficient $2a-a^2$ is positive, this is equivalent to the discriminant being non-positive.
$$4a^2b^2y^2 -4(2a-a^2)(2b-b^2)y^2 \le 0, \forall y$$
Equivalently,
$$ab - (2-a)(2-b) \le 0$$
$$-4+2a+2b \le 0$$
$$a+b \le 2$$
which is true as that is our assumption. That is $a+b \le 2 \implies \frac{ax+by}2 \le \sqrt{\frac{ax^2+by^2}{2}}$.

Conclusion: $a+b \le 2 \iff \frac{ax+by}2 \le \sqrt{\frac{ax^2+by^2}{2}}$.
A: Let $a+b\leq2$.
Thus, by C-S $$\sqrt{\frac{ax^2+by^2}{2}}=\sqrt{\frac{(a+b)(ax^2+by^2)}{2(a+b)}}\geq\frac{|ax+by|}{\sqrt{2(a+b)}}\geq\frac{|ax+by|}{2}\geq\frac{ax+by}{2}.$$
Let $a$ and $b$ are positives and  $$\sqrt{\frac{ax^2+by^2}{2}}\geq\frac{ax+by}{2}$$ is true for any reals $x$ and $y$.
Thus, for $x=y=1$ we obtain:
$$\sqrt{\frac{a+b}{2}}\geq\frac{a+b}{2},$$ which gives $$a+b\leq2.$$
A: The inequality is equivalent to :
$$\Big(\frac{ax+by}{2}\Big)^2 \leqslant \frac{ax^2+by^2}{2}$$
By Jensen's inequality and the convexity of $f(x)=x^2$ we get :
$$\frac{ax^2+by^2}{2}\geq \Big(\frac{a+b}{2}\Big)\Big(\frac{ax+by}{a+b}\Big)^2$$
Or :
$$\frac{ax^2+by^2}{2}\geq \Big(\frac{1}{2(a+b)}\Big)\Big(ax+by\Big)^2$$
But :$$a+b\leq 2$$
Or :
$$\frac{1}{a+b}\geq \frac{1}{2}$$
Now you can conclude I think .
