Wednesday, August 26, 2009

Volume of a sphere: calculus

This derivation is straight from the book Strang's Calculus. We want to calculate the volume of a hemi-sphere as shown in the figure. The cross-sections of this solid are semi-circles. The area of each semicircle is:

 `A = 1/2 πr2 = 1/2 π(R2-x2)`

To find the volume, we add up (integrate) the areas of each little slice:

 ```V = ∫ A(x) dx = ∫ 1/2 π(R2-x2) dx = 1/2 π [ R2x - 1/3 x3 ]```

Evaluate the expression in brackets between x = -R and +R:

 ```= [R3 - 1/3 R3] - [-R3 + 1/3 R3] = 2/3 R3 - - 2/3 R3 = 4/3 R3 V = 1/2 π 4/3 R3 = 2/3 π R3```

The total volume is twice this, or

 `V = 4/3 π R3`

The volume can be found in either cylindrical or spherical coordinates. For spherical coordinates we have:

 ```x = r cosθ sinφ y = r sinθ sinφ z = r cosφ```

That is, φ is the angle of the vector r with the z-axis, so the z-component is r cosφ. The component orthogonal to that is the projection of r on the x,y-plane, and that is r sinφ. Then, θ is the angle of that projection (and r) with respect to the x-axis. The x- component is r sinφ cosθ (the order is not important), while the y-component is r sinφ sinθ.

In this case, the integral is a triple integral:

 ```2π π R V = ∫ ∫ ∫ r2 sinφ dr dφ dθ 0 0 0```

From reading Chapter 14 on multiple integrals in Strang, it seems that what we do here is to first integrate with respect to r, holding the angles constant:

 ```2π π V = 1/3 R3 ∫ ∫ sinφ dφ dθ 0 0```

UPDATE: A sharp-eyed reader caught a silly error in the part that follows, so it's been edited. I had set up the problem in the first half (see the figure at the beginning of the post) to use the hemisphere. But in the second part we have two angles, θ and φ, with different limits of integration.

Continuing with the standard approach in two dimensions, we let θ go from 0 to 2π. Now φ will go from 0 to π. Imagine rotating the great circle in the xy-plane around the x-axis: we need only to go from 0 to π. We could do the hemisphere by having φ go from 0 to π/2, but it would be a weird volume, with two wedges joined at the x-axis.

So, we have the integral of sinφ dφ, which is - cosφ, evaluated between φ = 0 and φ = π =>
 ```= -cos(pi) - -(cos(0)) = -(-1) + 1 = 2 2π V = 2/3 R3 ∫ dθ 0```

But this is just θ evaluated between θ = 0 and θ = 2π => 2π, so finally we have:

 `V = 4/3 R3 π`

(Figures are from the book)

UPDATE 2: Coming back a couple of years later, I notice Google has made changes to blogger (editing the html) that retroactively messed up the formatting on this post. The limits of integration aren't shown at the correct column offset any more. My apologies, but I don't see a simple fix at the moment.