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 centre 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:
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:
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\).
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
- The ellipse maps to the unit disc \(u^2 + v^2 \le 1\).
- Jacobian: \(\begin{vmatrix} a & 0 \\ 0 & b \end{vmatrix} = ab\).
- 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
- Let \(u = x + y\) and \(v = x - y\). The region becomes the rectangle \(0 \le u \le 2\), \(0 \le v \le 4\).
- 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}\).
- \(\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:
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 centre 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 centre of pressure (ρg = 9.81 kN/m³).
Show solution
- Centroid depth \(\bar{h} = 1.0 + 1.5 = 2.5\) m; area \(A = 6.0\) m².
- \(F = 9.81 \times 2.5 \times 6.0 = 147\) kN.
- \(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 centre of pressure moves to the centroid, because the pressure becomes more uniform across it.
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:
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
- 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\).
- \(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².
- \(\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 centred 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
- 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².
- 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:
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
- The joint density is \(\dfrac{1}{2\pi\sigma^2}e^{-(x^2 + y^2)/(2\sigma^2)}\), which depends only on r.
- 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)}\).
- 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.
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}")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 centre 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.
- Centre 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.
Find the Jacobian of \(x = 2u + v\), \(y = u - v\).
Show answer
(2)(−1) − (1)(1) = −3; |J| = 3.
Find the area of the ellipse \(x^2/9 + y^2/4 \le 1\).
Show answer
6π.
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³.
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.
Where does that force act?
Show answer
h_cp = 1 + (2 × 8/12)/(1 × 4) = 1.33 m, two-thirds of the depth.
Find I for a thin ring of mass M and radius R about its axis.
Show answer
MR².
What energy does the flywheel example store at 1500 rpm?
Show answer
One quarter: about 62 kJ.
For σ = 2 m GPS errors in each direction, what radius contains 50% of fixes?
Show answer
σ√(2 ln 2) = 1.18σ = 2.35 m.
Evaluate \(\iint_{x^2 + y^2 \le 1} e^{-(x^2 + y^2)}\,dA\).
Show answer
π(1 − e⁻¹) = 1.99.
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.
Create a free account to save your progress, take quizzes and earn a certificate.