# Evaluating Volume of a Sphere in Cartesian Framework

1. Mar 13, 2010

### billiards

I'm trying to sharpen up my maths before I go back to university to start my PhD and am working through Roel Snieder's excellent book 'A Guided Tour of Mathematical Methods for the Physical Sciences'.

The problem I am working on is how to evaluate the volume of a sphere in Cartesian co-ordinates.

I was never really that advanced in my mathematics, but always managed to pick up the bits I needed. I have made some progress on my own but have got stuck.

So far I have formulated the problem in terms of a volume integral:

$$\int^{R}_{-R}\int^{\sqrt{R^{2}-x^{2}}}_{-\sqrt{R^{2}-x^{2}}}\int^{\sqrt{R^{2}-x^{2}-y^{2}}}_{-\sqrt{R^{2}-x^{2}-y^{2}}}dzdydx$$

I have performed the integration as far as this:

$$\int^{R}_{-R}2\sqrt{R^{2}-x^{2}} sin^{-1}\sqrt{R^{2}-x^{2}}dx$$

Which may well be wrong, because I have had to do quite a bit of looking around and take leaps of faith to get even just that far!
But now I am completely stumped. I have reformulated this integral by trigonometric substitution to give this:

$$2R\int^{R}_{-R}cos^{2}\theta sin^{-1}(Rcos\theta) d\theta$$

Which looks a bit easier to solve, but I really need some help here, I am weak and cannot progress.

Thanks

2. Mar 13, 2010

### tiny-tim

Hi billiards!

I haven't completely checked your working, but the argumnet of a sin-1 must be dimensionless, so that'll be sin-1√(1 - x2/R2).

3. Mar 13, 2010

### billiards

Hi tiny-tim,

So you're saying my second equation is wrong?

I suspected it would be because the algebra got quite hairy. I'll go back and have a look.

Cheers

4. Mar 13, 2010

### phyzguy

Your original triple integral formulation looks correct to me, and when I evaluate this, I get
$$\frac{4 \pi R^3}{3}$$
, which is of course the right answer. So you must have done something wrong in the integration steps. the first integration of course just gives z, evaluated at the limits of:
$$\pm \sqrt{R^2-x^2-y^2}$$
$$2\int{\sqrt{R^2-x^2-y^2}dy}$$
This indefinite integral is done with a trigonometric substitution, and the result should be:
$$y \sqrt{R^2-x^2-y^2}+\left(R^2-x^2\right) \text{ArcTan}\left[\frac{y}{\sqrt{R^2-x^2-y^2}}\right\$$
When you evaluate this at the limits, the first term gives zero, and the second term, when evaluated properly using a limiting procedure, gives:
$$\pi \left(R^2-x^2\right)$$
Now you integrate this with respect to x, and you should get:
$$\pi \left[R^2x-\frac{x^3}{3}\right\$$
When evaluated at your limits of +/- R, this should give:
$$\frac{4 \pi R^3}{3}$$

Hope this helps.

5. Mar 13, 2010

### billiards

Thanks phyzguy!

I realised I slipped up pretty bad in the second integration!

So I get:

$$V=\int^{R}_{-R}\int^{\sqrt{R^{2}-x^{2}}}_ {-\sqrt{R^{2}-x^{2}}} 2\sqrt{R^{2}-x^{2}-y^{2}} dy dx$$

Which I am not currently strong enough to do -- hence my slipping up. Can you help me out with the trig substitution I need here?

Thanks

6. Mar 13, 2010

### phyzguy

7. Mar 16, 2010

### billiards

Right, I've been away from home but have been dipping in and out of this problem, but I've finally cracked it, so for posterity* here's what I got:

We start with this expression for the volume integral of the volume of a sphere in Cartesian co-ordinates.

$$V=\int^{R}_{-R}\int^{\sqrt{R^{2}-x^{2}}}_{-\sqrt{R^{2}-x^{2}}}\int^{\sqrt{R^{2}-x^{2}-y^{2}}}_{-\sqrt{R^{2}-x^{2}-y^{2}}}dzdydx$$

The first integration is very easy, it's just:

$$\int^{\sqrt{R^{2}-x^{2}-y^{2}}}_{-\sqrt{R^{2}-x^{2}-y^{2}}}dz = \left[z\right]^{\sqrt{R^{2}-x^{2}-y^{2}}}_{-\sqrt{R^{2}-x^{2}-y^{2}}}=2\sqrt{R^{2}-x^{2}-y^{2}}$$

Nothing fancy needed.

And you're left with:

$$V=\int^{R}_{-R}\int^{\sqrt{R^{2}-x^{2}}}_{-\sqrt{R^{2}-x^{2}}}2\sqrt{R^{2}-x^{2}-y^{2}}}dydx$$

The second integration got me a bit stuck because you need to use a trigonometric substitution and I'm not too familiar with those. But I figured it out in the end and it really wasn't too difficult.

$$\int^{\sqrt{R^{2}-x^{2}}}_{-\sqrt{R^{2}-x^{2}}}2\sqrt{R^{2}-x^{2}-y^{2}}}dy = 2(R^{2}-x^{2})\int^{\sqrt{R^{2}-x^{2}}}_{-\sqrt{R^{2}-x^{2}}}cos^{2}\theta d\theta = 2(R^{2}-x^{2})\left[\frac{\theta}{2}+\frac{sin2\theta}{2}\right] ^{\sqrt{R^{2}-x^{2}}}_{-\sqrt{R^{2}-x^{2}}}$$

But remember we did a trig substitution where
$$\theta = sin^{-1}(y/\sqrt{R^{2}-x^{2}})$$

Which when substituted back in and evaluated gives:
$$\pi(R^{2}-x^{2})$$

So now our volume expression is:

$$V=\pi\int^{R}_{-R}(R^{2}-x^{2})dx$$

Which is quite an easy one if you've followed it this far. Another trig substitution is helpful.

$$\pi\int^{R}_{-R}(R^{2}-x^{2})dx = \pi R^{3}\int^{R}_{-R}cos^{3}\theta d\theta$$

This turns out to be:

$$\pi R^{3}\int^{R}_{-R}cos^{3}\theta d\theta = \pi R^{3} \left[sin \theta - \frac{sin ^{3} \theta} {3} \right]^{R}_{-R}$$

Which when evaluated gives me the familiar expression:

$$V=\frac{4}{3}\pi R^{3}$$

I hope there's no mistakes in there!

*In trying to perform some of these integration I found it very helpful to dig up old threads here at PF, so I thought I would return the favour by documenting the route I found for this problem here.

(I think the main reason this took me so long was because I was determined not to cheat by using a programme to help me with any of the integrations, doing this by hand has really helped me to brush up my mathematics and get rid of years of rust, some things I've learned doing this were even completely new! It has also immensely satisfying, although seeing the ingenuity of real mathematicians I've come across in my background reading has also been incredibly humbling.)

8. Mar 16, 2010

### phyzguy

Looks good! Just a comment - no need for a trig substitution of the third integral, it is simply powers of x, so you should be able to integrate it directly. Remember:
$$\int{x^n dx} = \frac{x^{n+1}}{n+1}$$

9. Mar 16, 2010

### billiards

Oh Yeh

Thanks by the way phyzguy, you give sound advice