# Triple integration with spheres

#### kamykazee

Hello, i am having a problem at understanding the substitution method for a triple integration

Say, i have a triple integral (x^2+y^2+z^2)dxdydz, on a volume V: x^2+y^2+z^2<=a^2

I know the volume refers to the inside of a sphere, with a radius of a, however what i do not understand is why, in order to solve the integration, the following substitutions are made

x= r*cos(t)*cos(f)
y= r*sin(t)*sin(f)
z= r*sin(f)

with r belonging to [0,a]
t belonging to [0,2pi]
f belonging to [-pi/2, pi/2]

I cannot grasp the concept why x,y,z would be equal to sine and cosine function.
I know the substitution is made because it will result in sin^2(x) + cos^2(x) = 1, making the integration easy to solve, but i cannot understand on what basis it is made, so an explanation on that would be much appreciated, thank you

Why is it necessary to also insert the cos(f) and sin(f) functions into there, doesnt cos, sin(t) cover the whole surface already? Please explain.

#### AllanCuz

Hello, i am having a problem at understanding the substitution method for a triple integration

Say, i have a triple integral (x^2+y^2+z^2)dxdydz, on a volume V: x^2+y^2+z^2<=a^2

I know the volume refers to the inside of a sphere, with a radius of a, however what i do not understand is why, in order to solve the integration, the following substitutions are made

x= r*cos(t)*cos(f)
y= r*sin(t)*sin(f)
z= r*sin(f)

with r belonging to [0,a]
t belonging to [0,2pi]
f belonging to [-pi/2, pi/2]

I cannot grasp the concept why x,y,z would be equal to sine and cosine function.
I know the substitution is made because it will result in sin^2(x) + cos^2(x) = 1, making the integration easy to solve, but i cannot understand on what basis it is made, so an explanation on that would be much appreciated, thank you

Why is it necessary to also insert the cos(f) and sin(f) functions into there, doesnt cos, sin(t) cover the whole surface already? Please explain.
What you're doing there is changing to spherical co-ordinates. You have marked the co-ordinate system a little differently then what convention states.

In terms of calculating volume, no matter what co-ordinate set you use, think about what you your integrals represent and see if you are actually calculating the volume.

For example,

In the case of a sphere we have phi, theta and p. What are these things? Well P is the distance of travel. So if we are going from the origin to the edge of a sphere, our distance is from 0 to the radius. If you draw this out, this will actually create a line that you can draw an angle to from the z axis, this angle is denoted by phi. So if we take this line and go from 0 to pi, we are covering the volume inside the sphere along this one line onle. But we need the volume of the entire sphere, which can be easily done if we rotate 360 degrees!

Knowing this, we can find out where the following come from

$$\displaystyle x= r*cos(t)*cos(f)$$

$$\displaystyle y= r*sin(t)*sin(f)$$

$$\displaystyle z= r*sin(f)$$

Draw the triangle from the line 0 to radius a to the z axis and denote phi as the angle between the z axis and the line 0 to a. This will produce the relationship (by right angle triangle rules)

$$\displaystyle \phi = cos^{-1} { \frac{z}{a} }$$

So,

$$\displaystyle z = acos \phi$$

Now draw the triangle from the line 0 to radius a to the xy plain and denote theta as the angle between the x-axis and the projection of the line 0 to a on the xy plane.

This will produce,

$$\displaystyle \theta = tan^{-1} \frac{y}{x}$$

$$\displaystyle x tan \theta = y$$

$$\displaystyle x sin \theta = y cos \theta$$

We also know,

$$\displaystyle r = \sqrt {x^2 + y^2 + z^2 }$$

Solve the 2 equations for x and y (after subbing in z) and you will find the above definitions to be true

Look at my notes about sphereical co-ordinates here: ImageShack Album - 2 images  So for spherical we would set up the volume of a sphere like

$$\displaystyle \iiint_{Sphere} dV = \int_0^{ 2 \pi } d \theta \int_0^{ \pi } sin \phi d \phi \int_0^a p^2 dp$$

It's important to note that we can also compute this in cylindrical co-ordinates. In the example given in my notes what we end up with is a very very hard integration. The point was to demonstrate how to use spherical co-ordinates, but that problem would actually be best computed with cylindrical co-ordinates!

Last edited:

#### kamykazee

First of all, thanks for the reply

The angle phi as i can see basicly covers the area of one of the circles. But why is the sine integral from pi/6 to pi/2?

The sine of an angle is the value it has on the z axis, as a number, if you were to draw a line from the point where the angle is (pi/4, for example) and intersect it with the axis. Isn't that a equal to the value of the cosine for the a certain angle on the circle? In other words, isn't half the radius, as thats what i think it represents, a cosine in itself? It is, right? (Those were just random thoughts, i initially didnt understand but i answered myself as i went along).

And why the cylinder? why is the minimum radius from the origin to the cylinder? And how do you know that at that point, one of the sides is exactly half the radius?

Also, i don't think you explained the theta angle, you did a nice job, i understood the phi angle, i think, but what about the theta? And shouldn't it be a cosine?

Please explain, my head does indeed hurt, i am trying quite hard to grasp this, i hope you don't give up one me lol.

#### AllanCuz

First of all, thanks for the reply

The angle phi as i can see basicly covers the area of one of the circles. But why is the sine integral from pi/6 to pi/2?

The sine of an angle is the value it has on the z axis, as a number, if you were to draw a line from the point where the angle is (pi/4, for example) and intersect it with the axis. Isn't that a equal to the value of the cosine for the a certain angle on the circle? In other words, isn't half the radius, as thats what i think it represents, a cosine in itself? It is, right? (Those were just random thoughts, i initially didnt understand but i answered myself as i went along).

And why the cylinder? why is the minimum radius from the origin to the cylinder? And how do you know that at that point, one of the sides is exactly half the radius?

Also, i don't think you explained the theta angle, you did a nice job, i understood the phi angle, i think, but what about the theta? And shouldn't it be a cosine?

Please explain, my head does indeed hurt, i am trying quite hard to grasp this, i hope you don't give up one me lol.
The example in my notes demonstrates pretty much everything that a question can give you in spherical co-ordinates, which is why I used it as an example for my review sesson that I put on for my peers (we would not solve a problem of that nature in spherical co-ordinates).

In that case, we wanted the volume outside the cylinder but inside the sphere. This is the area on the right and left side of my diagram (outside the cylinder wall but inside the sphere) which lies to the right of the line $$\displaystyle \frac{ \pi }{6}$$. We go to $$\displaystyle \frac{ \pi }{2}$$ because it's easiar to stop at the XY plane and multiply by 2 (i think i'm missing a 2 i cant recall).

You can see where $$\displaystyle \frac{ \pi }{6}$$ comes from in my notes. It is the angle between the z-axis and the line through the cylinder from the origin to 2a. This is the line that denotes the furthest edge of the cylinder, and we only want the volume under this line! Thus, this is our starting point.

Theta is defined in the same was as it is for cylindrical co-ordinates. We project the line of 0 to a (that lies in the 3D space) onto the XY domain, and the angle from the x-axis to this line is theta. Typically we go 360 degrees unless there is a restriction placed on the problem (i.e. the cylinder isn't at the origin).

If you're wondering why the minimum P is defined by the cylinder, this is because we went from the volume of area between the cylinder and the parabola. We cannot be inside the cylinder! But since the distance from the origin to the cylinder wall changes, we must find an appropriate equation to model this. This will be our minimum P and of course our maximum P never changes and is the radius of the sphere.

I'm actually on my way out to the cottege for the weekend. i have internet there and will be able to reply but I will be a ghost until tomorrow. So if you still have questions/no one has given you a good enough answer I will certainly be back to help 