A non-linear maximisation We know that $x+y=3$ where x and y are positive real numbers. How can one find the maximum value of $x^2y$? Is it $4,3\sqrt{2}, 9/4$ or $2$?

$x^2y=x^2(3-x)=3x^2-x^3$
So, $\frac{x^2y}{dx}=3(2x)-3(x^2)=3x(2-x)$
For the extreme values of $x^2y,\frac{x^2y}{dx}=0\implies x=0$ or $x=2$
Now, $\frac{d^2(x^2y)}{dx^2}=6-3(2x)=6(1-x)$
At $x=0,\frac{d^2(x^2y)}{dx^2}=6>0$ so $x^2y$ will have minimum value at $x=0$
At $x=2,\frac{d^2(x^2y)}{dx^2}=-6<0\implies x=2$ will make $x^2y$ the maximum
