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$
 A: Note that if $y \leq 0 \Rightarrow x^2y^5 \leq 0, \forall x \in \mathbb{R}$, thus assume $y > 0$, and since the max won't change if $x$ is replaced by $-x$, we can also assume $x > 0$. Then we have a much simpler problem to solve.
We have: $35 = x+y = \dfrac{x}{2}+\dfrac{x}{2}+ \dfrac{y}{5}+\dfrac{y}{5}+\dfrac{y}{5}+\dfrac{y}{5}+\dfrac{y}{5} \geq 7\sqrt[7]{\dfrac{x^2y^5}{2^25^5}}\Rightarrow x^2y^5 \leq 2^25^{12}=\text{max}$. Equality occurs when $\dfrac{x}{2}=\dfrac{y}{5}\Rightarrow x = 10,y=25$. Thus we conclude that $x = 10,y = 25$ will do the job.
Note: This answer is not complete and I want to post it as a hint rather than a full answer since you have one part to do: solve the case $x$ is negative.
A: 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}$.
A: Hint: Apply the logarithm function before differentiating.
A: $$x+y=35$$
$$y=35-x$$
Then plug this into the function you want to maximize to create a single variable function.  So we want to maximize $$f(x)=x^2(35-x)^5.$$
To find all local extremes, we need to take the derivative, set it equal to $0$, and solve for $x$.  Using the product rule, we get
$$f'(x)=2x\cdot (35-x)^5+x^2\cdot 5(35-x)^4\cdot (-1)$$
Now set it equal to $0$ and we can factor out a $x(35-x)^4$:
$$0=2x\cdot (35-x)^5+x^2\cdot 5(35-x)^4\cdot (-1)$$
$$0=x(35-x)^4\Big[2(35-x)-5x\Big]$$
Now we have 3 different factors.  We can set each one equal to 0 and solve separately.
Factor 1:
$$x=0$$
Factor 2:
$$(35-x)^4=0$$
$$35-x=0$$
$$x=35$$
Factor 3:
$$2(35-x)-5x=0$$
$$70-2x-5x=0$$
$$70-7x=0$$
$$70=7x$$
$$x=10$$
Now we need to plug each of these local extrema back into $f(x)$ to see which is the absolute max.
$$f(0)=(0)^2(35-0)^5=0$$
$$f(35)=(35)^2(35-35)^5=0$$
$$f(10)=(10)^2(35-10)^5=976,562,500$$
Clearly $x=10$ gives the maximum.  Now we just need to figure out what $y$ is when $x=10$.
$$y=35-x$$
$$y=35-10$$
$$y=25$$
So, $x=10$ and $y=25$ are the numbers whose sum is 35 and maximize $x^2y^5$.
Here's a link to a site with a little more detail to explain a similar problem.  The function you derive in this other example is easier than the one we had to do here, but the concept is the same.
https://jakesmathlessons.com/derivatives/solution-find-two-numbers-whose-sum-is-23-and-whose-product-is-a-maximum/
