01 / 21

Cartesian to
Spherical Coordinates

Master the conversion between \((x, y, z)\) and \((\rho, \theta, \phi)\) to unlock powerful tools for integration and 3D analysis.

Multivariable Calculus

What Are Spherical Coordinates?

Spherical coordinates describe a point in 3D space using three values instead of the familiar \((x, y, z)\). Every point is located by its distance from the origin and two angles that orient it on a sphere.

\(\rho\) : Radial Distance
Distance from the origin to the point. Always \(\rho \geq 0\).
\(\theta\) : Azimuthal Angle
Angle in the \(xy\)-plane from the positive \(x\)-axis. Range: \([0, 2\pi)\).
\(\phi\) : Polar Angle
Angle from the positive \(z\)-axis down to the point. Range: \([0, \pi]\).

Visualizing the 3D Framework

\(z\) \(x\) \(y\) \(O\) \(P\) \(\rho\) \(P'\) \(\phi\) \(\theta\)

Why Spherical Coordinates Matter

Many problems in physics and mathematics involve spherical symmetry: gravitational fields, electric fields, wave functions, and volume integrals over spheres. Cartesian coordinates make these problems difficult, but spherical coordinates simplify them dramatically.

✓ Integration
Evaluating triple integrals over spheres and cones becomes straightforward.
✓ Physics
Coulomb's Law, gravitational potential, and orbital mechanics are naturally spherical.
✓ Symmetry
Exploiting radial symmetry reduces 3D problems to simpler 1D or 2D ones.

The Core Formulas: Cartesian to Spherical

\(\rho\)
$$\rho = \sqrt{x^2 + y^2 + z^2}$$
\(\theta\)
$$\theta = \arctan\!\left(\frac{y}{x}\right)$$
\(\phi\)
$$\phi = \arccos\!\left(\frac{z}{\rho}\right)$$

Reverse Direction: Spherical to Cartesian

1
\(x = \rho\sin\phi\cos\theta\)
2
\(y = \rho\sin\phi\sin\theta\)
3
\(z = \rho\cos\phi\)

Spherical vs Cylindrical

Spherical \((\rho,\theta,\phi)\) Cylindrical \((r,\theta,z)\)
Radial variable \(\rho\) : distance to origin \(r\) : distance to \(z\)-axis
Angles Two: \(\theta\) (azimuthal), \(\phi\) (polar) One: \(\theta\) (azimuthal)
Third coordinate \(\phi \in [0,\pi]\) \(z \in (-\infty,\infty)\)
Best for Spheres, cones, radial symmetry Cylinders, tubes, axial symmetry
Volume element \(\rho^2\sin\phi\,d\rho\,d\phi\,d\theta\) \(r\,dr\,d\theta\,dz\)

Connecting \(\rho\) and \(r\)

\(z\) \(xy\)-plane \(O\) \(P\) \(\rho\) \(r\) \(z\) \(\phi\)
1
The cylindrical radius is: \(r = \rho\sin\phi\)
2
The height is: \(z = \rho\cos\phi\)
3
And so: \(\rho^2 = r^2 + z^2 = x^2 + y^2 + z^2\)

Step-by-Step Conversion Process

1
Compute \(\rho\). Find \(\rho = \sqrt{x^2 + y^2 + z^2}\). This is the 3D distance from the origin.
2
Compute \(\phi\). Find \(\phi = \arccos\!\left(\frac{z}{\rho}\right)\). This is the angle from the positive \(z\)-axis. Range: \([0, \pi]\).
3
Compute \(\theta\). Find \(\theta = \text{atan2}(y, x)\). Adjust to \([0, 2\pi)\) if needed.
4
Verify. Convert back: check that \(\rho\sin\phi\cos\theta = x\), \(\rho\sin\phi\sin\theta = y\), and \(\rho\cos\phi = z\).

Example 1: Convert \((1, 1, \sqrt{2})\)

1
Find \(\rho\): \(\rho = \sqrt{1^2 + 1^2 + (\sqrt{2})^2} = \sqrt{1 + 1 + 2} = \sqrt{4} = 2\)
2
Find \(\phi\): \(\phi = \arccos\!\left(\frac{\sqrt{2}}{2}\right) = \frac{\pi}{4}\)
3
Find \(\theta\): \(\theta = \arctan\!\left(\frac{1}{1}\right) = \frac{\pi}{4}\) (first quadrant, so no adjustment needed)

Example 2: Convert \((0, -3, 0)\)

1
Find \(\rho\): \(\rho = \sqrt{0 + 9 + 0} = 3\)
2
Find \(\phi\): \(\phi = \arccos\!\left(\frac{0}{3}\right) = \arccos(0) = \frac{\pi}{2}\). The point lies in the \(xy\)-plane.
3
Find \(\theta\): Since \(x = 0\) and \(y < 0\), the point is on the negative \(y\)-axis: \(\theta = \frac{3\pi}{2}\).

Example 3: Spherical to Cartesian

1
Find \(x\): \(x = 4\sin\!\left(\frac{\pi}{6}\right)\cos\!\left(\frac{\pi}{3}\right) = 4 \cdot \frac{1}{2} \cdot \frac{1}{2} = 1\)
2
Find \(y\): \(y = 4\sin\!\left(\frac{\pi}{6}\right)\sin\!\left(\frac{\pi}{3}\right) = 4 \cdot \frac{1}{2} \cdot \frac{\sqrt{3}}{2} = \sqrt{3}\)
3
Find \(z\): \(z = 4\cos\!\left(\frac{\pi}{6}\right) = 4 \cdot \frac{\sqrt{3}}{2} = 2\sqrt{3}\)

The Volume Element \(dV\)

When converting triple integrals, you must replace \(dx\,dy\,dz\) with the spherical volume element. The Jacobian determinant of the transformation gives:

\(\rho^2\)
Accounts for the radial stretching: shells farther from the origin enclose more volume.
\(\sin\phi\)
Accounts for the latitude compression: rings near the poles are smaller than at the equator.

Converting Equations Between Systems

To convert the equation of a surface from Cartesian to spherical, substitute the conversion formulas. Some common results:

1
Sphere \(x^2+y^2+z^2 = R^2\): becomes simply \(\rho = R\).
2
Cone \(z = \sqrt{x^2+y^2}\): Since \(\rho\cos\phi = \rho\sin\phi\), this gives \(\phi = \frac{\pi}{4}\).
3
Plane \(z = c\): becomes \(\rho\cos\phi = c\), or \(\rho = \frac{c}{\cos\phi} = c\sec\phi\).

Common Mistakes to Avoid

✕ Swapping \(\theta\) and \(\phi\)
Physics uses the opposite convention. In math (ISO convention), \(\phi\) is from the \(z\)-axis and \(\theta\) is azimuthal. Always check your textbook.
✕ Wrong quadrant for \(\theta\)
Using \(\arctan(y/x)\) alone ignores the quadrant. Use \(\text{atan2}(y,x)\) or manually adjust based on the signs of \(x\) and \(y\).
✕ Forgetting \(\rho^2\sin\phi\)
When converting integrals, you must include the Jacobian factor \(\rho^2\sin\phi\). Omitting it gives an answer that is dimensionally wrong.

Summary: Conversion at a Glance

Direction Formula
\(x\) from spherical \(\rho\sin\phi\cos\theta\)
\(y\) from spherical \(\rho\sin\phi\sin\theta\)
\(z\) from spherical \(\rho\cos\phi\)
\(\rho\) from Cartesian \(\sqrt{x^2+y^2+z^2}\)
\(\theta\) from Cartesian \(\text{atan2}(y, x)\)
\(\phi\) from Cartesian \(\arccos(z/\rho)\)
Volume element \(\rho^2\sin\phi\,d\rho\,d\phi\,d\theta\)

Question 1 of 5

What is \(\rho\) for the Cartesian point \((1, 0, 0)\)?

Question 2 of 5

Convert \((0, 0, 5)\) to spherical coordinates. What are \(\phi\) and \(\theta\)?

Question 3 of 5

Convert the spherical point \(\left(2, \frac{\pi}{2}, \frac{\pi}{2}\right)\) to Cartesian. What is the result?

Question 4 of 5

The equation of a sphere \(x^2 + y^2 + z^2 = 9\) in spherical coordinates is:

Question 5 of 5

When converting the integral \(\iiint f\,dV\) from Cartesian to spherical, the volume element \(dV\) becomes: