MATH-209 · Lesson 6 of 12 · 34 min

Change of variables and applications of multiple integrals

Lesson 5 evaluated double and triple integrals in rectangular, polar, cylindrical and spherical coordinates, and used them for mass, centroids and the second moment of area. This lesson completes the picture. It shows that polar, cylindrical and spherical coordinates are special cases of a general change of variables governed by the Jacobian determinant, which lets any suitable region be mapped to a simple one. It then applies multiple integrals to three more engineering questions: the force and center of pressure of water on a dam gate, the mass moment of inertia of rotating parts such as flywheels, and probabilities for two random quantities at once, such as positioning errors in two directions. It ends with Monte Carlo integration, the numerical method that handles integrals in awkward shapes and many dimensions.

The Jacobian and change of variables

In one variable, substitution \(x = g(u)\) changes \(dx\) into \(g'(u)\,du\): the derivative measures how much a small interval is stretched. In two variables, a transformation \(x = x(u, v)\), \(y = y(u, v)\) maps a small rectangle \(du \times dv\) in the uv-plane to a small, nearly parallelogram-shaped patch in the xy-plane. Its area is \(|J|\,du\,dv\), where J is the Jacobian determinant:

\[J = \frac{\partial(x, y)}{\partial(u, v)} = \begin{vmatrix} \partial x/\partial u & \partial x/\partial v \\ \partial y/\partial u & \partial y/\partial v \end{vmatrix}\]

This is the determinant of the matrix of the linear approximation, and MATH-125 shows that a determinant measures how a linear map scales area. The change of variables formula follows:

\[\iint_R f(x, y)\,dA = \iint_S f\big(x(u, v), y(u, v)\big)\,|J|\,du\,dv\]

where S is the region in the uv-plane that maps onto R. For polar coordinates, \(x = r\cos\theta\), \(y = r\sin\theta\), the Jacobian is \(\cos\theta \cdot r\cos\theta - (-r\sin\theta)\sin\theta = r\), which is where the familiar \(r\,dr\,d\theta\) comes from. In three dimensions the Jacobian is a 3 × 3 determinant; for spherical coordinates it is \(\rho^2\sin\phi\).

Left: a rectangular grid in the u v plane with one small cell shaded, of size du by dv. An arrow labeled x equals x of u v, y equals y of u v leads to the right: the same grid mapped onto a curved region in the x y plane, where the shaded cell has become a small curved parallelogram with area J du dv.
A change of variables maps small rectangles to small parallelograms whose area is |J| du dv.

Worked problem

The area of an ellipse

Use the substitution \(x = au\), \(y = bv\) to find the area inside the ellipse \(x^2/a^2 + y^2/b^2 = 1\).

Show solution
  1. The ellipse maps to the unit disc \(u^2 + v^2 \le 1\).
  2. Jacobian: \(\begin{vmatrix} a & 0 \\ 0 & b \end{vmatrix} = ab\).
  3. Area \(= \iint_{\text{disc}} ab\,du\,dv = ab \times \pi\).

Answer: πab. The ellipse is a circle stretched by a in one direction and b in the other, so its area is stretched by ab.

Worked problem

A slanted region

Evaluate \(\iint_R (x + y)\,dA\) over the parallelogram bounded by \(x + y = 0\), \(x + y = 2\), \(x - y = 0\) and \(x - y = 4\).

Show solution
  1. Let \(u = x + y\) and \(v = x - y\). The region becomes the rectangle \(0 \le u \le 2\), \(0 \le v \le 4\).
  2. Inverting: \(x = (u + v)/2\), \(y = (u - v)/2\), so \(J = \begin{vmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{vmatrix} = -\tfrac{1}{2}\) and \(|J| = \tfrac{1}{2}\).
  3. \(\int_0^4\int_0^2 u \cdot \tfrac{1}{2}\,du\,dv = \tfrac{1}{2} \times 2 \times 4 = 4\).

Answer: 4. Choosing new variables that match the boundary lines turned a region needing several pieces in x and y into a single rectangle.

Hydrostatic force on a submerged surface

Water pressure increases with depth, \(p = \rho g h\), so the force on a submerged gate or wall is an integral of pressure over its area, and the force acts lower than the centroid. For a plane vertical surface with depth h measured downward from the free surface:

\[F = \iint_A \rho g h\,dA = \rho g\,\bar{h}\,A, \qquad h_{cp} = \frac{\iint_A h^2\,dA}{\iint_A h\,dA} = \bar{h} + \frac{I_c}{\bar{h}A}\]

Here \(\bar{h}\) is the depth of the centroid and \(I_c\) the second moment of area about a horizontal axis through the centroid (Lesson 5). The second form uses the parallel axis theorem. The depth \(h_{cp}\) of the center of pressure is where a single equivalent force would act, which sets the moment that hinges and actuators must resist.

Worked problem

A sluice gate

A vertical rectangular gate 2.0 m wide and 3.0 m high has its top edge 1.0 m below the water surface. Find the force on it and the depth of the center of pressure (ρg = 9.81 kN/m³).

Show solution
  1. Centroid depth \(\bar{h} = 1.0 + 1.5 = 2.5\) m; area \(A = 6.0\) m².
  2. \(F = 9.81 \times 2.5 \times 6.0 = 147\) kN.
  3. \(I_c = bh^3/12 = 2.0 \times 3.0^3/12 = 4.5\) m⁴, so \(h_{cp} = 2.5 + 4.5/(2.5 \times 6.0) = 2.8\) m.

Answer: A force of 147 kN acting 2.8 m below the surface, 0.3 m below the centroid. A hinge at the top of the gate must resist a moment of 147 × 1.8 = 265 kN·m. The deeper the gate, the closer the center of pressure moves to the centroid, because the pressure becomes more uniform across it.

Side view of a vertical gate in a water channel, with the water surface 1 meter above its top edge. A trapezoidal pressure distribution grows linearly with depth along the gate. The resultant force of 147 kilonewtons is drawn as an arrow at the center of pressure, 2.8 meters below the surface, slightly below the centroid at 2.5 meters.
Pressure on a submerged gate rises with depth, so the resultant acts below the centroid.

Mass moments of inertia

The resistance of a body to angular acceleration about an axis is its mass moment of inertia, the integral of mass times squared distance from the axis:

\[I = \iiint_E r_\perp^2\,\rho\,dV\]

It plays the role of mass in rotation: torque equals \(I\alpha\), and kinetic energy is \(\tfrac{1}{2}I\omega^2\). It differs from the second moment of area of Lesson 5, which is a property of a cross-section used in bending, although the integrals look alike.

Worked problem

A flywheel

A solid steel disc (ρ = 7850 kg/m³) has radius 0.30 m and thickness 0.050 m. Find its moment of inertia and the energy it stores at 3000 rpm.

Show solution
  1. In cylindrical coordinates: \(I = \int_0^{0.05}\int_0^{2\pi}\int_0^{R} r^2\,\rho\,r\,dr\,d\theta\,dz = \rho \times 0.05 \times 2\pi \times R^4/4 = \tfrac{1}{2}MR^2\).
  2. \(M = \rho\pi R^2t = 7850 \times \pi \times 0.09 \times 0.05 = 111\) kg, so \(I = 0.5 \times 111 \times 0.09 = 4.99\) kg·m².
  3. \(\omega = 3000 \times 2\pi/60 = 314\) rad/s; energy \(\tfrac{1}{2}I\omega^2 = 0.5 \times 4.99 \times 314^2 = 246\) kJ.

Answer: I = 4.99 kg·m², storing 246 kJ (about 0.07 kWh). Because I depends on r², putting the mass at the rim (a ring rather than a disc) stores up to twice as much energy for the same mass, which is why flywheels and pulleys often have heavy rims and thin webs.

Composite parts and the parallel axis theorem

Machine parts are usually built from simple shapes, and their moments of inertia add, as long as all are taken about the same axis. For a piece whose own centroidal moment is \(I_c\) but which sits a distance d from the axis of rotation, the parallel axis theorem gives \(I = I_c + Md^2\), the mass version of the theorem used for areas in Lesson 5. It follows from expanding \(r_\perp^2\) about the centroid: the cross term integrates to zero because the first moment about the centroid vanishes.

Worked problem

A crank with a counterweight

A crank consists of a slender steel arm of mass 2.0 kg and length 0.30 m, pivoting about one end, and a compact 3.0 kg counterweight centered 0.25 m from the pivot, with its own centroidal moment of 0.004 kg·m². Find the moment of inertia about the pivot.

Show solution
  1. Arm: a slender rod about one end has \(I = \tfrac{1}{3}mL^2 = \tfrac{1}{3}(2.0)(0.30)^2 = 0.060\) kg·m².
  2. Counterweight: \(I = 0.004 + 3.0 \times 0.25^2 = 0.192\) kg·m².

Answer: I = 0.060 + 0.192 = 0.252 kg·m². The counterweight dominates because of the d² term: mass far from the axis costs far more inertia than mass near it.

Probability in two variables

If two random quantities X and Y have a joint probability density \(f(x, y)\), the probability that the pair falls in a region R is the double integral of f over R, and the density integrates to 1 over the whole plane. Expected values are integrals too: \(E[g(X, Y)] = \iint g\,f\,dA\). STAT-235 develops these ideas; here the point is that the methods of Lessons 5 and 6 apply directly.

The most famous example needs polar coordinates. The integral \(I = \int_{-\infty}^{\infty} e^{-x^2}dx\) has no elementary antiderivative, but its square is a double integral over the plane:

\[I^2 = \iint e^{-(x^2 + y^2)}\,dA = \int_0^{2\pi}\int_0^\infty e^{-r^2}\,r\,dr\,d\theta = 2\pi \cdot \tfrac{1}{2} = \pi\]

So \(I = \sqrt{\pi}\), which is the normalizing constant of the normal distribution, the most widely used model of measurement error.

Worked problem

Positioning accuracy

A drilling robot places holes with independent normal errors of standard deviation σ = 0.10 mm in x and in y. What radius contains 95% of the holes?

Show solution
  1. The joint density is \(\dfrac{1}{2\pi\sigma^2}e^{-(x^2 + y^2)/(2\sigma^2)}\), which depends only on r.
  2. Probability within radius a: \(\int_0^{2\pi}\int_0^a \dfrac{1}{2\pi\sigma^2}e^{-r^2/(2\sigma^2)}\,r\,dr\,d\theta = 1 - e^{-a^2/(2\sigma^2)}\).
  3. Setting this to 0.95: \(a = \sigma\sqrt{2\ln 20} = 2.45\sigma = 0.245\) mm.

Answer: A radius of 0.245 mm, about 2.45σ, not the 1.96σ that applies in one dimension. Positioning specifications for robots, CNC machines and GPS receivers quote such radial figures; the radius containing 50% (1.18σ) is called the circular error probable.

Monte Carlo integration

For awkward shapes or integrals in many dimensions, nested integration becomes impractical. Monte Carlo integration estimates an integral by random sampling: scatter N random points uniformly through a simple box of volume \(V_{box}\) that contains the region, and count the fraction that fall inside. The volume is approximately that fraction times \(V_{box}\), and an integral of f is approximately \(V_{box}\) times the average of f over the points that land inside (counting f as zero outside). The error falls only as \(1/\sqrt{N}\), slowly, but independently of the number of dimensions, which is why the method dominates in radiation transport, financial risk and reliability analysis.

Monte Carlo estimates of the volume common to two perpendicular cylinders of radius 1, compared with the exact value 16/3.
import numpy as np

rng = np.random.default_rng(1)
exact = 16 / 3   # volume common to two perpendicular cylinders of radius 1

for n in [1_000, 100_000, 10_000_000]:
    p = rng.uniform(-1, 1, size=(n, 3))          # box from -1 to 1 in each direction
    inside = (p[:, 0]**2 + p[:, 2]**2 <= 1) & (p[:, 1]**2 + p[:, 2]**2 <= 1)
    estimate = 8 * inside.mean()                 # box volume times fraction inside
    print(f"N = {n:>10,}: volume = {estimate:.4f}, error = {abs(estimate - exact):.4f}")
print(f"Exact value: {exact:.4f}")
Output
N =      1,000: volume = 5.2800, error = 0.0533
N =    100,000: volume = 5.3373, error = 0.0039
N = 10,000,000: volume = 5.3326, error = 0.0007
Exact value: 5.3333

The exact value, 16/3, can be found with a careful triple integral, but the Monte Carlo estimate needed no thought about limits of integration. Multiplying the number of samples by 100 cuts the typical error by a factor of about 10, as the \(1/\sqrt{N}\) rule predicts; individual runs vary, because the error is itself random.

Common mistakes

  • MistakeForgetting the Jacobian when changing variables.

    InsteadReplace dA by |J| du dv (for polar, r dr dθ).

  • MistakeUsing a signed Jacobian.

    InsteadArea scaling uses the absolute value |J|.

  • MistakePlacing the hydrostatic force at the centroid.

    InsteadIt acts at the center of pressure, I_c/(h̄A) below the centroid.

  • MistakeConfusing mass moment of inertia with second moment of area.

    InsteadMass moment (kg·m²) governs rotation; second moment of area (m⁴) governs bending.

  • MistakeExpecting Monte Carlo error to fall as 1/N.

    InsteadIt falls as 1/√N; quadrupling the samples halves the error.

Summary and key terms

  • A change of variables multiplies the integrand by the absolute Jacobian determinant |∂(x, y)/∂(u, v)|.
  • Polar, cylindrical and spherical coordinates are special cases, with Jacobians r, r and ρ² sin φ.
  • Hydrostatic force on a plane surface is ρg h̄ A, acting at depth h̄ + I_c/(h̄A).
  • Mass moment of inertia I = ∫ r² dm; a solid disc has I = ½MR².
  • Joint densities give probabilities as double integrals; ∫e^(−x²) dx = √π via polar coordinates.
  • For two independent normal errors, 95% fall within 2.45σ of the target.
  • Monte Carlo integration samples randomly, with error proportional to 1/√N in any dimension.
Jacobian determinant
The determinant of partial derivatives of a transformation, giving its local area or volume scaling.
Change of variables
Rewriting a multiple integral in new coordinates.
Center of pressure
The point where the resultant hydrostatic force acts.
Parallel axis theorem
I = I_c + Ad², relating second moments about parallel axes.
Mass moment of inertia
The integral of mass times squared distance from an axis.
Joint probability density
A function whose integral over a region gives the probability of falling in it.
Circular error probable
The radius containing half of two-dimensional positioning errors.
Monte Carlo integration
Estimating an integral by averaging over random samples.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Find the Jacobian of \(x = 2u + v\), \(y = u - v\).

    Show answer

    (2)(−1) − (1)(1) = −3; |J| = 3.

  2. Find the area of the ellipse \(x^2/9 + y^2/4 \le 1\).

    Show answer

    6π.

  3. Verify that the spherical Jacobian gives the volume of a sphere of radius a.

    Show answer

    ∫₀^{2π}∫₀^π∫₀^a ρ² sin φ dρ dφ dθ = (4/3)πa³.

  4. A square gate 2 m × 2 m has its top edge at the water surface. Find the force.

    Show answer

    h̄ = 1 m: F = 9.81 × 1 × 4 = 39.2 kN.

  5. Where does that force act?

    Show answer

    h_cp = 1 + (2 × 8/12)/(1 × 4) = 1.33 m, two-thirds of the depth.

  6. Find I for a thin ring of mass M and radius R about its axis.

    Show answer

    MR².

  7. What energy does the flywheel example store at 1500 rpm?

    Show answer

    One quarter: about 62 kJ.

  8. For σ = 2 m GPS errors in each direction, what radius contains 50% of fixes?

    Show answer

    σ√(2 ln 2) = 1.18σ = 2.35 m.

  9. Evaluate \(\iint_{x^2 + y^2 \le 1} e^{-(x^2 + y^2)}\,dA\).

    Show answer

    π(1 − e⁻¹) = 1.99.

  10. A Monte Carlo estimate has error 0.02 with 10 000 samples. About how many samples give error 0.002?

    Show answer

    1 000 000.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz