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.

01

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.
0 or 1 weak itemsContinue with this chapter.
2 weak itemsRedo the Derivatives ladder; partials are ordinary derivatives with passengers held fixed.
3 or more weak itemsStep back to Derivatives and Integrals.
02

The core idea

Hold everything else still, wiggle one variable: that is a partial derivative.

df = (∂f/∂x)dx + (∂f/∂y)dy

The 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 skill works when: you can name what is held constant, and the changes are small enough for linearization.
The skill breaks down when: the held-constant variables secretly depend on the wiggled one; then you need the multivariable chain rule, not a plain partial.
The concept. A two-variable function is a landscape. Contours are level curves; the gradient is the compass that always points straight uphill.
03

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)dz

This 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 dAV ρ dV

7.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.

04

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.

Figure 1. The governing model: a closed piston-cylinder with two simultaneous disturbances. Estimated result: dP ≈ +0.45 kPa.
  1. ProblemEstimate dP for the disturbances in Figure 1.
  2. 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.
  3. AssumptionsIdeal gas; changes small enough for linearization; mass constant.
  4. ModelTotal differential: each input's sensitivity times its change, summed.
  5. Equations∂P/∂T = mR/V ∂P/∂V = −mRT/V² dP = (∂P/∂T)dT + (∂P/∂V)dV
  6. 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.
  7. 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.
  8. 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).
Result. dP ≈ +449 Pa (exact: +443 Pa). Temperature effect +1794 Pa, volume effect −1345 Pa.
04b

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.

  1. Given / findClosed cylinder, fixed volume V = πr²h = 1.0 m³. Minimise the surface area A = 2πr² + 2πrh.
  2. Use the constraint to remove a variableFrom the volume, h = V/(πr²). Substitute it: A(r) = 2πr² + 2V/r.
  3. Set the derivative to zerodA/dr = 4πr − 2V/r² = 0, so r³ = V/(2π).
  4. Solver = (1.0/2π)1/3 = 0.542 m, and h = V/(πr²) = 1.084 m. Note that h = 2r exactly.
  5. Confirm a minimumd²A/dr² = 4π + 4V/r³ > 0 for every r > 0, so the stationary point is a minimum.
  6. AreaA = 2π(0.542²) + 2π(0.542)(1.084) = 1.85 + 3.69 = 5.54 m².
  7. 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.
  8. ConclusionSubstitute the constraint, differentiate, set to zero, verify the second derivative. This four-step routine sizes pressure vessels, packaging, and any minimum-material design.
Result. r = 0.542 m, h = 1.084 m (h = 2r), A = 5.54 m².
05

Misconceptions and diagnostics

MistakeSymptomDiagnostic questionCorrection
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 partialMinimum 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 blindlyRegion integrated twice or not at all"Did I sketch the region first?"Always sketch the area; limits come from the picture, not from habit.
06

Practice ladder

Level 1 · Direct skill

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.

Level 2 · Mixed concept

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%.

Level 3 · Independent problem

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.

Level 4 · Transfer to real engineering

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."

07

Working with AI, and proving it yourself

Use AI as an examiner, not a solver

"Here are my partials for this three-variable formula. Check only the held-constant bookkeeping, not the algebra."
"Give me a contour map description; I will state the gradient direction and sign at three points, then you grade."
"Find the optimum of this function." Setting up ∇f = 0 with a constraint is the design skill.
"Differentiate with respect to everything." Knowing which sensitivity matters is the engineering judgment.

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.

Must include: the total-differential estimate against an exact recomputation, with the percent error of the linearization stated.
08

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.

TodayFinish this quiz and Levels 1 and 2 of the ladder.
+1 dayRe-solve the gas example, then the exact check.
+3 daysOne constrained optimization (Level 3 style) with new numbers.
+7 daysMixed set: a partial-sensitivity estimate plus a Integrals problem.
+30 daysReuse the total differential as uncertainty propagation in Statistics and Uncertainty.
09

Textbook mapping

ItemMapping
Main sourcesStewart, Calculus: Early Transcendentals (partial derivatives, multiple integrals, and optimization chapters)
Core topics7.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 connectionThermodynamics (property relations), Fluids and Heat Transfer (fields), Design optimization, Statistics and Uncertainty (uncertainty propagation).
Skip on first passJacobians and change of variables, surface parameterization theory, second-derivative tests in full generality.
Read nextVector Calculus.