Many inputs, many outputs
A hiker on the slopes of Kilimanjaro stands at a point of a map; her altitude is a function . Which way is steepest? How steep is it? A cooperative in Bangladesh wants the largest yield from fields of fixed total perimeter. A hydrologist in the Netherlands wants the total water flowing out through the surface of a region of soil. A physicist wants to know whether a force field can be described by a potential energy.
Each question involves a function of several variables — and each needs a new idea. With one variable, the derivative is a number and the integral is over an interval. With several, the derivative becomes a linear map (a matrix), optimisation must handle constraints, integrals run over regions, curves and surfaces, and the fundamental theorem of calculus grows into a family of theorems — Green's, Stokes's and Gauss's — relating the inside of a region to its boundary.
This lesson assumes calculus of one variable and linear algebra (matrices, determinants, linear maps). We write for the Euclidean length of and for the dot product.
Slices, tangent planes and boundaries
A function has a graph, a surface in space, and level curves , like the contour lines on a map. Freeze and you get a function of alone, whose slope is the partial derivative ; freezing gives . But slices along two directions do not see the whole surface. The right notion is that, near a point, the surface looks like a plane: the derivative is the best linear approximation,
where is a linear map — for , an matrix of partial derivatives.
For integrals, the picture is "chop into small pieces and add". The new difficulty is that the natural pieces (polar rectangles, small patches on a curved surface) are distorted copies of squares, and the distortion factor — a Jacobian determinant — must be included. Finally, the one-variable theorem says the integral of a derivative over an interval is determined by the boundary points . In higher dimensions the same is true for regions, with "derivative" meaning curl or divergence and the boundary a curve or a surface.
Definitions
Let be open (every point of has a ball around it inside ), and . Limits and continuity are defined as in one variable, with the Euclidean length.
Definition— partial and directional derivatives
The partial derivative of with respect to at is , where is the -th standard basis vector. More generally, for the directional derivative is .
Definition— derivative (total or Fréchet derivative)
is differentiable at if there is a linear map such that
that is, . Then is the derivative of at (it is unique). Its matrix is the Jacobian matrix , an matrix; when , is the Jacobian determinant.
Definition— gradient
For a real-valued differentiable , the gradient is the vector with for all .
is of class on if all partial derivatives exist and are continuous on ; if the second partials are too. The Hessian of a function is the symmetric matrix , and is a critical point if .
Definition— line integral
Let be a path and a continuous vector field on its image. The line integral (work, or circulation if is closed) is
is conservative on if for some function (a potential; physicists often use ).
Definition— divergence and curl
For a field , the divergence is . In the curl is
and in , for , the scalar curl is .
Definition— surface integral and flux
A parametrised surface is a map , , with in the interior of . The flux of a continuous field through it, in the direction of the normal , is
and the area of is .
Multiple integrals over rectangles are defined by Riemann sums exactly as in one variable, and over a bounded region by integrating over a rectangle containing ; a continuous function on a closed bounded region with a reasonable boundary (for example, a piecewise curve) is integrable.
Worked examples and a warning
Example— A Jacobian matrix and a directional derivative
Let . Then
For the real-valued at : . In the unit direction , , while the steepest rate is , in the direction .
Example— Partial derivatives are not enough
Let for and . On both axes , so . But on the diagonal for every . So is not continuous at the origin, and therefore not differentiable there (a differentiable function is continuous, by the same argument as in one variable). The partial derivatives see only two directions; differentiability is a statement about all of them at once, uniformly.
Even existence of every directional derivative is not enough: (with ) has a directional derivative in every direction , but , so is discontinuous at .
Example— Classifying critical points
has , so the critical points are . The Hessian is : at it is positive definite (a local minimum, ); at it has eigenvalues and (a saddle point). There is no global minimum: as .
The derivative and the chain rule
Theorem— Proposition (what differentiability gives)
If is differentiable at , then is continuous at , every directional derivative exists and , and the matrix of is the Jacobian matrix of partial derivatives.
Proof
Write with . Then , where is the operator norm. For and ,
Taking shows that the -th column of the matrix of is .
∎
Theorem— Theorem (continuous partials imply differentiability)
If all partial derivatives of exist near and are continuous at , then is differentiable at . (Apply this to each component when .)
Proof
We give the proof for ; the general case adds one coordinate at a time in the same way. Write and small. Change one coordinate at a time:
By the one-variable mean value theorem, the first bracket is for a point on the segment from to , and the second is for a point between and . Hence
using . As , both and tend to , and the right side tends to by continuity of the partials at .
∎
Theorem— Theorem (chain rule)
If is differentiable at and is differentiable at (with , open), then is differentiable at and
Proof
Let and , and write and with , and . Put . Then
First, . Second, for small we have , so . Given , choose with for (this holds for too). For small enough that , . So the error is , and .
∎
Theorem— Proposition (the gradient)
Let be differentiable at with . Among unit vectors , the directional derivative is largest, with value , exactly for . If is a differentiable curve in the level set with , then : the gradient is perpendicular to level sets.
Proof
By Cauchy–Schwarz, , with equality if and only if is a positive multiple of . For the second claim, for all ; differentiating with the chain rule gives .
∎
For functions, the order of differentiation does not matter: (the theorem of Schwarz, or Clairaut; the hypothesis is needed — the function has unequal mixed partials at the origin). Hence the Hessian is symmetric, and second-order Taylor expansion gives the second derivative test: at a critical point of a function, a positive definite Hessian means a strict local minimum, a negative definite one a strict local maximum, and one with eigenvalues of both signs a saddle point.
Constrained optimisation: Lagrange multipliers
To find the extreme values of on a constraint set , we cannot simply set : the extremum is taken along the constraint. The idea, due to Lagrange (1788), is that at a constrained extremum the level curve of must be tangent to the constraint curve.
Maximise xy on the circle x² + y² = 2
Increase c until the hyperbola last touches the circle. At that moment the two curves are tangent.
- level curve xy = c
- constraint x² + y² = 2
- constraint (lower half)
- level curve xy = c: y = 0.5
- constraint x² + y² = 2: y = 1
- constraint (lower half): y = −1
Theorem— Theorem (Lagrange multipliers)
Let be , let satisfy and , and suppose , restricted to , has a local maximum or minimum at . Then there is a number (a Lagrange multiplier) with
Proof
We use the implicit function theorem (proved in real analysis, from the inverse function theorem): since , near the set is a hypersurface, and for every vector with there is a curve in with and .
Take such and . The function has a local extremum at , so its derivative vanishes there: by the chain rule, . Thus is orthogonal to every vector orthogonal to ; that is, .
∎
With several constraints whose gradients at are linearly independent, the same argument gives .
Example— xy on a circle, and the best box
On the circle. Maximise on . The equations give and . If then , which is not on the circle; so and , giving (value ) and (value ). The circle is closed and bounded, so by the extreme value theorem has a maximum and a minimum there, and they must be among these candidates: max 1, min −1. (Independently: since .)
The best box. Maximise the volume of a box with surface area and . The multiplier equations , , force (multiply the first by , the second by , and compare). Here the constraint set is not compact, so existence needs a separate argument: by the AM–GM inequality, , so , with equality for the cube. The multiplier method found the candidate; the inequality proved it optimal.
The multiplier itself has a meaning: if is the optimal value as a function of the constraint level , then (under mild hypotheses) — the "shadow price" of the constraint in economics.
Multiple integrals and change of variables
Theorem— Theorem (Fubini, for continuous functions)
If is continuous on the rectangle , then
The proof (via uniform continuity and Riemann sums) belongs to real analysis; the general version for Lebesgue integrals is a cornerstone of measure theory. Without integrability the conclusion can fail: for on the two iterated integrals are and .
Theorem— Theorem (change of variables)
Let be a map that is one-to-one on an open set with there, and let be a closed bounded region with a reasonable boundary. For continuous on ,
Why the determinant? A linear map multiplies all volumes by (from linear algebra: true for elementary matrices, hence for products). Near a point , is approximately the affine map , so a tiny box of volume at is carried to a region of volume about . Summing over a fine partition gives the formula; making "about" precise is the real work of the proof, done in analysis texts. Points where or fails to be injective may be ignored if they form a set of volume zero — this is what allows polar coordinates, whose Jacobian vanishes at .
Polar coordinates. has
so . Below, the widget shows at acting on the plane: the unit square becomes a parallelogram of area . A tiny polar rectangle of sides and is nearly a rectangle with sides and .
The Jacobian of polar coordinates at r = 2, θ = π/6
Its determinant is r = 2: polar coordinates stretch areas by the factor r.
- image of the grid
- image of the unit square
- image of the flag
- before the transformation
The columns of A are the images of e₁ = (1, 0) and e₂ = (0, 1): Ae₁ = (0.866, 0.5), Ae₂ = (−1, 1.732)
det A = ad − bc = 2
The unit square (area 1) becomes a parallelogram of area |det A| = 2. Since det A > 0, orientation is preserved.
Invariant lines (real eigenvectors)
λ = 1.299 ± 0.559i
No real eigenvectors: A turns every direction, so no line through 0 stays put. The eigenvalues are complex.
Theorem— Corollary (the Gaussian integral)
Proof
Let , which increases to a finite limit (the integrand is at most for ). By Fubini, over the square . The integrand is positive and the square lies between the discs of radius and , so with the disc of radius ,
In polar coordinates, — the factor is exactly what makes integrable in closed form. Both bounds tend to , so .
∎
This is why the normal density has total probability .
Line integrals and the theorems of Green, Stokes and Gauss
Theorem— Theorem (gradient theorem)
If is on an open set and is a path, then
In particular the line integral of a conservative field depends only on the endpoints, and is around every closed path.
Proof
By the chain rule, , which is continuous. The one-variable fundamental theorem of calculus gives .
∎
A test for conservative fields. If with of class , then by Schwarz's theorem: a conservative field has zero curl. The converse holds on a disc, or any star-shaped open set (Poincaré's lemma), but not in general:
Example— The vortex: curl zero, but not conservative
On let . A quotient-rule computation gives , so on . But on the unit circle we have , so
By the gradient theorem, is not for any function on . Locally it is: for the polar angle , but cannot be defined continuously all the way round the origin. The circulation detects the hole.
A vortex: circulation without curl
Drag the loop. Around the origin the circulation is 2π while the integrated curl is 0; away from it both vanish.
F(x, y) = (−y/(x² + y²), x/(x² + y²))
Drag the gold centre (or click anywhere) to move the loop. With the keyboard, focus the centre and use the arrow keys.
Turns so far: 0.09
- Circulation
- ∮ F·dr ≈ 6.2832 | ∬ curl F dA ≈ −0.0322
- Flux out
- ∮ F·n ds ≈ 0 | ∬ div F dA ≈ 0.1043
- At the centre
- curl F ≈ 0, div F ≈ 0, πr² ≈ 8.042
- Index
- 1
All values are numerical approximations (sums around the loop and over the disc).
The two sides differ: the field must fail to be smooth (or be undefined) somewhere inside the loop, so Green’s theorem does not apply to this loop.
Index 1 ≠ 0: walking once around the loop, the arrow makes 1 net full turns (negative means clockwise). A field that is continuous on the whole disc would have to vanish inside; this one is not (see above), and the point where it breaks down carries the index instead.
Theorem— Theorem (Green's theorem)
Let be a closed bounded region whose boundary consists of finitely many piecewise simple closed curves, oriented so that lies to the left. If are on an open set containing , then
Proof
We prove it for a rectangle , which already contains the idea; general regions are handled by cutting them into pieces of this kind (or of the form , where the same computation works), since the line integrals over interior cuts cancel in pairs.
Treat the two terms separately. By Fubini and the one-variable fundamental theorem,
On the other hand, runs along the bottom edge from to , contributing ; along the top edge from right to left, contributing ; and along the vertical edges, where , contributing nothing. The two expressions agree. In the same way . Add.
∎
The vortex shows why the hypothesis " on all of " matters: for the unit disc the left side is , the right side would be , and indeed is undefined at the origin. Green's theorem with , gives a formula for area, — the principle of the planimeter, a mechanical instrument that measures areas by tracing boundaries. For the ellipse it gives .
Applied to the field rotated by a right angle, Green's theorem becomes its flux form: the outward flux of equals . In three dimensions both forms have analogues.
Theorem— Theorem (divergence theorem of Gauss)
Let be a closed bounded region whose boundary is a piecewise smooth closed surface with outward unit normal , and let be on an open set containing . Then
Theorem— Theorem (Stokes's theorem)
Let be a piecewise smooth oriented surface with boundary curve , oriented compatibly (walking along with your head in the direction of , the surface is on your left), and let be near . Then
For a box the divergence theorem is proved exactly like Green's theorem: equals, by Fubini and the fundamental theorem, the integral of over the top face minus that over the bottom face — the flux of — and similarly for the other components. The general versions (and Stokes's theorem, which for a graph reduces to Green's theorem by the chain rule) are proved in texts such as Hubbard and Hubbard, or Marsden and Tromba, and most cleanly as the single theorem of differential forms (see the geometry viewpoint).
Example— Flux out of a sphere, two ways
Let and let be the ball of radius . Directly: on the sphere , so , and the flux is . By the divergence theorem: , so the flux is .
Multivariable calculus in Lean and Mathlib
Mathlib's derivative for maps between normed spaces is the Fréchet derivative: HasFDerivAt f f' a with f' : E →L[ℝ] F a continuous linear map — precisely the lesson's definition. Euclidean space is one instance, but the same theorems hold in infinite-dimensional spaces, which is why statements are phrased with E and F rather than matrices.
The chain rule is cited from Mathlib (its proof is the argument above). From it we derive directional derivatives: differentiate along the line . With an inner product, the derivative is , and Cauchy–Schwarz gives the steepest-ascent property:
/-- **The chain rule**: `D(g ∘ f)(a) = Dg(f(a)) ∘ Df(a)`, a composite of linear maps (in
coordinates, a product of Jacobian matrices). This applies Mathlib's `HasFDerivAt.comp`. -/
theorem chain_rule {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G]
{f : E → F} {g : F → G} {f' : E →L[ℝ] F} {g' : F →L[ℝ] G} {a : E}
(hf : HasFDerivAt f f' a) (hg : HasFDerivAt g g' (f a)) :
HasFDerivAt (g ∘ f) (g'.comp f') a :=
hg.comp a hf/-- If `f` is differentiable at `a` with derivative `f'`, then the directional derivative of `f`
at `a` in the direction `v` exists and equals `f' v`: the derivative of `t ↦ f (a + t v)` at
`t = 0`. Proof: the line `γ t = a + t v` has velocity `v`, and the chain rule
(`HasFDerivAt.comp_hasDerivAt`) gives `(f ∘ γ)'(0) = f'(γ'(0)) = f' v`. -/
theorem directional_deriv {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[NormedAddCommGroup F] [NormedSpace ℝ F] {f : E → F} {f' : E →L[ℝ] F} {a : E}
(hf : HasFDerivAt f f' a) (v : E) :
HasDerivAt (fun t : ℝ => f (a + t • v)) (f' v) 0 := by
have hγ : HasDerivAt (fun t : ℝ => a + t • v) v 0 := by
simpa using ((hasDerivAt_id (0 : ℝ)).smul_const v).const_add a
have hf0 : HasFDerivAt f f' (a + (0 : ℝ) • v) := by simpa using hf
exact hf0.comp_hasDerivAt (x := (0 : ℝ)) hγ/-- With a gradient: if `f : E → ℝ` has gradient `∇f(a) = g` (Mathlib's `HasGradientAt`), the
directional derivative in direction `v` is the inner product `⟪g, v⟫`. This combines
`directional_deriv` with `hasGradientAt_iff_hasFDerivAt`: the derivative is `v ↦ ⟪g, v⟫`. -/
theorem gradient_directional {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
[CompleteSpace E] {f : E → ℝ} {g a : E} (hf : HasGradientAt f g a) (v : E) :
HasDerivAt (fun t : ℝ => f (a + t • v)) (inner ℝ g v) 0 := by
have := directional_deriv (hasGradientAt_iff_hasFDerivAt.mp hf) v
simpa using this/-- **The gradient points uphill fastest.** For a unit vector `v`, the directional derivative
`⟪∇f, v⟫` is at most `‖∇f‖` (Cauchy–Schwarz, `real_inner_le_norm`), and the value `‖∇f‖` is
attained in the direction `∇f / ‖∇f‖` when `∇f ≠ 0`. -/
theorem steepest_ascent {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
(g v : E) (hv : ‖v‖ = 1) :
inner ℝ g v ≤ ‖g‖ ∧ (g ≠ 0 → inner ℝ g (‖g‖⁻¹ • g) = ‖g‖) := by
constructor
· calc inner ℝ g v ≤ ‖g‖ * ‖v‖ := real_inner_le_norm g v
_ = ‖g‖ := by rw [hv, mul_one]
· intro hg
have hn : ‖g‖ ≠ 0 := norm_ne_zero_iff.mpr hg
rw [real_inner_smul_right, real_inner_self_eq_norm_sq]
field_simpThe counterexample, formalised as in the lesson: both partials vanish at the origin, the function is not continuous there (look along the diagonal), hence not differentiable. Note how Lean's convention supplies the value automatically:
/-- The standard counterexample `f(x, y) = xy / (x² + y²)`. At the origin the formula reads
`0 / 0`, which Lean evaluates to `0` (division by zero is `0` in Mathlib), matching the lesson's
convention `f(0, 0) = 0`. -/
noncomputable def xyQuot (p : ℝ × ℝ) : ℝ := p.1 * p.2 / (p.1 ^ 2 + p.2 ^ 2)/-- Both partial derivatives of `xyQuot` exist at the origin and equal `0`: along each axis the
function is identically zero (`f(t, 0) = 0` and `f(0, t) = 0`), so its derivative there is `0`. -/
theorem xyQuot_partials :
HasDerivAt (fun t => xyQuot (t, 0)) 0 0 ∧ HasDerivAt (fun t => xyQuot (0, t)) 0 0 := by
have h1 : (fun t => xyQuot (t, 0)) = fun _ => (0 : ℝ) := by
funext t; simp [xyQuot]
have h2 : (fun t => xyQuot (0, t)) = fun _ => (0 : ℝ) := by
funext t; simp [xyQuot]
rw [h1, h2]
exact ⟨hasDerivAt_const 0 0, hasDerivAt_const 0 0⟩/-- …but `xyQuot` is not even continuous at the origin: on the diagonal, `f(t, t) = 1/2` for
every `t ≠ 0`, while `f(0, 0) = 0`. If `f` were continuous at `0`, then `f(t, t)` would tend to
`f(0, 0) = 0` as `t → 0`, but it is constantly `1/2` near `0`, so `1/2 = 0`. -/
theorem xyQuot_not_continuousAt : ¬ ContinuousAt xyQuot 0 := by
intro hc
-- Restrict to the diagonal `t ↦ (t, t)`.
have hdiag : ContinuousAt (fun t : ℝ => xyQuot (t, t)) 0 := by
have hγ : ContinuousAt (fun t : ℝ => ((t, t) : ℝ × ℝ)) 0 :=
(continuous_id.prodMk continuous_id).continuousAt
have hc' : ContinuousAt xyQuot ((0 : ℝ), (0 : ℝ)) := hc
exact ContinuousAt.comp (g := xyQuot) (f := fun t : ℝ => ((t, t) : ℝ × ℝ)) hc' hγ
have hlim0 : Tendsto (fun t : ℝ => xyQuot (t, t)) (𝓝[≠] 0) (𝓝 0) := by
have := hdiag.tendsto.mono_left (nhdsWithin_le_nhds (s := {(0 : ℝ)}ᶜ))
simpa [xyQuot] using this
have hlimhalf : Tendsto (fun t : ℝ => xyQuot (t, t)) (𝓝[≠] 0) (𝓝 (1 / 2)) := by
refine tendsto_const_nhds.congr' ?_
filter_upwards [self_mem_nhdsWithin] with t ht
have ht' : t ≠ 0 := ht
have : t ^ 2 + t ^ 2 ≠ 0 := by positivity
simp only [xyQuot]
field_simp
ring
have := tendsto_nhds_unique hlim0 hlimhalf
norm_num at this/-- Hence `xyQuot` is not differentiable at the origin, although both partial derivatives exist
there: differentiability implies continuity (`DifferentiableAt.continuousAt`). -/
theorem xyQuot_not_differentiableAt : ¬ DifferentiableAt ℝ xyQuot 0 :=
fun h => xyQuot_not_continuousAt h.continuousAtSymmetry of second derivatives (Schwarz–Clairaut), cited from Mathlib in its coordinate-free form :
/-- **Symmetry of second derivatives** (Schwarz–Clairaut): if `f` is differentiable everywhere and
its derivative `f'` is differentiable at `x` with derivative `f''`, then `f'' v w = f'' w v`; in
coordinates, `∂²f/∂x∂y = ∂²f/∂y∂x`. This applies Mathlib's `second_derivative_symmetric`. -/
theorem schwarz {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[NormedAddCommGroup F] [NormedSpace ℝ F] {f : E → F} {f' : E → E →L[ℝ] F}
{f'' : E →L[ℝ] E →L[ℝ] F} {x : E} (hf : ∀ y, HasFDerivAt f (f' y) y)
(hx : HasFDerivAt f' f'' x) (v w : E) : f'' v w = f'' w v :=
second_derivative_symmetric hf hx v wMathlib's Lagrange multiplier theorem is stated without dividing: and are linearly dependent. If this is the lesson's . Beside it, the "certificate" for the circle example:
/-- **Lagrange multipliers** (one constraint): if `φ` has a local extremum at `x₀` on the level
set `{x | f x = f x₀}`, and `f`, `φ` are strictly differentiable at `x₀`, then `f'` and `φ'` are
linearly dependent: `a • f' + b • φ' = 0` with `(a, b) ≠ 0`. When `f' ≠ 0` this forces `b ≠ 0`,
i.e. `∇φ = λ ∇f`. This applies Mathlib's `IsLocalExtrOn.exists_multipliers_of_hasStrictFDerivAt_1d`. -/
theorem lagrange {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
{f φ : E → ℝ} {x₀ : E} {f' φ' : StrongDual ℝ E}
(hextr : IsLocalExtrOn φ {x | f x = f x₀} x₀) (hf' : HasStrictFDerivAt f f' x₀)
(hφ' : HasStrictFDerivAt φ φ' x₀) : ∃ a b : ℝ, (a, b) ≠ 0 ∧ a • f' + b • φ' = 0 :=
hextr.exists_multipliers_of_hasStrictFDerivAt_1d hf' hφ'/-- The answer the multiplier method finds for "maximise `xy` on the circle `x² + y² = 2`":
the maximum is `1`, attained at `(1, 1)`. A certificate: `2xy ≤ x² + y²` because
`(x - y)² ≥ 0`. -/
theorem circle_max_xy :
(∀ x y : ℝ, x ^ 2 + y ^ 2 = 2 → x * y ≤ 1) ∧ ((1 : ℝ) ^ 2 + 1 ^ 2 = 2 ∧ (1 : ℝ) * 1 = 1) := by
refine ⟨fun x y h => ?_, by norm_num, by norm_num⟩
nlinarith [sq_nonneg (x - y)]Polar coordinates: the Jacobian determinant is , the change of variables formula has the factor , and Mathlib proves the Gaussian integral by the lesson's argument:
/-- The Jacobian determinant of polar coordinates `(r, θ) ↦ (r cos θ, r sin θ)` is `r`:
`det [[cos θ, -r sin θ], [sin θ, r cos θ]] = r (cos² θ + sin² θ) = r`. This applies Mathlib's
`det_fderivPolarCoordSymm`. -/
theorem polar_jacobian (p : ℝ × ℝ) : (fderivPolarCoordSymm p).det = p.1 :=
det_fderivPolarCoordSymm p/-- **Change of variables to polar coordinates**: `∬ f(x, y) dx dy = ∬ f(r cos θ, r sin θ) r dr dθ`,
the integral on the right over `r > 0`, `-π < θ < π`. The factor `r` is the Jacobian
determinant above. This applies Mathlib's `integral_comp_polarCoord_symm`. -/
theorem polar_change_of_variables (f : ℝ × ℝ → ℝ) :
∫ p in polarCoord.target, p.1 * f (polarCoord.symm p) = ∫ p, f p := by
simpa [smul_eq_mul] using integral_comp_polarCoord_symm f/-- **The Gaussian integral** `∫ e^{-x²} dx = √π` over the whole real line. Mathlib's
`integral_gaussian` proves `∫ e^{-b x²} dx = √(π/b)`, via the square of the integral and polar
coordinates, exactly the lesson's argument; we take `b = 1`. -/
theorem gaussian_integral : ∫ x : ℝ, exp (-x ^ 2) = √π := by
have := integral_gaussian 1
simpa using thisLine integrals. The gradient theorem is proved from the chain rule and the one-variable fundamental theorem, exactly as in the lesson (here and are on the whole space, which is what makes the integrand continuous):
/-- **The gradient theorem** (fundamental theorem for line integrals): for a `C¹` function
`f : E → ℝ` and a `C¹` path `γ`, the line integral of the derivative of `f` along `γ` from
`t = a` to `t = b` is `f (γ b) - f (γ a)`. Proof: by the chain rule `(f ∘ γ)'(t) = Df(γ t)(γ'(t))`,
which is continuous, so the one-variable fundamental theorem applies. -/
theorem gradient_theorem {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
{f : E → ℝ} {γ : ℝ → E} (hf : ContDiff ℝ 1 f) (hγ : ContDiff ℝ 1 γ) (a b : ℝ) :
∫ t in a..b, fderiv ℝ f (γ t) (deriv γ t) = f (γ b) - f (γ a) := by
have hderiv : ∀ t ∈ uIcc a b,
HasDerivAt (f ∘ γ) (fderiv ℝ f (γ t) (deriv γ t)) t := by
intro t _
have hfd : HasFDerivAt f (fderiv ℝ f (γ t)) (γ t) :=
((hf.differentiable one_ne_zero) (γ t)).hasFDerivAt
have hγd : HasDerivAt γ (deriv γ t) t :=
((hγ.differentiable one_ne_zero) t).hasDerivAt
exact hfd.comp_hasDerivAt t hγd
have hcont : Continuous fun t => fderiv ℝ f (γ t) (deriv γ t) :=
((hf.continuous_fderiv one_ne_zero).comp hγ.continuous).clm_apply
(hγ.continuous_deriv le_rfl)
rw [intervalIntegral.integral_eq_sub_of_hasDerivAt hderiv (hcont.intervalIntegrable a b)]
rfl/-- Corollary: the line integral of a gradient around a **closed** `C¹` loop (`γ a = γ b`) is
zero. -/
theorem closed_loop_zero {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
{f : E → ℝ} {γ : ℝ → E} (hf : ContDiff ℝ 1 f) (hγ : ContDiff ℝ 1 γ) {a b : ℝ}
(hclosed : γ a = γ b) :
∫ t in a..b, fderiv ℝ f (γ t) (deriv γ t) = 0 := by
rw [gradient_theorem hf hγ a b, hclosed, sub_self]The vortex: its curl vanishes, and its circulation around the unit circle is . (The integrand is written out with , substituted into , dotted with .)
/-- The vortex field `F = (P, Q) = (-y/(x² + y²), x/(x² + y²))` has zero curl away from the
origin: `∂Q/∂x = (y² - x²)/(x² + y²)² = ∂P/∂y`. Each partial derivative is computed with the
quotient rule in one variable, the other variable held fixed. -/
theorem vortex_curl_zero {x y : ℝ} (h : x ^ 2 + y ^ 2 ≠ 0) :
HasDerivAt (fun s => s / (s ^ 2 + y ^ 2)) ((y ^ 2 - x ^ 2) / (x ^ 2 + y ^ 2) ^ 2) x ∧
HasDerivAt (fun s => -s / (x ^ 2 + s ^ 2)) ((y ^ 2 - x ^ 2) / (x ^ 2 + y ^ 2) ^ 2) y := by
constructor
· have hd : HasDerivAt (fun s => s ^ 2 + y ^ 2) (2 * x) x := by
simpa using (hasDerivAt_pow 2 x).add_const (y ^ 2)
convert (hasDerivAt_id' x).div hd h using 1
ring
· have hd : HasDerivAt (fun s => x ^ 2 + s ^ 2) (2 * y) y := by
simpa using (hasDerivAt_pow 2 y).const_add (x ^ 2)
convert (hasDerivAt_neg' y).div hd h using 1
ring/-- …yet its circulation around the unit circle `γ(t) = (cos t, sin t)`, `0 ≤ t ≤ 2π`, is `2π`:
on the circle `F(γ t) = (-sin t, cos t) = γ'(t)`, so the integrand `F · γ'` is
`sin² t + cos² t = 1`. By the gradient theorem, `F` is therefore not the gradient of any `C¹`
function on the punctured plane (that step is explained in the lesson, not formalised here). -/
theorem vortex_circulation :
∫ t in (0 : ℝ)..2 * π,
((-sin t / (cos t ^ 2 + sin t ^ 2)) * (-sin t) +
(cos t / (cos t ^ 2 + sin t ^ 2)) * cos t) = 2 * π := by
have h : ∀ t : ℝ, (-sin t / (cos t ^ 2 + sin t ^ 2)) * (-sin t) +
(cos t / (cos t ^ 2 + sin t ^ 2)) * cos t = 1 := by
intro t
rw [cos_sq_add_sin_sq]
have := sin_sq_add_cos_sq t
simp only [div_one]
nlinarith [this]
simp only [h, intervalIntegral.integral_const, smul_eq_mul, mul_one, sub_zero]Finally Green's theorem on a rectangle, in its flux form, as Mathlib states it — the boundary integral written out as four one-variable integrals over the sides:
/-- **Green's theorem on a rectangle**, in its flux (divergence) form: for `F = (f, g)` continuous
on the rectangle `R = [a₁, b₁] × [a₂, b₂]`, differentiable inside, with integrable divergence,
`∬_R (∂f/∂x + ∂g/∂y) = ∮_∂R F · n ds`, written out as four boundary integrals. This applies
Mathlib's `integral_divergence_prod_Icc_of_hasFDerivAt_of_le` (with values in `ℝ`). -/
theorem green_rectangle (f g : ℝ × ℝ → ℝ) (f' g' : ℝ × ℝ → ℝ × ℝ →L[ℝ] ℝ) (a b : ℝ × ℝ)
(hle : a ≤ b) (Hcf : ContinuousOn f (Icc a b)) (Hcg : ContinuousOn g (Icc a b))
(Hdf : ∀ x ∈ Ioo a.1 b.1 ×ˢ Ioo a.2 b.2, HasFDerivAt f (f' x) x)
(Hdg : ∀ x ∈ Ioo a.1 b.1 ×ˢ Ioo a.2 b.2, HasFDerivAt g (g' x) x)
(Hi : IntegrableOn (fun x => f' x (1, 0) + g' x (0, 1)) (Icc a b)) :
(∫ x in Icc a b, f' x (1, 0) + g' x (0, 1)) =
(((∫ x in a.1..b.1, g (x, b.2)) - ∫ x in a.1..b.1, g (x, a.2)) +
∫ y in a.2..b.2, f (b.1, y)) - ∫ y in a.2..b.2, f (a.1, y) :=
integral_divergence_prod_Icc_of_hasFDerivAt_of_le f g f' g' a b hle Hcf Hcg Hdf Hdg HiWhat is and is not formalised. Independently proved here: directional derivatives and the gradient formula, steepest ascent, the whole counterexample, the gradient theorem and its closed-loop corollary, the constrained maximum of , and both vortex computations. Cited from Mathlib: the chain rule, Schwarz's theorem, Lagrange multipliers, the polar Jacobian and change of variables, the Gaussian integral and the divergence theorem on rectangles (Mathlib also has it on boxes in ). Not formalised: "continuous partials imply differentiable" (Mathlib's notion of is defined through the Fréchet derivative, so this coordinate statement is not the form Mathlib uses), the conclusion that the vortex is not conservative on the punctured plane (our gradient theorem assumes is everywhere), Green's theorem for general regions, Stokes's theorem for surfaces, and surface integrals, which in Mathlib are best approached through differential forms and manifolds, still under development.
Computing with multipliers, Jacobians and circulation
The multiplier method turns optimisation into solving equations — something a computer algebra system can do exactly. The first experiment solves the three problems above and one more (the nearest point of a plane):
"""Lagrange multipliers, solved exactly with SymPy.
To find the extreme values of f on the constraint set g = c, solve the
system grad f = lambda grad g, g = c. SymPy solves it exactly for three
problems: xy on the circle x^2 + y^2 = 2, the volume xyz of a box with surface
area 6, and the point of the plane x + 2y + 2z = 9 closest to the origin.
Each candidate is evaluated; the extreme values exist because the constraint
set is compact (first problem) or for a separate reason explained in the
lesson.
Runs in the browser (Pyodide) with the sympy package loaded.
"""
import sympy
x, y, z, lam = sympy.symbols("x y z lambda", real=True)
def lagrange_points(f, g, c, variables):
"""Solve grad f = lambda grad g, g = c; return sorted (point, value) pairs."""
eqs = [sympy.diff(f, v) - lam * sympy.diff(g, v) for v in variables]
eqs.append(g - c)
sols = sympy.solve(eqs, list(variables) + [lam], dict=True)
out = []
for s in sols:
point = tuple(sympy.nsimplify(s[v]) for v in variables)
out.append((point, sympy.simplify(f.subs(s))))
return sorted(out, key=lambda pv: (float(pv[1]), [float(p) for p in pv[0]]))
def satisfies_multiplier_rule(f, g, point, variables):
"""True if grad f is a multiple of grad g at the point (2- or 3-vectors)."""
sub = dict(zip(variables, point))
gf = sympy.Matrix([sympy.diff(f, v).subs(sub) for v in variables])
gg = sympy.Matrix([sympy.diff(g, v).subs(sub) for v in variables])
return sympy.Matrix.hstack(gf, gg).rank() <= 1
PROBLEMS = [
("max/min of xy on x^2 + y^2 = 2", x * y, x**2 + y**2, 2, (x, y)),
("max of xyz on 2(xy + yz + zx) = 6, x, y, z > 0",
x * y * z, 2 * (x * y + y * z + z * x), 6, (x, y, z)),
("min of x^2 + y^2 + z^2 on x + 2y + 2z = 9",
x**2 + y**2 + z**2, x + 2 * y + 2 * z, 9, (x, y, z)),
]
def main():
print(f"Lagrange multipliers with SymPy {sympy.__version__}")
for title, f, g, c, variables in PROBLEMS:
print(title)
points = lagrange_points(f, g, c, variables)
if len(variables) == 3 and "xyz" in title:
points = [(p, v) for p, v in points if all(t > 0 for t in p)]
for point, value in points:
ok = satisfies_multiplier_rule(f, g, point, variables)
print(f" point {str(point):<16} value {str(value):<4} rule holds: {ok}")
print("Readings: xy ranges over [-1, 1] on the circle; the best box is the")
print("unit cube (volume 1); the nearest point is (1, 2, 2), at distance 3,")
print("which is |9| / |(1, 2, 2)|, the point-to-plane distance formula.")
print()
print("Epistemic status: exact symbolic solutions of the multiplier")
print("equations, as reliable as SymPy's solver. The method only lists")
print("candidates: that a maximum or minimum exists at all is a separate")
print("argument (compactness of the circle; for the box and the plane, the")
print("reasoning given in the lesson).")
if __name__ == "__main__":
main()For the plane, existence of a minimum is easy to see directly: by Cauchy–Schwarz, , so every point of the plane has distance at least from the origin, with equality at .
Next, what happens if you forget the Jacobian factor? The second experiment integrates over discs three ways:
"""Change of variables: why the Jacobian factor r matters.
We integrate e^(-(x^2 + y^2)) over discs of radius R three ways: on a
Cartesian grid (the honest but slow way), in polar coordinates with the
Jacobian factor r, and in polar coordinates *forgetting* r. The first two
agree with the exact value pi (1 - e^(-R^2)); the third does not. Letting R
grow gives pi, so (integral of e^(-x^2) over the line)^2 = pi - the Gaussian
integral.
Runs unchanged in the browser (Pyodide) using only the standard library.
"""
import math
def gauss2(x, y):
"""The two-dimensional Gaussian exp(-(x^2 + y^2))."""
return math.exp(-(x * x + y * y))
def cartesian_disc(f, radius, n=400):
"""Midpoint rule on an n x n grid over [-R, R]^2, keeping cells in the disc."""
h = 2 * radius / n
total = 0.0
for i in range(n):
x = -radius + (i + 0.5) * h
for j in range(n):
y = -radius + (j + 0.5) * h
if x * x + y * y <= radius * radius:
total += f(x, y)
return total * h * h
def polar_disc(f, radius, n_r=400, n_t=64, jacobian=True):
"""Midpoint rule in (r, theta); include the factor r unless jacobian=False."""
hr, ht = radius / n_r, 2 * math.pi / n_t
total = 0.0
for i in range(n_r):
r = (i + 0.5) * hr
weight = r if jacobian else 1.0
for j in range(n_t):
t = (j + 0.5) * ht
total += f(r * math.cos(t), r * math.sin(t)) * weight
return total * hr * ht
def exact_disc(radius):
"""Exact integral of exp(-(x^2 + y^2)) over the disc: pi (1 - e^(-R^2))."""
return math.pi * (1 - math.exp(-radius * radius))
def gaussian_line(limit=8.0, n=4000):
"""Midpoint-rule approximation of the integral of e^(-x^2) over [-L, L]."""
h = 2 * limit / n
return h * sum(math.exp(-((-limit + (i + 0.5) * h) ** 2)) for i in range(n))
def main():
print("Integral of exp(-(x^2 + y^2)) over the disc of radius R")
print(" R exact Cartesian polar with r polar without r")
for radius in [0.5, 1.0, 2.0, 3.0]:
exact = exact_disc(radius)
cart = cartesian_disc(gauss2, radius, n=200)
good = polar_disc(gauss2, radius)
bad = polar_disc(gauss2, radius, jacobian=False)
print(f" {radius:<4} {exact:.6f} {cart:.6f} {good:.6f} {bad:.6f}")
print("The Cartesian grid has a jagged edge along the circle, which limits")
print("its accuracy; polar coordinates with r match the exact value.")
print("Without r the 'area element' dr dtheta is wrong: it overweights the")
print("centre, where small r squeezes the polar rectangles together.")
print()
big = exact_disc(6.0)
line = gaussian_line()
print(f"As R grows the disc integral tends to pi: R = 6 gives {big:.12f}")
print(f"Integral of e^(-x^2) over [-8, 8] (midpoint rule) = {line:.12f}")
print(f"sqrt(pi) = {math.sqrt(math.pi):.12f}")
print()
print("Epistemic status: numerical quadrature for a few radii - evidence that")
print("dx dy = r dr dtheta, not a proof. The change of variables theorem and")
print("the exact Gaussian integral sqrt(pi) are proved in the lesson (and in")
print("Mathlib, cited in the lesson's Lean file).")
if __name__ == "__main__":
main()Finally, Green's theorem checked numerically — and its failure for the vortex:
"""Green's theorem, numerically: circulation around a circle versus curl inside.
Green's theorem says the circulation of a C^1 field F = (P, Q) around the
boundary of a region D equals the double integral of curl F = Q_x - P_y over
D. We compute both sides numerically for circles. For the smooth field
(-y^3, x^3) they agree. For the vortex (-y, x)/(x^2 + y^2) they disagree on a
circle around the origin (2 pi versus 0): the field is singular at the
origin, so the hypothesis "C^1 on all of D" fails - and the circulation
measures the hole.
Runs unchanged in the browser (Pyodide) using only the standard library.
"""
import math
def circulation(P, Q, centre, radius, n=2000):
"""Approximate the circulation of (P, Q) counterclockwise around a circle.
Uses the trapezoid rule in the angle t, which is very accurate for smooth
periodic integrands.
"""
cx, cy = centre
total = 0.0
for i in range(n):
t = 2 * math.pi * i / n
x, y = cx + radius * math.cos(t), cy + radius * math.sin(t)
dx, dy = -radius * math.sin(t), radius * math.cos(t)
total += P(x, y) * dx + Q(x, y) * dy
return total * 2 * math.pi / n
def disc_integral(g, centre, radius, n_r=200, n_t=200):
"""Approximate the integral of g over a disc, in polar coordinates.
Midpoint rule in r and t; the factor r is the Jacobian of polar coordinates.
"""
cx, cy = centre
hr, ht = radius / n_r, 2 * math.pi / n_t
total = 0.0
for i in range(n_r):
r = (i + 0.5) * hr
for j in range(n_t):
t = (j + 0.5) * ht
total += g(cx + r * math.cos(t), cy + r * math.sin(t)) * r
return total * hr * ht
def smooth_P(x, y):
"""First component of the smooth field (-y^3, x^3)."""
return -y**3
def smooth_Q(x, y):
"""Second component of the smooth field (-y^3, x^3)."""
return x**3
def smooth_curl(x, y):
"""curl (-y^3, x^3) = Q_x - P_y = 3x^2 + 3y^2."""
return 3 * x**2 + 3 * y**2
def vortex_P(x, y):
"""First component of the vortex field -y / (x^2 + y^2)."""
return -y / (x**2 + y**2)
def vortex_Q(x, y):
"""Second component of the vortex field x / (x^2 + y^2)."""
return x / (x**2 + y**2)
def vortex_curl(x, y):
"""curl of the vortex field, which is 0 wherever it is defined."""
return 0.0
def main():
rows = [
("(-y^3, x^3)", smooth_P, smooth_Q, smooth_curl, (0, 0), 1),
("(-y^3, x^3)", smooth_P, smooth_Q, smooth_curl, (1, 0.5), 0.8),
("vortex", vortex_P, vortex_Q, vortex_curl, (0, 0), 1),
("vortex", vortex_P, vortex_Q, vortex_curl, (0, 0), 0.01),
("vortex", vortex_P, vortex_Q, vortex_curl, (2, 0), 1),
]
print("Circulation around a circle versus the integral of curl inside")
print("field centre radius circulation integral of curl")
for name, P, Q, curl, c, r in rows:
circ = circulation(P, Q, c, r)
inner = disc_integral(curl, c, r)
centre = f"({c[0]}, {c[1]})"
print(f"{name:<13} {centre:<12} {r:<7} {circ:11.6f} {inner:11.6f}")
print(f"For reference: 3 pi / 2 = {1.5 * math.pi:.6f}, 2 pi = {2 * math.pi:.6f}")
print("Smooth field: the two columns agree, as Green's theorem says.")
print("Vortex around the origin: circulation 2 pi on every circle, however")
print("small, but curl 0 wherever the field is defined. Around (2, 0), away")
print("from the singularity, both sides are 0.")
print()
print("Epistemic status: numerical quadrature (trapezoid and midpoint rules),")
print("accurate here to many digits but not a proof. That the circulation of")
print("the vortex around the unit circle is exactly 2 pi is a short exact")
print("computation (formalised in the lesson's Lean file); Green's theorem")
print("itself is proved in the lesson for rectangles.")
if __name__ == "__main__":
main()The SymPy computation is exact (within the trust one places in its solver); the other two are numerical evidence for particular fields and regions. The theorems are what make the patterns general.
Exercises
1. Multivariable and vector calculus
Warm-upHumanA hiker's altitude is (in suitable units). What is the greatest rate of increase of at the point , over all unit directions?
2. Multivariable and vector calculus
CoreHumanLet for and . Which statement is true?
3. Multivariable and vector calculus
CoreHumanUsing polar coordinates, . Find .
4. Multivariable and vector calculus
CoreHumanFind the maximum value of on the circle .
5. Multivariable and vector calculus
CoreHumanThe vortex field has zero curl on , yet its circulation around the unit circle is . Which hypothesis of the theorem “a field with zero curl on a domain is conservative on ” fails?
6. Multivariable and vector calculus
CoreHumanFor , which statements are true? (Select all that apply.)
7. Multivariable and vector calculus
StretchHumanLet . The outward flux of through the sphere of radius centred at the origin is . Find .
8. Multivariable and vector calculus
StretchFormalIn Lean, xyQuot p = p.1 * p.2 / (p.1 ^ 2 + p.2 ^ 2). Which statement formalises “both partial derivatives exist at the origin, but the function is not differentiable there”?
9. Multivariable and vector calculus
StretchComputationalWrite circulation(P, Q, r, n) that approximates counterclockwise around the circle of radius r centred at the origin, using the parametrisation and the rectangle (left-point) rule with n equal steps in . Test it on the rotation field (circulation ), a gradient field (circulation ) and the vortex (circulation ).
Common misconceptions
Misconception
"If the partial derivatives exist, the function is differentiable." Partial derivatives only look along the coordinate axes. (with ) has both partials at the origin but is not even continuous there. What is true: if the partials exist near and are continuous at , then is differentiable at .
Misconception
Forgetting the Jacobian factor. "" is wrong; . Without the , the area of the disc of radius would come out as , and the experiment above shows the size of the error for a Gaussian. The factor is — the absolute value, because volumes are positive even when reverses orientation.
Misconception
"Zero curl means conservative." Only on simply connected domains (for instance discs, or any star-shaped set). The vortex field has zero curl on the punctured plane but circulation around the origin.
Misconception
" always finds the maximum." It finds candidates, and only at points where . One must also check points where on the constraint, and make sure a maximum exists at all — by compactness, or by a separate inequality, as for the box.
Misconception
"The gradient is just a list of partial derivatives, independent of geometry." The derivative is defined without any inner product; the gradient is the vector representing it via the dot product. With a different inner product (in curvilinear coordinates, or on a curved surface), the gradient vector changes: in polar coordinates , not .
Many ways of seeing
Geometry— One theorem: ∫ over the boundary of ω equals ∫ of dω
Green's, Stokes's and Gauss's theorems, and the fundamental theorem of calculus itself, are one theorem in the language of differential forms. A -form is something that can be integrated over oriented -dimensional surfaces: is a 1-form, a 2-form. The exterior derivative turns -forms into -forms; in , on 0-, 1- and 2-forms, it is gradient, curl and divergence. The generalised Stokes theorem says for a compact oriented manifold with boundary. The wedge product is antisymmetric, , which is the geometric reason the Jacobian determinant appears in change of variables: . See differential forms and smooth manifolds.
Topology— Fields that detect holes
The vortex shows that the difference between "curl-free" and "conservative" is topological. Curl-free fields on an open set , modulo gradients, form a vector space: the first de Rham cohomology . Poincaré's lemma says it is zero for a disc; for the punctured plane it is one-dimensional, spanned by the vortex, and the linear map "circulation around the origin, divided by " identifies it with . For a curl-free field the circulation around a loop depends only on the loop's homotopy class, and for the vortex it is times the winding number of the loop around the origin. De Rham's theorem (1931) says these analytic invariants agree with the topological ones computed by counting holes. See the fundamental group and algebraic topology.
Algebra— Linearisation, and d² = 0
Multivariable calculus is linear algebra applied locally: the derivative is a linear map, the chain rule is matrix multiplication, the second derivative test is the classification of a symmetric matrix by the signs of its eigenvalues, and the change of variables formula is the multiplicativity of the determinant. The identities and are both consequences of the symmetry of second derivatives, and in the language of forms they are the single identity : the sequence "functions fields fields functions" is a cochain complex, and its failure to be exact measures topology, as in the topological viewpoint.
Physics— Gauss's law, potentials and constraint forces
The theorems of this lesson were developed largely for physics. Gauss's law for the electric field, , becomes the local equation by the divergence theorem applied to small balls; Faraday's law becomes by Stokes's theorem — Maxwell's equations in their two equivalent forms. A force field is conservative exactly when work is path-independent, and then for a potential energy (see classical mechanics). Lagrange multipliers have a physical reading too: a bead on a wire feels a constraint force normal to the wire, and the multiplier measures its strength.
Probability— Densities transform with the Jacobian
If a random point in has density and for a bijection with non-vanishing Jacobian, then has density — the change of variables formula read backwards. The Gaussian integral makes the normal distribution a probability distribution, and polar coordinates explain the Box–Muller method for simulating it: if are independent and uniform on , then , give independent standard normal variables and — the factor in is exactly absorbed by the density of . See probability theory.
Category theory— The chain rule is functoriality
Consider pointed open sets and differentiable maps with . Sending to the vector space of directions at , and to the linear map , respects identities () and composition (). So the chain rule says precisely that differentiation at a point is a functor from this category to the category of finite-dimensional vector spaces. On manifolds this becomes the tangent functor , sending to its tangent bundle. See functors.
History and global context
- Partial derivatives and multiple integrals (18th century). Leonhard Euler and Alexis Clairaut used partial derivatives for problems in mechanics and the shape of the Earth (Clairaut's Théorie de la figure de la Terre, 1743, and Euler's work on the symmetry of mixed partials in the 1730s–40s). Euler and Joseph-Louis Lagrange evaluated double and triple integrals by changing variables, and Lagrange introduced multipliers in his Mécanique analytique (1788) for mechanical constraints.
- Potential theory and the divergence theorem. Lagrange (1762) and Carl Friedrich Gauss (1813, and his 1839–40 papers on potential theory) proved special cases of the divergence theorem; Mikhail Ostrogradsky in St Petersburg gave a general proof in 1826 (published 1831), which is why the theorem is also called the Ostrogradsky–Gauss theorem.
- Green and Stokes. George Green, a self-taught miller's son from Nottingham, published An Essay on the Application of Mathematical Analysis to the Theories of Electricity and Magnetism privately in 1828; it was rediscovered by William Thomson (Lord Kelvin) in 1845. The theorem now called Stokes's appeared in a letter from Thomson to George Gabriel Stokes in 1850, and Stokes set it as an examination question in Cambridge in 1854.
- Vector notation and forms. Josiah Willard Gibbs and Oliver Heaviside created vector analysis in the 1880s, in part to write James Clerk Maxwell's equations compactly. Élie Cartan developed differential forms (around 1899–1922), and Vito Volterra, Henri Poincaré and Cartan made the generalised Stokes theorem a single statement; Georges de Rham connected it with topology in 1931.
- Rigour. Cauchy and later Weierstrass, Jordan and Peano clarified the notion of differentiability in several variables; the definition via the best linear approximation is due to Otto Stolz (1893), William Henry Young (1910) and Maurice Fréchet (1911), the last in infinite-dimensional spaces.
Further reading
- John H. Hubbard and Barbara Burke Hubbard, Vector Calculus, Linear Algebra, and Differential Forms: A Unified Approach (1999; 5th edition 2015) — rigorous, with forms from the start.
- Jerrold E. Marsden and Anthony Tromba, Vector Calculus (1976; 6th edition 2012).
- Michael Spivak, Calculus on Manifolds (1965) — a short, classic path from the derivative as a linear map to the generalised Stokes theorem.
- Tom M. Apostol, Calculus, Volume II (2nd edition 1969).
- H. M. Schey, Div, Grad, Curl, and All That (1973) — vector calculus through electrostatics.
- Vladimir A. Zorich, Mathematical Analysis II (2004) — a thorough treatment including the change of variables theorem and differential forms.
Next in the Lumenary: ordinary differential equations, classical mechanics, curves and surfaces, complex analysis and optimisation.