<s>[INST] How to maximize a function when you cannot solve gradient = 0 I have to maximize this function : $$ f(x,y) = a\sqrt{x} + b\sqrt{y}$$
$$ a, b \in{R+*} $$
Knowing that $$ 0 ≤ x ≤ 2 − 2y $$ with $$ 0 ≤ y ≤ 1 $$
I said that f is a linear combination of 2 concave functions so it has a maximum (for 0<=x<=2-2y and 0<=y<=1). But because a,b are positive real numbers, I cannot solve $$ \frac{a}{2\sqrt{x}} = 0 $$
And it's the same for y.
How do I deal with such a situation. Thank you very much !!
 [/INST] By cauchy-schwarz-inequality, $$a\sqrt{x} + b\sqrt{y} = (\sqrt2a)(\sqrt{x}/\sqrt2) + b\sqrt{y} \le \sqrt{(2a^2+b^2)(x/2 + y)} \le \sqrt{2a^2+b^2}$$
due to the constraint $x \le 2 − 2y \iff (x+2y)/2 \le 1$, with equality holds iff $$\frac{\sqrt2a}{b} = \frac{\sqrt{x}/\sqrt2}{\sqrt{y}} \iff 2a \sqrt{y} = b \sqrt{x}$$
and $x + 2y = 2$.
\begin{align}
2a \sqrt{y} &= b \sqrt{2 - 2y} \\
2a^2 y &= b^2 (1 - y) \\
y &= \frac{b^2}{2a^2 + b^2} \in (0,1). \tag{$a,b \in \mathbb{R}_+^*$} \\
x &= 2(1-y) = \frac{4a^2}{2a^2 + b^2}
\end{align}
</s>