Maximum of $P=x^m y^n$ Let $m,n,s \in \mathbb N$. Let $x,y \in \mathbb R^+$ such that $x+y=s$.
Prove that the maximum of the product $$P=x^m y^n$$ is attained when $$x=\frac{ms}{m+n} \textrm{ and }y=\frac{ns}{m+n}.$$
Any help would be great.
 A: HINT:
Note that
$$
P(x)=x^m(s-x)^n.
$$
Can you find $P'(x)=0$ for what $x$?
A: We want to aximize $P(x,y) = x^my^n$ subject to the constraint that $g(x,y) = x+y-s = 0$. Using Lagrange multipliers, the solution would have to satisfy
$$mx^{m-1}y^n = \lambda$$
$$nx^my^{n-1} = \lambda$$
$$x+y=s$$
There are two obvious solutions: $(s,0)$ and $(0,s)$. $P=0$ at these points, so they're clearly not maxima. Now assume $x,y\neq 0$. Dividing the first equation by the second,
$$\frac{m}{n} \frac{y}{x} = 1 \implies$$
$$x = \frac{my}{n}$$
Then using the last equation, 
$$y + \frac{m}{n}y = s$$
$$y = \frac{s}{1+\frac{m}{n}} = \frac{ns}{n+m}$$
A: Since $x+y=s\implies y=s-x$. So the function $P$ is 
$P=x^m(s-x)^n$. For maximum, you must have $P^{'}(x)=0\implies ms=x(m+n)\implies x=\frac{ms}{m+n}$. $P^{''}(x)$ is negative at that point, hence the point is a maxima. From $x$ we see that $y=x-s$.
A: $P=x^my^n$
$\ln P=m\ln x+n\ln y$
Differentiating implicity w.r.t $x$,
$\dfrac1P\dfrac{\mathrm dP}{\mathrm dx} = \dfrac mx+\dfrac ny\dfrac{\mathrm dy}{\mathrm dx}$
$\therefore\ \dfrac{\mathrm dP}{\mathrm dx} = P\left(\dfrac mx-\dfrac ny\right)$ as $y=s-x$ $\implies$ $\dfrac{\mathrm dy}{\mathrm dx}=-1$
Thus $\dfrac{\mathrm dP}{\mathrm dx}=0$ $\implies$ $\dfrac mx=\dfrac ny$ as $P>0$.
$\dfrac{\mathrm d^2P}{\mathrm dx^2} = \dfrac{\mathrm dP}{\mathrm dx}\left(\dfrac mx-\dfrac ny\right)-P\left(\dfrac m{x^2}+\dfrac n{y^2}\right)$; when $\dfrac mx=\dfrac ny$, $\dfrac{\mathrm d^2P}{\mathrm dx^2} = -P\left(\dfrac m{x^2}+\dfrac n{y^2}\right)<0$.
Thus $P$ is maximized when $\dfrac mx=\dfrac ny$, i.e.
$nx = my = m(s-x)$ $\implies$ $x=\dfrac{ms}{m+n}$
and
$y = s-x = s-\dfrac{ms}{m+n} = \dfrac{ns}{m+n}$.
