Math for ME · Chapter 7 of 19 · Intermediate
Multivariable Calculus
Real engineering quantities depend on several variables at once. Partial derivatives ask the only honest question: what changes if I move just one?
The thread: So far one input drives one output. Real quantities depend on several things at once, so the derivative grows up into the partial derivative and the gradient.
Readiness check
From Derivatives and Integrals. Tick only what you can do closed-notes.
- Differentiate single-variable functions fluently, chain rule included.
- Evaluate definite integrals with substitution.
- Use linearization Δy ≈ (dy/dx)Δx with units.
- Read contour-style plots (weather maps count).
- Work a formula with three or more symbols without panic.
The core idea
Hold everything else still, wiggle one variable: that is a partial derivative.
df = (∂f/∂x)dx + (∂f/∂y)dyThe total differential (above) combines the one-at-a-time sensitivities into the full effect of small changes. The gradient ∇f packs the partials into a vector that points uphill, perpendicular to the contours. Optimization means finding where it vanishes.
The skills, taught in order
7.1 Partial derivatives: hold the others fixed
A partial derivative differentiates with respect to one variable while every other is treated as a constant. For P = mRT/V, the temperature sensitivity is ∂P/∂T = mR/V (V held fixed) and the volume sensitivity is ∂P/∂V = −mRT/V² (T held fixed). Always record what is held constant; thermodynamics writes it as a subscript, (∂P/∂T)V.
7.2 The total differential
When several inputs change at once, their effects add to first order:
df = (∂f/∂x)dx + (∂f/∂y)dy + (∂f/∂z)dzThis is the multivariable version of linearisation, and it is the engine behind thermodynamic property relations and the uncertainty propagation of Statistics and Uncertainty. The multivariable chain rule extends it to the case where x, y, z themselves depend on a common variable such as time.
7.3 The gradient and directional derivative
The gradient collects the partials into a vector:
∇f = (∂f/∂x, ∂f/∂y, ∂f/∂z)It points in the direction of steepest increase and is perpendicular to the level surfaces. The rate of change along any unit direction u is the projection ∇f·u, which is largest exactly when u points along the gradient.
7.4 Multiple integrals
A double or triple integral sums a quantity over an area or a volume: the volume under a surface, the mass of a plate of varying density, or the area moments behind centroids and second moments of area. The integrand is the physical density of one slice; the limits come from a sketch of the region, never from habit.
∬R f dA∭V ρ dV7.5 Optimisation, with and without constraints
An interior optimum sits where every partial is zero, that is where ∇f = 0; a second-order check then separates maximum from minimum. With a constraint g = 0, the optimum is where the two gradients are parallel, ∇f = λ∇g (a Lagrange multiplier), which lets you optimise without eliminating variables.
Engineering connection: Thermodynamics, Fluid Mechanics, Heat Transfer, Optimization, Design.
Worked example: gas pressure sensitivity by total differential
Air (m = 1 kg, R = 287 J/(kg·K)) sits in a cylinder at T = 300 K and V = 0.8 m³, so P = mRT/V. The gas warms by 5 K while the piston lets the volume grow by 0.01 m³. Estimate the pressure change without recomputing from scratch.
- ProblemEstimate dP for the disturbances in Figure 1.
- Given / findP = mRT/V; m = 1 kg, R = 287, T = 300 K, V = 0.8 m³; dT = +5 K, dV = +0.01 m³. Find dP.
- AssumptionsIdeal gas; changes small enough for linearization; mass constant.
- ModelTotal differential: each input's sensitivity times its change, summed.
- Equations∂P/∂T = mR/V ∂P/∂V = −mRT/V² dP = (∂P/∂T)dT + (∂P/∂V)dV
- SolveP = 287 × 300/0.8 = 107 625 Pa. ∂P/∂T = 287/0.8 = 358.8 Pa/K; ∂P/∂V = −107 625/0.8 = −134 531 Pa/m³. dP = 358.8(5) − 134 531(0.01) = 1794 − 1345 = +449 Pa ≈ +0.45 kPa.
- CheckExact recomputation: P = 287 × 305/0.81 = 108 068 Pa, a change of +443 Pa. The linear estimate of 449 Pa is within 1.4%. Signs make sense: warming raises P, expansion lowers it; warming won.
- ConclusionThe total differential answers the design question "which input matters more?" in one line: here the 5 K warming and the 1.25% expansion nearly cancel. This is the exact machinery behind thermodynamic property relations and uncertainty propagation (Statistics and Uncertainty).
Worked example 2: the least-material tank
A closed cylindrical tank must hold V = 1.0 m³. Find the radius and height that use the least sheet metal, and show the result is a minimum.
- Given / findClosed cylinder, fixed volume V = πr²h = 1.0 m³. Minimise the surface area A = 2πr² + 2πrh.
- Use the constraint to remove a variableFrom the volume, h = V/(πr²). Substitute it: A(r) = 2πr² + 2V/r.
- Set the derivative to zerodA/dr = 4πr − 2V/r² = 0, so r³ = V/(2π).
- Solver = (1.0/2π)1/3 = 0.542 m, and h = V/(πr²) = 1.084 m. Note that h = 2r exactly.
- Confirm a minimumd²A/dr² = 4π + 4V/r³ > 0 for every r > 0, so the stationary point is a minimum.
- AreaA = 2π(0.542²) + 2π(0.542)(1.084) = 1.85 + 3.69 = 5.54 m².
- CheckThe classic result for a closed cylinder is height equal to diameter, h = 2r; the numbers obey it. A shape much taller or much flatter than this wastes material.
- ConclusionSubstitute the constraint, differentiate, set to zero, verify the second derivative. This four-step routine sizes pressure vessels, packaging, and any minimum-material design.
Misconceptions and diagnostics
| Mistake | Symptom | Diagnostic question | Correction |
|---|---|---|---|
| Forgetting what is held constant | ∂P/∂T computed while V silently changes too | "Which variables am I freezing for this partial?" | Write the held-constant list next to every partial, like thermodynamics does: (∂P/∂T)V. |
| Treating the gradient as a contour direction | "Steepest path" drawn along a level curve | "Does f change along a contour?" | No: contours are constant-f. The gradient is perpendicular to them. |
| Claiming an optimum from one partial | Minimum found in x while y still slopes | "Is every partial zero here?" | An interior optimum needs the whole gradient to vanish, then a second-order check. |
| Double integral limits copied blindly | Region integrated twice or not at all | "Did I sketch the region first?" | Always sketch the area; limits come from the picture, not from habit. |
Practice ladder
f(x, y) = x²y + 3y². Find both partials and evaluate them at (2, 1).
Show answer
∂f/∂x = 2xy = 4; ∂f/∂y = x² + 6y = 10.
Then for g(x, y) = ex sin y, find both partials.
Show answer
∂g/∂x = ex sin y; ∂g/∂y = ex cos y. Each partial differentiates one variable while holding the other constant.
For the same f, write the gradient at (2, 1) and the rate of change in the direction u = (0.6, 0.8).
Show answer
∇f = (4, 10). Directional derivative = ∇f·u = 2.4 + 8 = 10.4. Steepest rate would be |∇f| = √116 ≈ 10.8, so this direction is nearly optimal.
A rectangle is measured as 50 mm by 30 mm, each to ±0.5 mm. Use the total differential to estimate the uncertainty in its area.
Show answer
A = xy, so dA = y dx + x dy = 30(0.5) + 50(0.5) = 40 mm². The area is 1500 ± 40 mm², about ±2.7%.
A rectangular tray with open top must hold 4000 cm³ with a square base (side a, height h). Use the constraint to eliminate h and minimize the sheet-metal area A = a² + 4ah.
Show answer
h = 4000/a², so A = a² + 16 000/a. dA/da = 2a − 16 000/a² = 0 gives a³ = 8000, a = 20 cm, h = 10 cm, A = 1200 cm². The classic result: height equals half the base side.
Pick a formula with three inputs from any course (gear stress, pipe flow, heat loss). Compute all three partial sensitivities at a realistic operating point and rank the inputs by influence for a 2% change in each.
What good work looks like
Three partials with units, the three 2%-change contributions compared on one bar, and a sentence such as "diameter enters to the fourth power, so it dominates; control its tolerance first."
Working with AI, and proving it yourself
Use AI as an examiner, not a solver
Portfolio task
Write a one-page sensitivity report for one real formula (the worked example's gas law counts): operating point, all partials with units, a tornado-style ranking of input influences for stated tolerances, and one design recommendation.
Retrieval and spaced review
Closed notes. Answer out loud, then reveal.
1. Define a partial derivative in one sentence.
The rate of change of a multivariable function as one input varies and all others are held constant.
2. Write the total differential for f(x, y) and say what it is for.
df = (∂f/∂x)dx + (∂f/∂y)dy: the linear estimate of the change in f from small changes in both inputs.
3. What two geometric facts define the gradient?
It points in the steepest-ascent direction and is perpendicular to the level curves (contours).
4. What does a double integral compute, physically?
A total over an area: volume under a surface, mass of a plate, or the area moments used for centroids and inertia.
5. What is the idea of a Lagrange multiplier?
At a constrained optimum the gradients of the objective and the constraint are parallel: ∇f = λ∇g. Optimize without eliminating variables.
Textbook mapping
| Item | Mapping |
|---|---|
| Main sources | Stewart, Calculus: Early Transcendentals (partial derivatives, multiple integrals, and optimization chapters) |
| Core topics | 7.1 Several variables · 7.2 Partials · 7.3 Total differential · 7.4 Multivariable chain rule · 7.5 Gradient · 7.6 Directional derivative · 7.7 Multiple integrals · 7.8 Mass, centroid, inertia integrals · 7.9 Optimization · 7.10 Lagrange multipliers (intro) |
| Engineering connection | Thermodynamics (property relations), Fluids and Heat Transfer (fields), Design optimization, Statistics and Uncertainty (uncertainty propagation). |
| Skip on first pass | Jacobians and change of variables, surface parameterization theory, second-derivative tests in full generality. |
| Read next | Vector Calculus. |