<s>[INST] Find the maximum value of $x^2y$ given constraints Find the maximum value of $${ x }^{ 2 }y$$ subject to the constraint $$x+y+\sqrt { 2{ x }^{ 2 }+2xy+3{ y }^{ 2 } } =k$$ where k is a constant.
I tried it by substituting value of x and then differentiating w.r.t $x$ but not able to proceed further.
 [/INST] Let $y=a x$ and from the constraint (assuming $x>0$
$$x=\frac{k}{\sqrt{3 a^2+2 a+2}+a+1}\qquad y=\frac{ak}{\sqrt{3 a^2+2 a+2}+a+1}$$
$$x^2y=\frac{a k^3}{\left(\sqrt{3 a^2+2 a+2}+a+1\right)^3}$$ Differentiate with respect to $a$ to get
$$-\frac{(2 a-1) \left(3 a+2+\sqrt{a (3 a+2)+2}\right) k^3}{\sqrt{a (3 a+2)+2}
   \left(a+\sqrt{a (3 a+2)+2}+1\right)^4}=0$$
So, either $a=\frac 12$ which would give
$$x^2 y=\frac{4 k^3}{\left(3+\sqrt{15}\right)^3}$$ or
$a=-\frac{1}{6} \left(5+\sqrt{13}\right)$ which would give
$$x^2y=\frac{1}{54} \left(35-13 \sqrt{13}\right) k^3$$
</s>