Spherical Coordinates#

in \(\mathbb{R}^3\)

\( \boxed{ \begin{aligned} T&:(\rho,\phi,\theta)\mapsto(x,y,z) \\ T^{-1}&:(x,y,z)\mapsto(\rho,\phi,\theta) \\ T(\rho,\phi,\theta)&=(\rho\sin\phi\cos\theta,\rho\sin\phi\sin\theta,\rho\cos\phi) \\ &=(x(\rho,\phi,\theta),y(\rho,\phi,\theta),z(\rho,\phi,\theta)) &&\text{transformation} \\ \hline \\ x(\rho,\phi,\theta)=r\cos\theta&=\rho\sin\phi\cos\theta \\ y(\rho,\phi,\theta)=r\sin\theta&=\rho\sin\phi\sin\theta \\ z(\rho,\phi,\theta)&=\rho\cos\phi &&\text{transformation equations} \\ \hline \\ \sqrt{x^2+y^2}=r&=\rho\sin\phi \\ x^2+y^2+z^2&=\rho^2 &&\text{Pythagorean identity} \\ dV&=\rho^2\sin\phi\,d\rho\,d\phi\,d\theta &&\text{Jacobian} \end{aligned} } \)


Revised

02 Apr 2023


Spherical Coordinate System#

Spherical coordinates are good to use for regions with more than one axis of rotational symmetry.

In other words, more than one of the cross sections of the region is circular.


Transformation Equations \((x,y,z)\leftrightarrow(\rho,\phi,\theta)\)#

\( \begin{aligned} \rho\ge0&\,\,\,\text{distance from the origin} \\ 0\le\phi\le\pi&\,\,\,\text{angle from the positive z-axis to the negative z-axis} \\ 0\le\theta\le2\pi&\,\,\,\text{angle from the positive x-axis in the xy-plane} \end{aligned} \)

If we are thinking about the Earth, then \(\theta\) is longitude, \(\phi\) is latitude, and \(\rho\) is the distance from the center of the Earth.

\( \begin{aligned} x(\rho,\phi,\theta)&=r\cos\theta=\rho\sin\phi\cos\theta \\ y(\rho,\phi,\theta)&=r\sin\theta=\rho\sin\phi\sin\theta \\ z(\rho,\phi,\theta)&=\rho\cos\phi \\ \sqrt{x^2+y^2}&=r=\rho\sin\phi \\ x^2+y^2+z^2&=\rho^2 \end{aligned} \)

Infinitesimals#

\(d\rho\,d\phi\,d\theta\)-voxels in the rectangular \(\rho\phi\theta\)-grid are transformed into 3D wedges \(dV\) in the spherical \(xyz\)-grid.

\( \begin{aligned} dV\ne d\rho\,d\phi\,d\theta \end{aligned} \)

How big is spherical \(dV\) in relation to rectangular \(d\rho\,d\phi\,d\theta\)-voxel?

The further the \(d\rho\,d\phi\,d\theta\)-voxel is in the \(\rho\)-direction in the rectangular \(d\rho\,d\phi\,d\theta\)-grid the larger the 3D wedge \(dV\) is in the spherical \(xyz\)-grid.

\( \begin{aligned} dV=\rho^2\sin\phi\,d\rho\,d\phi\,d\theta &&\text{from the Jacobian} \end{aligned} \)

Jacobian#

\( \begin{aligned} \frac{\partial(x,y,z)}{\partial(\rho,\phi,\theta)} &=\begin{vmatrix} \dfrac{\partial x}{\partial \rho} & \dfrac{\partial x}{\partial \phi} & \dfrac{\partial x}{\partial \theta} \\\\ \dfrac{\partial y}{\partial \rho} & \dfrac{\partial y}{\partial \phi} & \dfrac{\partial y}{\partial \theta} \\\\ \dfrac{\partial z}{\partial \rho} & \dfrac{\partial z}{\partial \phi} & \dfrac{\partial z}{\partial \theta} \end{vmatrix} =\begin{vmatrix} \sin\phi\cos\theta & \rho\cos\phi\cos\theta & -\rho\sin\phi\sin\theta \\\\ \sin\phi\sin\theta & \rho\cos\phi\sin\theta & \rho\sin\phi\cos\theta \\\\ \cos\phi & -\rho\sin\phi & 0 \end{vmatrix} =\cos\phi \begin{vmatrix} \rho\cos\phi\cos\theta & -\rho\sin\phi\sin\theta \\\\ \rho\cos\phi\sin\theta & \rho\sin\phi\cos\theta \end{vmatrix} + \rho\sin\phi \begin{vmatrix} \sin\phi\cos\theta & -\rho\sin\phi\sin\theta \\\\ \sin\phi\sin\theta & \rho\sin\phi\cos\theta \end{vmatrix} \\ &=\cos\phi(\rho^2\cos\phi\sin\phi\cos^2\theta+\rho^2\cos\phi\sin\phi\sin^2\theta) +\rho\sin\phi(\rho\sin^2\phi\cos^2\theta+\rho\sin^2\phi\sin^2\theta) \\ &=\rho^2\cos^2\phi\sin\phi(\cos^2\theta+\sin^2\theta) +\rho^2\sin^3\phi(\cos^2\theta+\sin^2\theta) \\ &=\rho^2\sin\phi(\cos^2\phi+\sin^2\phi) \\ &=\rho^2\sin\phi \end{aligned} \)


Examples#


[EXAMPLE]

An upper half ball of radius \(\rho=3\) centered at the origin has a density \(d\)

\( \begin{aligned} d(x,y,z) =\frac{x^2z}{x^2+y^2+z^2} \,\,\,\text{g cm}^3 \end{aligned} \)

Calculate its mass.

\( \boxed{ \text{mass}\,\,\, m=\frac{81\pi}{16} \,\,\,\text{g} } \)

\( \begin{aligned} \text{mass}\,\,\, m =\underset{R}{\iiint}d(x,y,z)\,dV =\underset{R}{\iiint}\frac{x^2z}{x^2+y^2+z^2}\,dx\,dy\,dz \end{aligned} \)

Draw the region in \(\mathbb{R}^3\).

Find the new bounds.

\( 0\le\rho\le3 \)

\( \begin{aligned} z\ge0 \implies \rho\cos\phi\ge0 \implies \cos\phi\ge0 \implies 0\le\phi\le\frac{\pi}{2} \,\,\,\text{where}\,\,\, 0\le\phi\le\pi \end{aligned} \)

\( 0\le\theta\le2\pi \)

\( \begin{aligned} \text{mass}\,\,\, m &=\underset{R}{\iiint}\frac{x^2z}{x^2+y^2+z^2}\,dx\,dy\,dz \\ &=\underset{R}{\iiint}\frac{(\rho\sin\phi\cos\theta)^2(\rho\cos\phi)}{\rho^2}\rho^2\sin\phi\,d\rho\,d\phi\,d\theta =\underset{R}{\iiint}\rho^3\sin^3\phi\cos\phi\cos^2\theta\,d\rho\,d\phi\,d\theta \\ &=\int_{\theta=0}^{\theta=2\pi}\int_{\phi=0}^{\phi=\frac{\pi}{2}}\int_{\rho=0}^{\rho=3}\rho^3\sin^3\phi\cos\phi\cos^2\theta\,d\rho\,d\phi\,d\theta \\ &=\int_{\theta=0}^{\theta=2\pi}\cos^2\theta\,d\theta\int_{\phi=0}^{\phi=\frac{\pi}{2}}\sin^3\phi\cos\phi\,d\phi\int_{\rho=0}^{\rho=3}\rho^3\,d\rho &&\text{by factoring} \\ &=\pi\int_{\phi=0}^{\phi=\frac{\pi}{2}}\sin^3\phi\cos\phi\,d\phi\int_{\rho=0}^{\rho=3}\rho^3\,d\rho &&\pi=\int_{\theta=0}^{\theta=2\pi}\cos^2\theta\,d\theta \,\,\,\text{by trigonometric symmetry} \\ &=\frac{\pi}{4}\int_{\rho=0}^{\rho=3}\rho^3\,d\rho &&\frac{1}{4}=\int_{\phi=0}^{\phi=\frac{\pi}{2}}\sin^3\phi\cos\phi\,d\phi \,\,\,\text{by u-substitution} \\ &=\frac{81\pi}{16} &&\frac{3^4}{4}=\int_{\rho=0}^{\rho=3}\rho^3\,d\rho \end{aligned} \)

\( \begin{aligned} &\int_{\phi=0}^{\phi=\frac{\pi}{2}}\sin^3\phi\cos\phi\,d\phi \\ u&=\sin\phi \\ du&=\cos\phi\,d\phi \\ \phi&=0 \implies u=0 \\ \phi&=\frac{\pi}{2} \implies u=1 \\ &\int_{\phi=0}^{\phi=\frac{\pi}{2}}\sin^3\phi\cos\phi\,d\phi =\int_{u=0}^{u=1}u^3\,du =\left.\left(\frac{1}{4}u^4\right)\right|_{u=0}^{u=1} =\frac{1}{4} \end{aligned} \)


[EXAMPLE]

\( \begin{aligned} \frac{64\pi}{5}\left(\frac{1}{3}-\frac{1}{3\sqrt[3]{2}}\right) =\underset{R}{\iiint}z^2\,dV \,\,\,\text{where}\,\,\, R=\left\{(x,y,z)\mid x^2+y^2+z^2\le4,z\le\sqrt{x^2+y^2}\right\} \end{aligned} \)

Draw the region in \(\mathbb{R}^3\).

Cone with a spherical top

  • Sphere of radius 2 at the origin \(x^2+y^2+z^2=4\)

  • Cone \(z=\sqrt{x^2+y^2}\)

Find the new bounds.

\( x^2+y^2+z^2\le4 \implies \rho^2\le4 \implies \rho\le2 \,\,\,\text{where}\,\,\, \rho\ge0 \)

\( \begin{aligned} z\le\sqrt{x^2+y^2} \implies \rho\cos\phi\le\rho\sin\phi \implies \cos\phi\le\sin\phi \implies \cot\phi\le1\le\tan\phi \implies \phi=\frac{\pi}{4} \,\,\,\text{where}\,\,\, 0\le\phi\le\pi \end{aligned} \)

\(0\le\theta\le2\pi\)

\( \begin{aligned} \underset{R}{\iiint}z^2\,dV &=\underset{R}{\iiint}(\rho\cos\phi)^2\rho^2\sin\phi\,d\rho\,d\phi\,d\theta =\underset{R}{\iiint}\rho^4\cos^2\phi\sin\phi\,d\rho\,d\phi\,d\theta \\ &=\int_{\theta=0}^{\theta=2\pi}\int_{\phi=0}^{\phi=\frac{\pi}{4}}\int_{\rho=0}^{\rho=2}\rho^4\cos^2\phi\sin\phi\,d\rho\,d\phi\,d\theta \\ &=\int_{\theta=0}^{\theta=2\pi}\,d\theta\int_{\phi=0}^{\phi=\frac{\pi}{4}}\cos^2\phi\sin\phi\,d\phi\int_{\rho=0}^{\rho=2}\rho^4\,d\rho &&\text{by factoring} \\ &=\frac{64\pi}{5}\int_{\phi=0}^{\phi=\frac{\pi}{4}}\cos^2\phi\sin\phi\,d\phi &&\frac{2^5}{5}=\int_{\rho=0}^{\rho=2}\rho^4\,d\rho \\ &=\frac{64\pi}{5}\left(\frac{1}{3}-\frac{1}{3\sqrt[3]{2}}\right) &&\frac{1}{3}-\frac{1}{3\sqrt[3]{2}}=\int_{\phi=0}^{\phi=\frac{\pi}{4}}\cos^2\phi\sin\phi\,d\phi \\ &\approx8.6651 \end{aligned} \)

import numpy as np

64*np.pi/5*((1/3)-(1/(3*2**(3/2))))
8.66505352128086

\( \begin{aligned} &\int_0^\frac{\pi}{4}\cos^2\theta\sin\theta\,d\theta \\ u&=\cos\theta \\ du&=-\sin\theta\,d\theta \iff -du=\sin\theta\,d\theta \\ \theta&=0 \implies u=1 \\ \theta&=\frac{\pi}{4} \implies u=\frac{1}{\sqrt{2}} \\ &\int_0^\frac{\pi}{4}\cos^2\theta\sin\theta\,d\theta =\int_\frac{1}{\sqrt{2}}^1u^2\,du =\left.\left(\frac{1}{3}u^3\right)\right|_\frac{1}{\sqrt{2}}^1 =\frac{1}{3}-\frac{1}{3}\left(\frac{1}{\sqrt{2}}\right)^3 =\frac{1}{3}-\frac{1}{3\sqrt[3]{2}} \approx0.2155 \end{aligned} \)

((1/3)-(1/(3*2**(3/2))))
0.21548220313557542

[EXAMPLE]

\( \begin{aligned} \underset{R}{\iiint}\sqrt{x^2+y^2+z^2}\,dV \,\,\,\text{where}\,\,\, R=\{(x,y,z)\mid x^2+y^2+z^2\le4,z\ge1\} \end{aligned} \)

Draw the region in \(\mathbb{R}^3\).

Region bounded by

  • Sphere of radius 2

  • Plane parallel to the \(xy\)-plane at \(z=1\)

Find the new bounds.

\( x^2+y^2+z^2\le4 \iff \rho^2\le4 \iff \rho\le2 \,\,\,\text{where}\,\,\, \rho\ge0 \)

equation of the sphere \(\rho=2\)

\( z\ge1 \iff \rho\cos\phi\ge1 \iff \rho\ge\sec\phi \)

equation of the plane \(\rho=\sec\phi\)

\(\sec\phi\le\rho\le2\)

\( \begin{aligned} 2=\sec\phi \iff \cos\phi=\frac{1}{2} \iff \phi=\frac{\pi}{3} \end{aligned} \)

\( \begin{aligned} 0\le\phi\le\frac{\pi}{3} \end{aligned} \)

\(0\le\theta\le2\pi\)

\( \begin{aligned} \underset{R}{\iiint}\sqrt{x^2+y^2+z^2}\,dV &=\underset{R}{\iiint}\rho^3\sin\phi\,d\rho\,d\phi\,d\theta \\ &=\int_{\theta=0}^{\theta=2\pi}\int_{\phi=0}^{\phi=\frac{\pi}{3}}\int_{\rho=\sec\phi}^{\rho=2}\rho^3\sin\phi\,d\rho\,d\phi\,d\theta \\ &=\int_{\theta=0}^{\theta=2\pi}\,d\theta\int_{\phi=0}^{\phi=\frac{\pi}{3}}\int_{\rho=\sec\phi}^{\rho=2}\rho^3\sin\phi\,d\rho\,d\phi &&\text{by factoring} \\ \\ &=2\pi\int_{\phi=0}^{\phi=\frac{\pi}{3}}\int_{\rho=\sec\phi}^{\rho=2}\rho^3\sin\phi\,d\rho\,d\phi \\ &=2\pi\int_{\phi=0}^{\phi=\frac{\pi}{3}}\left.\left(\frac{1}{4}\rho^4\sin\phi\right)\right|_{\rho=\sec\phi}^{\rho=2}\,d\phi \\ &=\frac{\pi}{2}\int_{\phi=0}^{\phi=\frac{\pi}{3}}(16\sin\phi-\sec^4\phi\sin\phi)\,d\phi \\ &=8\pi\int_{\phi=0}^{\phi=\frac{\pi}{3}}\sin\phi\,d\phi-\frac{\pi}{2}\int_{\phi=0}^{\phi=\frac{\pi}{3}}\sec^4\phi\sin\phi\,d\phi \\ &=4\pi-\frac{\pi}{2}\int_{\phi=0}^{\phi=\frac{\pi}{3}}\sec^4\phi\sin\phi\,d\phi &&\frac{1}{2}=\int_{\phi=0}^{\phi=\frac{\pi}{3}}\sin\phi\,d\phi \\ &=4\pi-\frac{7\pi}{6} &&\frac{7}{3}=\int_0^\frac{\pi}{3}\sec^4\theta\sin\theta\,d\theta \\ &=\frac{17\pi}{6} \end{aligned} \)

\( \begin{aligned} \int_0^\frac{\pi}{3}\sec^4\theta\sin\theta\,d\theta &=\int_0^\frac{\pi}{3}\frac{1}{\cos^4\theta}\sin\theta\,d\theta \\ u&=\cos\theta \\ du&=-\sin\theta\,d\theta \iff -du=\sin\theta\,d\theta \\ \theta&=0 \implies u=1 \\ \theta&=\frac{\pi}{3} \implies u=\frac{1}{2} \\ \int_0^\frac{\pi}{3}\sec^4\theta\sin\theta\,d\theta &=\int_\frac{1}{2}^1u^{-4}\,du \\ &=\left.\left(-\frac{1}{3}u^{-3}\right)\right|_\frac{1}{2}^1 =-\frac{1}{3}(1)^{-3}+\frac{1}{3}\left(\frac{1}{2}\right)^{-3} =\frac{7}{3} \end{aligned} \)


GeoGebra#

R=3

surface(Rsin(p)cos(t),Rsin(p)sin(t),Rcos(p),p,0,P,t,0,T)


Terms#

  • [W] Determinant

  • [W] Fundamental Plane

  • [W] Jacobian

  • [W] Spherical Coordinate System