Proving that inequality holds under condition.

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}}$.


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.$$