Find two numbers, $x,y$ whose sum is $35$ and $x^2y^5$ is maximum. 
Find two numbers, $x,y$ whose sum is $35$ and $x^2y^5$ is maximum.

My answer:
$$x+y=35$$
$x^2y^5$ is maximum
$$y=35-x$$
$$\frac{d}{dx} x^2(35-x)^5$$
Which rule to apply here after? I reached:
$$(35-x)^4(-5x^2+(35-x)2x)=0$$
Either $(35-4x)^4 =0$ or $x^2-7=0$

Another approach uses Lagrangian multipliers. Our Lagrangian is $L=2\ln x+5\ln y+\lambda (35-x-y)$ so $0=\partial_x L = \frac{2}{x}-\lambda,\,0=\partial_y L=\frac{5}{y}-\lambda$ and $x=10,\,y=25$. This maximises $x^2y^5$ because the matrix of second derivatives is diagonal, with negative eigenvalues $-\frac{2}{x^2},\,-\frac{5}{y^2}$.
