Let $$f(r)=\frac{1}{r}(\frac{4V}{\pi}+2V) + \pi r^2$$ $V$ stands volume and $r$ stands for radius
I need to find the extrema of the expression and find the $r$ at which the extrema occurs. So I used $$\frac{\frac{1}{r}(\frac{4V}{\pi})+\frac{1}{r}(2V) + \pi r^2}{3} \geq ({(4V)(2V) \pi})^{\frac{1}{3}}$$
However, my textbook applied the AM-GM inequality as
$$\frac{\frac{1}{r}(\frac{2V}{\pi}+V)+ \frac{1}{r}(\frac{2V}{\pi}+V) + \pi r^2}{3} \geq ((\frac{2V}{\pi}+V)^2\pi)^{\frac{1}{3}}$$.
Which method is the correct one? And how to find the the $r$ at which $f(r)$ is extremum ?