@pleegwat said in Re: In other news today...:
I have known how to integrate in polar coordinates, but I couldn't tell you offhand how to do it anymore. But now that it's been brought up I will probably end up checking wikipedia for it some time today.
Generically, to change coordinates for integration, the main thing is calculating the volume element. Express each of the old coordinates in terms of the new, form the matrix of first partial derivatives, and take the absolute value of its determinant - this gives you the new volume* element.
In this case we'd look at cylindrical polar coordinates (r, θ, z) with the translation to (x, y, z) given by x = r cos θ, y = r sin θ (and z = z, obviously).
∂x/∂r = cos θ, ∂y/∂r = sin θ, ∂z/∂r = 0
∂x/∂θ = -r sin θ, ∂y/∂θ = r cos θ, ∂z/∂θ = 0
∂x/∂z = 0, ∂y/∂z = 0, ∂z/∂z = 1
Putting this into a matrix and taking the determinant gives r cos² θ + 0 + 0 - 0 + r sin² θ - 0 = r. So the new volume element is r dr dθ dz.
(Obviously, in normal use this and other well-known coordinate transformations would not be recalculated each time.)
For a right circular cone we have the region z in [0, h], θ in [0, 2π], and r in [0, Rz/h] where R is the base radius. So we get
∫(0 to h) ∫(0 to 2π) ∫(0 to Rz/h) r dr dθ dz
= (2π) ∫(0 to h) [r² / 2][0 to Rz/h] dz
= π (R/h)² [z³ / 3][0 to h]
= (π/3) R²h.
* Not specific to three dimensions, but naming things is hard, especially in arbitrary numbers of dimensions.