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 !!
 A: With the help of some slack variables $s_k$ we transform the inequalities into equations and then with $f(x,y) = a\sqrt x+b\sqrt y$ forming the lagrangian
$$
L = f(x,y)+\lambda_1(x-s_1^2)+\lambda_2(y-s_2^2)+\lambda_3(x-2+2y+s_3^2)+\lambda_4(y-1+s_4^2)
$$
The lagrangian stationary points are the solutions for
$$
\nabla L = 0 = \left\{
\begin{array}{l}
 \frac{a}{2 \sqrt{x}}+\lambda_1+\lambda_3 \\
 \frac{b}{2 \sqrt{y}}+\lambda_2+2 \lambda_3+\lambda_4 \\
 x-s_1^2 \\
 y-s_2^2 \\
 s_3^2+x+2 y-2 \\
 s_4^2+y-1 \\
 -2 s_1 \lambda_1 \\
 -2 s_2 \lambda_2 \\
 2 s_3 \lambda_3 \\
 2 s_4 \lambda_4 \\
\end{array}
\right.
$$
giving the solution
$$
\left[
\begin{array}{ccccccc}
f(x,y)& x & y & s_1^2 & s_2^2 & s_3^2 & s_4^2\\
 \sqrt{2a^2+b^2} & \frac{4 a^2}{2 a^2+b^2} & \frac{b^2}{2 a^2+b^2} & \frac{4 a^2}{2 a^2+b^2} & \frac{b^2}{2
   a^2+b^2} & 0 & \frac{2 a^2}{2 a^2+b^2} \\
\end{array}
\right]
$$
NOTE
Null $s_k$'s indicates that the corresponding constraint is active.
A: 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}
