Tutorials › Calculus III › Transforming Integrands into Spherical Coordinates

Spherical Triple Integrals · Tutorial 662 of 999

Transforming Integrands into Spherical Coordinates

Rewrite an integrand in spherical coordinates by substituting the coordinate formulas, simplifying carefully, and then including the volume element when setting up a triple integral.

Intermediate 10 min read

What You'll Learn

  • Use the spherical coordinate formulas to rewrite Cartesian expressions.
  • Distinguish the cylindrical radius squared from the squared distance to the origin.
  • Convert coordinate monomials into powers of spherical variables and trigonometric factors.
  • Include the spherical volume element when transforming a triple integral.
  • Recognize when a transformed expression has a singularity on a coordinate axis.

Why Transform the Integrand?

When setting up a triple integral in spherical coordinates, it is not enough to express the region using spherical bounds. The function being integrated must also be rewritten in the new coordinates. A Cartesian expression that looks complicated may become simple when written in terms of distance from the origin and the angles.

This tutorial focuses on that conversion. The key is to substitute the spherical coordinate formulas into the integrand, simplify the resulting expressions, and distinguish the transformed function from the full integrand that includes the volume element.

Spherical Coordinate Formulas

We use the convention \( \rho \ge 0 \), \(0 \le \phi \le \pi\), and \(0 \le \theta < 2\pi\), with

$$ x=\rho\sin\phi\cos\theta,\qquad y=\rho\sin\phi\sin\theta,\qquad z=\rho\cos\phi. $$

Here \(\rho\) is the distance from the origin, \(\phi\) is the angle measured down from the positive \(z\)-axis, and \(\theta\) is the azimuthal angle in the \(xy\)-plane. The volume element for this convention is

$$ dV=\rho^2\sin\phi\,d\rho\,d\phi\,d\theta. $$

If \(f(x,y,z)\) is the function in a triple integral, its transformed function is \(f(\rho\sin\phi\cos\theta,\rho\sin\phi\sin\theta,\rho\cos\phi)\). The full transformed integrand also includes the factor \(\rho^2\sin\phi\) from \(dV\).

Definition: The spherical form of a Cartesian integrand \(f(x,y,z)\) is the function obtained by substituting the spherical coordinate formulas for \(x\), \(y\), and \(z\). In a triple integral, this function is multiplied by the spherical volume factor \(\rho^2\sin\phi\).

Two Identities That Simplify Many Integrands

The expressions \(x^2+y^2\) and \(x^2+y^2+z^2\) occur frequently. Their spherical forms are different: the first measures squared distance from the \(z\)-axis, while the second measures squared distance from the origin.

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

The last equality uses \(\cos^2\theta+\sin^2\theta=1\). Adding \(z^2=\rho^2\cos^2\phi\) gives

$$ \begin{aligned} x^2+y^2+z^2 &=\rho^2\sin^2\phi+\rho^2\cos^2\phi\\ &=\rho^2. \end{aligned} $$

The second equality uses \(\sin^2\phi+\cos^2\phi=1\). These calculations also explain why the azimuthal angle disappears from both expressions.

Important distinction: \(x^2+y^2=\rho^2\sin^2\phi\), whereas \(x^2+y^2+z^2=\rho^2\). The factor \(\sin^2\phi\) is essential when only \(x^2+y^2\) appears.

Coordinate Monomials

For nonnegative integers \(a\), \(b\), and \(c\), substitute the coordinate formulas into each factor of the monomial \(x^a y^b z^c\). Collecting powers gives a general conversion rule:

$$ x^a y^b z^c = \rho^{a+b+c} \sin^{a+b}\phi \cos^c\phi \cos^a\theta \sin^b\theta. $$

The power of \(\rho\) is the sum \(a+b+c\), because each Cartesian coordinate contributes one factor of \(\rho\). Each factor of \(x\) or \(y\) contributes a \(\sin\phi\); each factor of \(z\) contributes a \(\cos\phi\). The azimuthal powers come from the \(\cos\theta\) in \(x\) and the \(\sin\theta\) in \(y\).

The rule applies to monomials with nonnegative integer exponents. For an expression that is a sum of monomials, transform each term and then combine terms if possible. For quotients, transform the numerator and denominator and check where the denominator vanishes before simplifying.

Worked Examples

Worked Example: Transforming a Weighted Sum of Squares

Rewrite \(3x^2+2y^2+z^2\) in spherical coordinates. Then include the volume factor for use in a triple integral.

First substitute the formulas for the coordinates:

$$ \begin{aligned} 3x^2+2y^2+z^2 &=3(\rho\sin\phi\cos\theta)^2 +2(\rho\sin\phi\sin\theta)^2 +(\rho\cos\phi)^2\\ &=3\rho^2\sin^2\phi\cos^2\theta +2\rho^2\sin^2\phi\sin^2\theta +\rho^2\cos^2\phi\\ &=\rho^2\left[ \sin^2\phi(3\cos^2\theta+2\sin^2\theta) +\cos^2\phi \right]. \end{aligned} $$

For the full triple-integral integrand, multiply this result by \(\rho^2\sin\phi\):

$$ (3x^2+2y^2+z^2)\,dV = \rho^4\sin\phi \left[ \sin^2\phi(3\cos^2\theta+2\sin^2\theta) +\cos^2\phi \right] \,d\rho\,d\phi\,d\theta. $$

To check the substitution, set \(\rho=2\), \(\phi=\frac{\pi}{2}\), and \(\theta=0\). The spherical formulas give \(x=2\), \(y=0\), and \(z=0\), so the original expression is \(3(2)^2=12\). The transformed function is \(2^2[1(3\cdot1+2\cdot0)+0]=12\), as required.

Worked Example: Transforming a Coordinate Monomial

Rewrite \(4xy^2z^3\) in spherical coordinates.

The exponents are \(a=1\), \(b=2\), and \(c=3\). The total power of \(\rho\) is \(1+2+3=6\); the power of \(\sin\phi\) is \(1+2=3\); and the power of \(\cos\phi\) is \(3\). The azimuthal factors are \(\cos\theta\) and \(\sin^2\theta\). Therefore,

$$ 4xy^2z^3 = 4\rho^6\sin^3\phi\cos^3\phi\cos\theta\sin^2\theta. $$

For an integral, include the volume factor:

$$ 4xy^2z^3\,dV = 4\rho^8\sin^4\phi\cos^3\phi \cos\theta\sin^2\theta \,d\rho\,d\phi\,d\theta. $$

Check by taking \(\rho=1\), \(\phi=\frac{\pi}{2}\), and \(\theta=\frac{\pi}{4}\). The corresponding coordinates are \(x=\frac{\sqrt{2}}{2}\), \(y=\frac{\sqrt{2}}{2}\), and \(z=0\). Both the original monomial and the transformed expression equal \(0\), because the power of \(z\), or equivalently the factor \(\cos^3\phi\), vanishes.

Worked Example: Transforming a Quotient and the Full Integrand

For \(\rho>0\), rewrite

$$ f(x,y,z)=\frac{x^2+y^2}{x^2+y^2+z^2}. $$

Using the two identities derived above, the numerator becomes \(\rho^2\sin^2\phi\), and the denominator becomes \(\rho^2\). Thus

$$ f(\rho,\phi,\theta) = \frac{\rho^2\sin^2\phi}{\rho^2} = \sin^2\phi. $$

The cancellation is valid for \(\rho>0\). The original quotient is undefined at the origin, where its denominator is zero. For the triple-integral integrand, multiply by the volume factor:

$$ f(x,y,z)\,dV = \rho^2\sin^3\phi \,d\rho\,d\phi\,d\theta. $$

As a check, at \(\rho=2\), \(\phi=\frac{\pi}{2}\), and \(\theta=0\), the coordinates are \((2,0,0)\). The original quotient is \(\frac{4}{4}=1\); the transformed function is \(\sin^2(\frac{\pi}{2})=1\). The transformed function agrees.

Why the Substitution Works

The conversions above follow directly from the coordinate map, rather than from a memorized list of substitutions. For example, the \(x\)- and \(y\)-coordinates share the factor \(\rho\sin\phi\), so squaring and adding them leaves that factor squared times \(\cos^2\theta+\sin^2\theta\). The identity for sine and cosine removes the angle \(\theta\). Adding \(z^2\) then uses the same identity in \(\phi\) to produce \(\rho^2\).

Likewise, the monomial rule follows by raising each coordinate formula to its indicated power and multiplying. Explicitly,

$$ \begin{aligned} x^a y^b z^c &=(\rho\sin\phi\cos\theta)^a (\rho\sin\phi\sin\theta)^b (\rho\cos\phi)^c\\ &=\rho^{a+b+c} \sin^{a+b}\phi\cos^c\phi \cos^a\theta\sin^b\theta. \end{aligned} $$

This calculation justifies the rule for all nonnegative integer exponents: each power is accounted for by ordinary exponent laws. The separate volume factor is needed because a change of coordinates changes the volume represented by a small range of coordinate values. In spherical coordinates that factor is \(\rho^2\sin\phi\).

Common Pitfall: Confusing Two Squared Distances

A common error is to replace \(x^2+y^2\) by \(\rho^2\). That would give

$$ \text{Incorrect:}\qquad x^2+y^2=\rho^2. $$

The mistake is that \(\rho^2\) represents \(x^2+y^2+z^2\), not just the part from \(x\) and \(y\). The correct calculation is

$$ x^2+y^2 = \rho^2\sin^2\phi(\cos^2\theta+\sin^2\theta) = \rho^2\sin^2\phi. $$

For a concrete check, choose \(\rho=2\), \(\phi=\frac{\pi}{3}\), and \(\theta=0\). Then \(x=2\sin(\frac{\pi}{3})=\sqrt{3}\) and \(y=0\), so \(x^2+y^2=3\). The correct spherical expression gives \(4\sin^2(\frac{\pi}{3})=3\), while the incorrect expression \(\rho^2\) gives \(4\).

A different pitfall is to transform the function but forget the volume factor. If \(f\) becomes \(g(\rho,\phi,\theta)\), then the spherical integrand is \(g(\rho,\phi,\theta)\rho^2\sin\phi\), not merely \(g(\rho,\phi,\theta)\). Keep the substitution and the volume element as separate steps so neither is lost.

When a Transformed Expression Is Undefined

Simplification can make an expression look defined at points where the original function was not defined. For example, the quotient in the third worked example is undefined at \(\rho=0\), even though the simplified expression \(\sin^2\phi\) has a value there for any chosen \(\phi\). The spherical coordinates at the origin do not specify a unique pair of angles, and the original quotient still has denominator zero at that point.

Similarly, \(x^2+y^2=\rho^2\sin^2\phi\) vanishes on the \(z\)-axis. A quotient with \(x^2+y^2\) in the denominator is therefore undefined on that axis. Before using a simplified quotient in an integral, identify where its original denominator is zero and make sure the domain and the intended integral account for that issue.

Summary

To transform a Cartesian integrand, substitute the spherical formulas for each coordinate and simplify using trigonometric identities. In particular,

$$ x^2+y^2=\rho^2\sin^2\phi,\qquad x^2+y^2+z^2=\rho^2, $$

and nonnegative integer monomials follow the rule

$$ x^a y^b z^c = \rho^{a+b+c}\sin^{a+b}\phi\cos^c\phi \cos^a\theta\sin^b\theta. $$

For a triple integral, multiply the transformed function by \(\rho^2\sin\phi\). Check cancellations in quotients against the original domain, and verify unfamiliar substitutions by plugging in a simple coordinate point.

Check Your Understanding

For each question, distinguish the transformed function from the full integrand that includes the volume element.

  1. Rewrite \(x^2+y^2\) and \(x^2+y^2+z^2\) in spherical coordinates. Why are the results different?
  2. Rewrite \(x^2yz\) in spherical coordinates, showing the power contributed by each coordinate.
  3. Transform \(z^2/(x^2+y^2+z^2)\) and then include the volume factor.
  4. What is the error in replacing \(x^2+y^2\) by \(\rho^2\)? Give the correct expression.
  5. Where is \(1/(x^2+y^2)\) undefined in Cartesian coordinates, and what condition on \(\rho\) and \(\phi\) describes that set in spherical coordinates?