Maximising volume of a cylinder when surface area fixed I know how to start off this problem but get bogged down when it comes to differentiating at the end.
A right circular cylinder is of radius r cm. and height pr cm. The total surface area of the cylinder is $S cm^2$ and its volume is $V cm^3$.
Find an expression for V in terms of p and S. If the value of S is fixed, find the value of p for which V is a maximum.
I have said:
V = $\pi r^2pr = \pi r^3p$
$S = 2\pi r^2p + 2\pi r^2 = 2\pi r^2(p + 1)$  (I am assuming a closed cylinder)
$r = 2\pi r^2(1 + p)$
So $r = \sqrt(\frac{S}{2\pi (1 + p)})$
Substituting into the the formula for volume:
$V = \pi p(\frac{S}{2\pi (1 + p)})^{3/2}$
But when I try to differentiate this to find the maximum value I get confused. The book says the answer is 2.
My working out, as far as it goes is as follows:
$V = \pi p(\frac{S}{2\pi (1 + p)})^{3/2}$
$dV/dp = \pi p(\frac{3}{2\pi(1 + p)})^{1/2}.\frac{-S2\pi}{4\pi^2(1 + p)^2} + \pi(\frac{S}{2\pi(1 + p)})^{3/2}$
Which = 0 when:
$3\pi^2pS(\sqrt(\frac{S}{2\pi(1 + p)})) = \pi(\sqrt(\frac{S}{2\pi(1 + p)}))^3$
But after this I get confused.

The first term of your derivative is wrong.$$\begin{align*}&\frac{dV}{dp}=\frac d{dp}\left[\frac{S\sqrt S}{2\sqrt{2\pi}}\frac p{(1+p)^{3/2}}\right]=\frac{S\sqrt S}{2\sqrt{2\pi}}\left[\frac1{(1+p)^{3/2}}-\frac{3p/2}{(1+p)^{5/2}}\right]\\&\frac{dV}{dp}=\frac{S\sqrt S}{4\sqrt{2\pi}}\left[\frac{2-p}{(1+p)^{5/2}}\right]\end{align*}$$which is $0$ when $p=2$. Verify that the derivative is negative for $p>2$ and positive for $p<2$.
