How can I find the volume of a cone using integration? I'm not given any numbers, just $h$ and $r$. I have to prove this volume to eventually find a centroid. Using the $xy$ plane as the base, extending upwards into the $z$ plane, the cone has a height $h$ and radius $r$.
I know that I will integrate a value of $z$ from $0$ to $h$. So I know that it will be $\int\pi r^2 dz$. I keep getting stuck on how to find $r$ in terms of $z$. I know I will use similar triangles, but when I'm not given any numbers at all, how do I compare them? How do I get $r$ in terms of $z$?
Sorry, I'm not sure how to use any code on here yet. A noooooooob.
 A: I cannot draw a reasonable picture, so some visualization and drawing is left to you. 
Assume that the cone is "upside down," that is, point down, with point  at $(0,0,0)$. 
Take a horizontal slice through the cone, at height $z$. The cross-section of the cone at height $z$ has a certain radius, which we can call $r(z)$. Then the volume of the cone is
$$\int_0^h \pi(r(z))^2\,dz.$$
As you saw, we want to find a formula for $r(z)$.
Take a vertical slice through the apex of the cone.  The cross-section is an isosceles  triangle, of height $h$, with the top length equal to $2r$. If we look at the part of the triangle that goes up to height $z$, that part has top length equal to $2r(z)$.  The small triangle is similar to the full triangle, and therefore 
$$\frac{2r(z)}{2r}=\frac{z}{h}.$$
We conclude that $r(z)=\dfrac{rz}{h}$.
Our volume is therefore
$$\int_0^h \pi \frac{r^2}{h^2}z^2\,dz.$$
Remark: If you do not want to think of the cone as being point down, let $r(z)$ be the radius at distance $z$ from the bottom, that is, at distance $h-z$ from the top. Basically the same argument as the one above shows that 
$$\frac{2r(z)}{r}=\frac{h-z}{h},$$
and therefore our volume is
$$\int_0^h \pi \frac{r^2}{h^2}(h-z)^2\,dz.$$
The integral is just a little bit harder, not much, if we make the substitution $u=h-z$. 
