# triple integration in spherical

• Apr 8th 2006, 09:23 AM
comp_engr
triple integration in spherical
I am having trouble setting up the following integral problem: "Find the volume of the solid that lies inside the cone z^2 = 3x^2 + 3y^2 and between the spheres x^2 + y^2 + z^2 = 1 and x^2 +y^2 + z^2 = 9 "

I know that it must be done with spherical coordinates and that it will be a triple integral. However, I'm a little unsure how to set up the limits and the integral itself. Thanks for any help
• Nov 20th 2006, 06:16 PM
putnam120
$\iiint_DdV$ we have spheres with radii of 1 and 3, and $z=\sqrt{3(x^2+y^2)}$ so converting to spherical we have

$\int_0^{2\pi}\int_{\frac{\pi}{3}}^{\frac{\pi}{2}}\ int_1^3 p^2\sin(\phi)dp d\phi d\theta$

upon evaluating this (I'll leave that for you to do) you should get $\frac{13\pi}{3}$.

if you need more clarification just let me know.
• Nov 20th 2006, 07:45 PM
ThePerfectHacker
Quote:

Originally Posted by putnam120
$\iiint_DdV$ we have spheres with radii of 1 and 3, and $z=\sqrt{3(x^2+y^2)}$ so converting to spherical we have

$\int_0^{2\pi}\int_{\frac{\pi}{3}}^{\frac{\pi}{2}}\ int_1^3 p^2\sin(\phi)dp d\phi d\theta$

upon evaluating this (I'll leave that for you to do) you should get $\frac{13\pi}{3}$.

if you need more clarification just let me know.

How you get that?

For the limits I get,
$0\leq \theta\leq 2\pi$
$0\leq \phi \leq \pi/3$
$1\leq r\leq 3$

And then you double your result because there are two parts. The solid above and below. And you cannot express that as a single bound on $\phi$
• Nov 20th 2006, 10:04 PM
putnam120
ok i agree i made a mistake. but i think the range for $\phi$ should be $0\to\frac{\pi}{6}$

this is because if we solve the equation of the cone we have

$p^2\cos^2(\phi)=3p^2\sin^2(\phi)\Longrightarrow\ta n(\phi)=\frac{1}{\sqrt{3}}\Longrightarrow\phi=\fra c{\pi}{6}$
• Nov 21st 2006, 12:50 AM
CaptainBlack
Quote:

Originally Posted by putnam120
ok i agree i made a mistake. but i think the range for $\phi$ should be $0\to\frac{\pi}{6}$

this is because if we solve the equation of the cone we have

$p^2\cos^2(\phi)=3p^2\sin^2(\phi)\Longrightarrow\ta n(\phi)=\frac{1}{\sqrt{3}}\Longrightarrow\phi=\fra c{\pi}{6}$

If I have done this right this time, hit-and-miss Monte-Carlo gives this
integral is ~=1.83 +/- ~0.02 (that's +/- 2 sigma error), or about 6-7%
of the volume of the 3x3x3 circumscribed cube.

Aparently it's gone wrong - I'll have to check the code when I get the chance.

OK now its fixed:

Code:

> >NN=100000; >x=(random(NN,3)-0.5)*6; > > >nx=x(:,1)^2+x(:,2)^2+x(:,3)^2; >mx=3*x(:,1)^2+3*x(:,2)^2-x(:,3)^2; > >ll=(nx>1)&&(nx<9)&&(mx<0);ll=sum(ll')/NN*(6^3)       14.6232
Integral ~=14.6+/- ~0.34 (that's +/- 2 sigma error)

RonL
• Nov 21st 2006, 08:06 AM
galactus
I get:

$V=\int_{0}^{2{\pi}}\int_{0}^{\frac{\pi}{6}}\int_{1 }^{3}{\rho}^{2}sin({\phi})d{\rho}d{\phi}d{\theta}= \frac{26(2-\sqrt{3}){\pi}}{3}\approx{7.295}$
• Nov 21st 2006, 08:14 AM
ThePerfectHacker
Quote:

Originally Posted by galactus
I get:

$V=\int_{0}^{2{\pi}}\int_{0}^{\frac{\pi}{6}}\int_{1 }^{3}{\rho}^{2}sin({\phi})d{\rho}d{\phi}d{\theta}= \frac{26(2-\sqrt{3}){\pi}}{3}\approx{7.295}$

I would just multiply by 2 becaus there are two parts the upper and lower part when you draw these quadradic surfaces.

How did you get that angle for the cone? I got it from a dot product between the z-axis and the vector on a cone. How did you?
• Nov 21st 2006, 08:48 AM
galactus
Hey PH.

I just converted rectangular to spherical coordinates.

$z=\sqrt{3(x^{2}+y^{2})}$

${\rho}cos({\phi})=\sqrt{3[{\rho}^{2}sin^{2}({\phi})cos^{2}({\theta})+{\rho}^ {2}sin^{2}({\phi})sin^{2}({\theta})]}$

${\rho}cos({\phi})=\sqrt{3}{\rho}sin({\phi}),$(Actually, this should be $\sqrt{3}|psin({\phi})|$)

$cot({\phi})=\sqrt{3}$

${\phi}=\frac{\pi}{6}$

May I see your dot product method?.
• Nov 21st 2006, 10:08 AM
ThePerfectHacker
Quote:

Originally Posted by galactus
May I see your dot product method?.

In spherical coordinates the equation,
$\phi = \mbox{konstant}$ describes a cone (half cone).

So, $\phi=\pi/4$ describes a cone above the xy-plane with angle (with z-axis) of $45^o$. If $\phi=\pi/2$ we get the xy-plane. If $\phi=3\pi/4$ we get the same cone but upside down. Note, these equations only describe a half-cone. A two sided cone appears in this example which is why we need to double the integral.

The question is the upper side of the cone $z^2=3(x^2+y^2)$ is what equation in spherical coordinates, that is $\phi=?$. To find the angle we need to find the angle with the lateral side of the cone (which is a straight line) and the z-axis (that is definition of $\phi$). To do that we can use the dot product. Select a point on the upper-cone, say $(0,1,\sqrt{3})$. Select a point on the z-axis $(0,0,1)$.
The vector from the origon to point on cone is $\bold{i}+\bold{j}\sqrt{3}$ and the vector from origon to z-axis is $\bold{k}$.

Now you take the dot product to find the angle,
$\bold{u}\cdot \bold{v}=||\bold{u}||\cdot ||\bold{v}|| \cos x$
Which is what you get.
• Nov 21st 2006, 11:25 AM
galactus
I like it, PH. Good way to go about it.