Skip to content
The Lumenary
Early undergraduateUndergraduate (first or second year) 120 min

Classical mechanics

Newton's law as a differential equation — and how conservation of energy and angular momentum turn it into Kepler's ellipses, the swing of a pendulum and the principle of stationary action.

Formally verified · 11 LeanComputationally tested · 2 PythonAI-drafted · awaiting human reviewMathematically reviewed: Awaiting human review

Your guides: Chloe, Gideon, Margaret

MotivationH

From falling apples to elliptical orbits

Around 1600, Johannes Kepler, working from Tycho Brahe's careful naked-eye observations of Mars, found three empirical laws: planets move on ellipses with the Sun at a focus; the line from the Sun to a planet sweeps out equal areas in equal times; and the square of the period is proportional to the cube of the orbit's size. Two generations later Isaac Newton showed that all three follow from a single differential equation — his second law with a force varying as the inverse square of distance. It was the first great triumph of mathematical physics, and its methods are still the ones engineers use to put a satellite into orbit over Nairobi or to design a building in Santiago that survives earthquakes.

This lesson develops classical mechanics as mathematics: Newton's laws as ordinary differential equations, conservation laws as the tool that makes them solvable, the Kepler problem solved completely, oscillators from the pendulum to resonance, and Lagrange's reformulation through the principle of stationary action. It assumes ordinary differential equations and multivariable calculus (gradients, the chain rule, line integrals); the orbits are the conic sections of school geometry.

IntuitionH

State, force and what stays the same

The state of a particle at an instant is its position and its velocity: knowing where a ball is does not tell you where it will be, but knowing where it is and how it is moving does — once you know the forces. Newton's second law mr′′=Fm\mathbf r'' = \mathbf F is a second-order ODE, so by the Picard–Lindelöf theorem position and velocity at one instant determine the motion (for Lipschitz forces).

Solving such equations in closed form is usually impossible, but some combinations of position and velocity do not change along the motion — conserved quantities, such as energy and angular momentum. Each one confines the motion to a smaller set and lowers the effective dimension of the problem. For a ball rolling in a valley, conservation of energy alone tells you how high it will climb and how fast it moves at the bottom. For a planet, energy and angular momentum together are enough to find the orbit exactly.

DefinitionsH

Definitions

A particle of mass m>0m > 0 has position r(t)∈R3\mathbf r(t) \in \R^3, velocity v=r′\mathbf v = \mathbf r', acceleration a=r′′\mathbf a = \mathbf r'' and momentum p=mv\mathbf p = m\mathbf v.

Definition— Newton's laws

(1) In an inertial frame, a body on which no net force acts moves with constant velocity. (2) F=ma\mathbf F = m\mathbf a: the net force on a particle equals its mass times its acceleration (more generally F=p′\mathbf F = \mathbf p'). (3) If body 1 exerts a force F21\mathbf F_{21} on body 2, then body 2 exerts F12=−F21\mathbf F_{12} = -\mathbf F_{21} on body 1.

Definition— work, kinetic energy and conservative forces

The kinetic energy is T=12m∣v∣2T = \tfrac12 m|\mathbf v|^2. The work done by a force field F\mathbf F along a path is the line integral W=∫F⋅drW = \int \mathbf F \cdot d\mathbf r. A force field is conservative if F=−∇V\mathbf F = -\nabla V for a function VV, the potential energy; the total energy is E=T+VE = T + V.

Definition— angular momentum and central forces

The angular momentum about the origin is L=r×p=m r×v\mathbf L = \mathbf r \times \mathbf p = m\,\mathbf r \times \mathbf v, and the torque of a force is r×F\mathbf r \times \mathbf F. A force is central if it always points along r\mathbf r: F=f(r,t) r^\mathbf F = f(\mathbf r, t)\,\hat{\mathbf r} with r^=r/∣r∣\hat{\mathbf r} = \mathbf r/|\mathbf r| — for example gravity towards a fixed Sun.

Definition— Lagrangian and action

For a system described by generalised coordinates q=(q1,…,qn)q = (q_1, \dots, q_n) (angles, distances, …), the Lagrangian is L(q,q′,t)=T−V\mathcal L(q, q', t) = T - V, and the action of a path q(t)q(t), t1≤t≤t2t_1 \le t \le t_2, is S[q]=∫t1t2L(q(t),q′(t),t) dtS[q] = \int_{t_1}^{t_2} \mathcal L\big(q(t), q'(t), t\big)\,dt.

The weight of a body is the gravitational force on it, W=mg\mathbf W = m\mathbf g near the Earth's surface, where ∣g∣≈9.8 m/s2|\mathbf g| \approx 9.8\ \mathrm{m/s^2}. Mass is measured in kilograms; weight, a force, in newtons.

Worked examplesH

Worked examples

Example— A projectile

With constant gravity F=(0,−mg)\mathbf F = (0, -mg) and no air resistance, x′′=0x'' = 0 and y′′=−gy'' = -g. Integrating twice from launch at the origin — a football kicked from the ground, say — with speed v0v_0 at angle α\alpha:

x(t)=v0cos⁡α  t,y(t)=v0sin⁡α  t−12gt2.x(t) = v_0\cos\alpha\;t, \qquad y(t) = v_0\sin\alpha\;t - \tfrac12 g t^2 .

Eliminating tt gives a parabola y=xtan⁡α−gx22v02cos⁡2αy = x\tan\alpha - \frac{g x^2}{2 v_0^2\cos^2\alpha} (Galileo). The projectile lands at t=2v0sin⁡α/gt = 2v_0\sin\alpha/g, at distance R=v02sin⁡2α/gR = v_0^2\sin 2\alpha/g, largest for α=45∘\alpha = 45^\circ. The mass does not appear: in a vacuum, all bodies fall alike.

With linear air resistance −cv-c\mathbf v, the horizontal equation x′′=−(c/m)x′x'' = -(c/m)x' is linear and gives x(t)=mv0cos⁡αc(1−e−ct/m)x(t) = \frac{m v_0 \cos\alpha}{c}\big(1 - e^{-ct/m}\big): the range is now bounded however long the flight.

Example— Mass and weight on the Moon

An astronaut of mass 8080 kg weighs about 80×9.8≈78480 \times 9.8 \approx 784 N on Earth and about 80×1.62≈13080 \times 1.62 \approx 130 N on the Moon. Her mass — her resistance to acceleration — is the same 8080 kg in both places: pushing her sideways from rest to 11 m/s in one second takes the same 8080 N horizontal force on the Moon as on Earth.

Example— The harmonic oscillator

A mass on a spring obeys Hooke's law F=−kxF = -kx, so mx′′=−kxm x'' = -kx, that is x′′=−ω2xx'' = -\omega^2 x with ω=k/m\omega = \sqrt{k/m}. The solutions are x(t)=Acos⁡(ωt)+Bsin⁡(ωt)=Ccos⁡(ωt−φ)x(t) = A\cos(\omega t) + B\sin(\omega t) = C\cos(\omega t - \varphi), with period 2π/ω2\pi/\omega independent of the amplitude. The potential energy is V=12kx2V = \tfrac12 k x^2, and E=12mx′2+12kx2=12kC2E = \tfrac12 m x'^2 + \tfrac12 kx^2 = \tfrac12 kC^2 is constant.

The harmonic oscillator is universal: near any point x∗x^* where a smooth potential has a strict minimum (V′(x∗)=0<V′′(x∗)V'(x^*) = 0 < V''(x^*)), Taylor's theorem gives V(x)≈V(x∗)+12V′′(x∗)(x−x∗)2V(x) \approx V(x^*) + \tfrac12 V''(x^*)(x - x^*)^2, so small oscillations have angular frequency V′′(x∗)/m\sqrt{V''(x^*)/m} — to first approximation, with an error controlled by the cubic remainder.

ProofH

Conservation laws

Theorem— Theorem (work–energy theorem and conservation of energy)

Along any motion mr′′=Fm\mathbf r'' = \mathbf F, the change in kinetic energy equals the work done: T(t2)−T(t1)=∫t1t2F⋅v dtT(t_2) - T(t_1) = \int_{t_1}^{t_2} \mathbf F \cdot \mathbf v\,dt. If F=−∇V\mathbf F = -\nabla V is conservative, the total energy E=12m∣v∣2+V(r)E = \tfrac12 m|\mathbf v|^2 + V(\mathbf r) is constant.

Proof

T′=12m (v⋅v)′=m v⋅v′=F⋅vT' = \tfrac12 m\,(\mathbf v \cdot \mathbf v)' = m\,\mathbf v \cdot \mathbf v' = \mathbf F \cdot \mathbf v; integrate. If F=−∇V\mathbf F = -\nabla V, then by the chain rule ddtV(r(t))=∇V(r)⋅r′=−F⋅v\frac{d}{dt}V(\mathbf r(t)) = \nabla V(\mathbf r) \cdot \mathbf r' = -\mathbf F \cdot \mathbf v, so (T+V)′=0(T + V)' = 0, and a function with zero derivative on an interval is constant.

∎

In one dimension, energy conservation reduces Newton's equation to a first-order one: 12mx′2+V(x)=E\tfrac12 m x'^2 + V(x) = E gives x′=±2(E−V(x))/mx' = \pm\sqrt{2(E - V(x))/m}. The motion is confined to {x:V(x)≤E}\{x : V(x) \le E\}, reverses at turning points where V(x)=EV(x) = E, and between turning points x1<x2x_1 < x_2 (with V′(xi)≠0V'(x_i) \ne 0) it is periodic with period

T=2∫x1x2dx2(E−V(x))/m.T = 2\int_{x_1}^{x_2} \frac{dx}{\sqrt{2(E - V(x))/m}} .

For the pendulum θ′′=−(g/ℓ)sin⁡θ\theta'' = -(g/\ell)\sin\theta released from rest at angle θ0\theta_0, this integral is an elliptic integral, T=4ℓ/g K(sin⁡θ02)T = 4\sqrt{\ell/g}\,K\big(\sin\tfrac{\theta_0}{2}\big) — larger than the small-angle value 2πℓ/g2\pi\sqrt{\ell/g}, by about 18%18\% for θ0=90∘\theta_0 = 90^\circ (see the computation below).

The pendulum's phase plane (θ, θ′)

Closed curves are swings (energy below the top); wavy curves are full rotations; the curves through (±π, 0) separate them. Each curve is a level set of the energy.

Examples

x′ = y, y′ = −sin(x)

darker, longer arrows = faster forward in time backward in timeequilibrium (hollow = stable or centre)

Click the plane to start a trajectory, or type a start point below.

Start point

Trajectories: 4. They are numerical approximations (fourth-order Runge–Kutta), not exact formulas.

Nonlinear system. Equilibria found numerically in this window, classified by their linearisation (Jacobian matrix):

  1. 1. (−6.283, 0): centre: closed orbits around it (λ = 0 ± 1i)
  2. 2. (−3.142, 0): saddle (unstable) (λ = −1, 1)
  3. 3. (0, 0): centre: closed orbits around it (λ = 0 ± 1i)
  4. 4. (3.142, 0): saddle (unstable) (λ = −1, 1)
  5. 5. (6.283, 0): centre: closed orbits around it (λ = 0 ± 1i)

A centre of the linearisation is inconclusive for a nonlinear system: the true orbits may close up (as for the pendulum and predator–prey) or spiral slowly.

TDD = T²/41, 3, 52, 4
Trace T and determinant D: below the T-axis, saddles; above the dashed parabola D = T²/4, spirals; between them, nodes; on the upper D-axis, centres. Left of the D-axis is stable, right is unstable.

Theorem— Theorem (conservation of momentum)

For two particles interacting only with each other, with m1r1′′=F12m_1\mathbf r_1'' = \mathbf F_{12}, m2r2′′=F21m_2\mathbf r_2'' = \mathbf F_{21} and F12=−F21\mathbf F_{12} = -\mathbf F_{21}, the total momentum P=m1v1+m2v2\mathbf P = m_1\mathbf v_1 + m_2\mathbf v_2 is constant, and the centre of mass R=(m1r1+m2r2)/(m1+m2)\mathbf R = (m_1\mathbf r_1 + m_2\mathbf r_2)/(m_1 + m_2) moves with constant velocity.

Proof

P′=F12+F21=0\mathbf P' = \mathbf F_{12} + \mathbf F_{21} = 0 by the third law, and R′=P/(m1+m2)\mathbf R' = \mathbf P/(m_1 + m_2).

∎

The relative position r=r1−r2\mathbf r = \mathbf r_1 - \mathbf r_2 satisfies r′′=F12/m1−F21/m2=F12(1m1+1m2)\mathbf r'' = \mathbf F_{12}/m_1 - \mathbf F_{21}/m_2 = \mathbf F_{12}\left(\frac1{m_1} + \frac1{m_2}\right), i.e. μr′′=F12\mu\mathbf r'' = \mathbf F_{12} with the reduced mass μ=m1m2m1+m2\mu = \frac{m_1 m_2}{m_1 + m_2}. So the two-body problem reduces to a one-body problem; for gravity, F12=−Gm1m2 r/∣r∣3\mathbf F_{12} = -Gm_1m_2\,\mathbf r/|\mathbf r|^3 gives r′′=−G(m1+m2) r/∣r∣3\mathbf r'' = -G(m_1 + m_2)\,\mathbf r/|\mathbf r|^3, exactly the problem of one body attracted to a fixed centre of "mass" m1+m2m_1 + m_2.

Theorem— Theorem (central forces: angular momentum and planar motion)

Under a central force, the angular momentum L=m r×v\mathbf L = m\,\mathbf r \times \mathbf v is constant. If L≠0\mathbf L \ne 0, the motion stays in the plane through the origin perpendicular to L\mathbf L; if L=0\mathbf L = 0, it stays on a line through the origin.

Proof

L′=m v×v+r×mv′=0+r×f r^=0\mathbf L' = m\,\mathbf v \times \mathbf v + \mathbf r \times m\mathbf v' = 0 + \mathbf r \times f\,\hat{\mathbf r} = 0, since the cross product of parallel vectors vanishes. For every tt, r(t)⋅L=m r⋅(r×v)=0\mathbf r(t) \cdot \mathbf L = m\,\mathbf r \cdot (\mathbf r \times \mathbf v) = 0, because r×v\mathbf r \times \mathbf v is perpendicular to r\mathbf r; so r(t)\mathbf r(t) lies in the plane L⊥\mathbf L^\perp. If L=0\mathbf L = 0 then v∥r\mathbf v \parallel \mathbf r at all times (where r≠0\mathbf r \ne 0), so the direction r^\hat{\mathbf r} is constant (its derivative is the component of v/∣r∣\mathbf v/|\mathbf r| perpendicular to r\mathbf r) and the motion is radial.

∎

ProofH

The Kepler problem

Take the plane of motion with polar coordinates (r,θ)(r, \theta), and unit vectors er=(cos⁡θ,sin⁡θ)\mathbf e_r = (\cos\theta, \sin\theta) and eθ=(−sin⁡θ,cos⁡θ)\mathbf e_\theta = (-\sin\theta, \cos\theta). Differentiating r=r er\mathbf r = r\,\mathbf e_r with er′=θ′eθ\mathbf e_r' = \theta'\mathbf e_\theta and eθ′=−θ′er\mathbf e_\theta' = -\theta'\mathbf e_r:

v=r′ er+rθ′ eθ,a=(r′′−rθ′2) er+1r(r2θ′)′ eθ.\mathbf v = r'\,\mathbf e_r + r\theta'\,\mathbf e_\theta, \qquad \mathbf a = \big(r'' - r\theta'^2\big)\,\mathbf e_r + \frac1r\big(r^2\theta'\big)'\,\mathbf e_\theta .

The angular momentum has magnitude L=mr2θ′L = m r^2\theta'.

Theorem— Theorem (Kepler's second law)

Under any central force, the radius vector sweeps out area at the constant rate dAdt=12r2θ′=L2m\dfrac{dA}{dt} = \tfrac12 r^2\theta' = \dfrac{L}{2m}.

Proof

In time dtdt the radius sweeps a thin sector of angle dθd\theta and area 12r2 dθ\tfrac12 r^2\,d\theta (precisely: the area swept between angles θ1\theta_1 and θ2\theta_2 is ∫θ1θ212r2 dθ\int_{\theta_1}^{\theta_2}\tfrac12 r^2\,d\theta, and we change variables to tt). So dA/dt=12r2θ′=L/2mdA/dt = \tfrac12 r^2\theta' = L/2m, constant by the previous theorem.

∎

For a central force F=f(r) er\mathbf F = f(r)\,\mathbf e_r, the radial component of Newton's law is m(r′′−rθ′2)=f(r)m(r'' - r\theta'^2) = f(r). Using θ′=L/(mr2)\theta' = L/(mr^2) to eliminate θ\theta:

mr′′=f(r)+L2mr3,E=12mr′2+L22mr2+V(r)⏟Veff(r).m r'' = f(r) + \frac{L^2}{m r^3}, \qquad E = \tfrac12 m r'^2 + \underbrace{\frac{L^2}{2mr^2} + V(r)}_{V_{\text{eff}}(r)} .

The radial motion is one-dimensional motion in the effective potential VeffV_{\text{eff}}; the term L2/2mr2L^2/2mr^2 is a "centrifugal barrier" that keeps a body with L≠0L \ne 0 away from the centre.

The effective potential for gravity (m = k = 1)

An orbit with energy E between the minimum and 0 bounces between two turning radii: a bound orbit. With E ≥ 0 it escapes.

  • effective potential
  • gravitational potential −k/r
  • effective potential: y = −0.5
  • gravitational potential −k/r: y = −1

Theorem— Theorem (Kepler's first law: the orbits are conics)

Let f(r)=−k/r2f(r) = -k/r^2 with k>0k > 0 (for gravity, k=GMmk = GMm), and L≠0L \ne 0. Then the orbit is

r(θ)=p1+ecos⁡(θ−θ0),p=L2mk,e=1+2EL2mk2  ≥0,r(\theta) = \frac{p}{1 + e\cos(\theta - \theta_0)}, \qquad p = \frac{L^2}{mk}, \qquad e = \sqrt{1 + \frac{2EL^2}{mk^2}} \;\ge 0,

a conic section with a focus at the centre of force: an ellipse if E<0E < 0 (a circle if e=0e = 0), a parabola if E=0E = 0, and a branch of a hyperbola if E>0E > 0.

Proof

Binet's equation. Since θ′=L/(mr2)≠0\theta' = L/(mr^2) \ne 0, we may use θ\theta as the parameter. Put u=1/ru = 1/r and write u˙=du/dθ\dot u = du/d\theta. Then r′=drdθθ′=−u˙u2⋅Lu2m=−Lmu˙r' = \frac{dr}{d\theta}\theta' = -\frac{\dot u}{u^2}\cdot\frac{Lu^2}{m} = -\frac Lm\dot u, and r′′=−Lmu¨ θ′=−L2m2u2u¨r'' = -\frac Lm\ddot u\,\theta' = -\frac{L^2}{m^2}u^2\ddot u. Substituting into m(r′′−rθ′2)=fm(r'' - r\theta'^2) = f, with rθ′2=L2u3/m2r\theta'^2 = L^2u^3/m^2:

−L2mu2(u¨+u)=f(1/u)=−ku2,sou¨+u=mkL2=1p.-\frac{L^2}{m}u^2\left(\ddot u + u\right) = f(1/u) = -k u^2, \qquad\text{so}\qquad \ddot u + u = \frac{mk}{L^2} = \frac1p .

Solving it. This is a harmonic oscillator in θ\theta with a constant forcing term; its general solution is u=1p(1+ecos⁡(θ−θ0))u = \frac1p\big(1 + e\cos(\theta - \theta_0)\big) with constants e≥0e \ge 0 and θ0\theta_0. So r=p/(1+ecos⁡(θ−θ0))r = p/(1 + e\cos(\theta - \theta_0)).

It is a conic. Take θ0=0\theta_0 = 0. With x=rcos⁡θx = r\cos\theta, y=rsin⁡θy = r\sin\theta, the equation r+e rcos⁡θ=pr + e\,r\cos\theta = p says r=p−exr = p - ex; squaring, x2+y2=(p−ex)2x^2 + y^2 = (p - ex)^2, i.e. (1−e2)x2+2pex+y2=p2(1 - e^2)x^2 + 2pex + y^2 = p^2. For 0≤e<10 \le e < 1 this is an ellipse with one focus at the origin, for e=1e = 1 a parabola, for e>1e > 1 a hyperbola.

Eccentricity and energy. At the point closest to the centre (perihelion), r′=0r' = 0 and r=p/(1+e)r = p/(1 + e), so E=L22mr2−krE = \frac{L^2}{2mr^2} - \frac kr. Using L2m=kp\frac{L^2}{m} = kp, this is E=k2p(1+e)2−kp(1+e)=k2p(e2−1)E = \frac{k}{2p}(1 + e)^2 - \frac kp(1 + e) = \frac{k}{2p}(e^2 - 1). Hence e2=1+2pEk=1+2EL2mk2e^2 = 1 + \frac{2pE}{k} = 1 + \frac{2EL^2}{mk^2}, and e<1e < 1 exactly when E<0E < 0.

∎

Theorem— Theorem (Kepler's third law)

For an elliptic orbit with semi-major axis aa, the period TT satisfies

T2=4π2mk a3=4π2GM a3.T^2 = \frac{4\pi^2 m}{k}\,a^3 = \frac{4\pi^2}{GM}\,a^3 .

Proof

The perihelion and aphelion distances are p/(1+e)p/(1 + e) and p/(1−e)p/(1 - e), so 2a=2p1−e22a = \frac{2p}{1 - e^2}, a=p1−e2a = \frac{p}{1 - e^2}, and the semi-minor axis is b=a1−e2=pab = a\sqrt{1 - e^2} = \sqrt{pa}. By the second law the area πab\pi ab is swept at rate L/2mL/2m, so T=2mπabLT = \frac{2m\pi ab}{L} and

T2=4π2m2a2b2L2=4π2m2a3pL2=4π2mk a3,T^2 = \frac{4\pi^2 m^2 a^2 b^2}{L^2} = \frac{4\pi^2 m^2 a^3 p}{L^2} = \frac{4\pi^2 m}{k}\,a^3 ,

using p=L2/(mk)p = L^2/(mk). For gravity k=GMmk = GMm, and the planet's mass cancels.

∎

For two bodies (a planet that is not negligibly light), replace mm by the reduced mass μ\mu and GMGM by G(M+m)G(M + m); Kepler's third law then holds up to the factor 1+m/M1 + m/M, which is 1.0011.001 for Jupiter. The value a=−k/(2E)a = -k/(2E), obtained by combining a=p/(1−e2)a = p/(1 - e^2) with e2−1=2pE/ke^2 - 1 = 2pE/k, shows that the size of an orbit depends only on its energy.

Kepler orbits r = p / (1 + e cos θ)

Slide the eccentricity e from a circle (e = 0) towards a long ellipse; the Sun stays at a focus. At e = 1 the orbit opens into a parabola.

Sun (focus)
  • r = p/(1 + e·cos(θ))
  • (0.242, 0.242) · r = 0.342
ProofH

Damped and driven oscillators

Add friction proportional to velocity: mx′′+c x′+kx=0m x'' + c\,x' + kx = 0, or x′′+2γx′+ω02x=0x'' + 2\gamma x' + \omega_0^2 x = 0 with 2γ=c/m2\gamma = c/m and ω02=k/m\omega_0^2 = k/m. The energy E=12mx′2+12kx2E = \tfrac12 m x'^2 + \tfrac12 kx^2 now satisfies E′=x′(mx′′+kx)=−c x′2≤0E' = x'(mx'' + kx) = -c\,x'^2 \le 0: it decreases. The characteristic roots −γ±γ2−ω02-\gamma \pm \sqrt{\gamma^2 - \omega_0^2} give three regimes (see the ODE lesson):

  • underdamped (γ<ω0\gamma < \omega_0): x(t)=Ce−γtcos⁡(ωt−φ)x(t) = Ce^{-\gamma t}\cos(\omega t - \varphi) with ω=ω02−γ2\omega = \sqrt{\omega_0^2 - \gamma^2} — decaying oscillations;
  • critically damped (γ=ω0\gamma = \omega_0): x(t)=(A+Bt)e−γtx(t) = (A + Bt)e^{-\gamma t} — the fastest return without oscillating, roughly what a car's shock absorbers aim for;
  • overdamped (γ>ω0\gamma > \omega_0): a sum of two decaying exponentials.

Theorem— Proposition (forced oscillations and resonance)

For γ>0\gamma > 0, the equation x′′+2γx′+ω02x=F0mcos⁡Ωtx'' + 2\gamma x' + \omega_0^2 x = \frac{F_0}{m}\cos\Omega t has the particular solution xp(t)=Acos⁡(Ωt−δ)x_p(t) = A\cos(\Omega t - \delta) with

A(Ω)=F0/m(ω02−Ω2)2+4γ2Ω2,tan⁡δ=2γΩω02−Ω2,A(\Omega) = \frac{F_0/m}{\sqrt{(\omega_0^2 - \Omega^2)^2 + 4\gamma^2\Omega^2}}, \qquad \tan\delta = \frac{2\gamma\Omega}{\omega_0^2 - \Omega^2},

and every solution approaches xpx_p as t→∞t \to \infty.

Proof

Look for a complex solution z=ZeiΩtz = Ze^{i\Omega t} of z′′+2γz′+ω02z=F0meiΩtz'' + 2\gamma z' + \omega_0^2 z = \frac{F_0}{m}e^{i\Omega t}: substituting gives (ω02−Ω2+2iγΩ)Z=F0/m(\omega_0^2 - \Omega^2 + 2i\gamma\Omega)Z = F_0/m. Write ω02−Ω2+2iγΩ=ρeiδ\omega_0^2 - \Omega^2 + 2i\gamma\Omega = \rho e^{i\delta} with ρ=(ω02−Ω2)2+4γ2Ω2\rho = \sqrt{(\omega_0^2 - \Omega^2)^2 + 4\gamma^2\Omega^2}; then Z=F0mρe−iδZ = \frac{F_0}{m\rho}e^{-i\delta}, and since the equation has real coefficients, xp=Re⁡zx_p = \operatorname{Re} z solves the real equation. Any other solution differs from xpx_p by a solution of the damped homogeneous equation, which decays like e−γte^{-\gamma t} (or faster).

∎

When the damping is small, the amplitude is largest for driving frequencies near the natural frequency ω0\omega_0: at Ω=ω0\Omega = \omega_0 it is F02mγω0\frac{F_0}{2m\gamma\omega_0}, which grows without bound as γ→0\gamma \to 0. This is resonance — useful in radio tuners and musical instruments, dangerous in machinery and structures.

Resonance curves

Lower the damping and the peak near Ω = ω₀ grows like 1/(2γ/ω₀).

  • amplitude A(Ω), in units of F₀/(mω₀²)
  • amplitude A(Ω), in units of F₀/(mω₀²): y = 5
ProofH

Lagrangian mechanics and stationary action

Newton's law needs Cartesian coordinates and forces, including the forces of constraint that keep a bead on its wire or a pendulum bob on its circle. Lagrange (1788) found a formulation in any coordinates, with constraints built in. Its modern form is Hamilton's principle (1834): the motion between times t1t_1 and t2t_2 makes the action S[q]=∫t1t2L dtS[q] = \int_{t_1}^{t_2}\mathcal L\,dt stationary among all paths with the same endpoints.

Theorem— Lemma (fundamental lemma of the calculus of variations)

If gg is continuous on [t1,t2][t_1, t_2] and ∫t1t2g(t) η(t) dt=0\int_{t_1}^{t_2} g(t)\,\eta(t)\,dt = 0 for every C2C^2 function η\eta with η(t1)=η(t2)=0\eta(t_1) = \eta(t_2) = 0, then g≡0g \equiv 0.

Proof

Suppose g(s)>0g(s) > 0 at some ss in the open interval (the case g(s)<0g(s) < 0 is symmetric, and the endpoints follow by continuity). By continuity g>0g > 0 on some (s−δ,s+δ)⊂(t1,t2)(s - \delta, s + \delta) \subset (t_1, t_2). Let η(t)=(δ2−(t−s)2)3\eta(t) = \big(\delta^2 - (t - s)^2\big)^3 for ∣t−s∣<δ|t - s| < \delta and 00 otherwise; it is C2C^2 (it vanishes to third order at s±δs \pm \delta), non-negative, and positive at ss. Then ∫gη>0\int g\eta > 0, a contradiction.

∎

Theorem— Theorem (Euler–Lagrange equations)

Let L(q,q˙,t)\mathcal L(q, \dot q, t) be C2C^2, and let qq be a C2C^2 path such that, for every C2C^2 variation η\eta vanishing at t1t_1 and t2t_2, ddεS[q+εη]∣ε=0=0\frac{d}{d\varepsilon}S[q + \varepsilon\eta]\big|_{\varepsilon = 0} = 0. Then for each ii,

ddt∂L∂q˙i−∂L∂qi=0.\frac{d}{dt}\frac{\partial\mathcal L}{\partial\dot q_i} - \frac{\partial\mathcal L}{\partial q_i} = 0 .

Proof

Differentiating under the integral sign (legitimate since the integrand is C1C^1 in (ε,t)(\varepsilon, t) on a compact set) and integrating by parts,

0=ddεS[q+εη]∣ε=0=∫t1t2∑i(∂L∂qiηi+∂L∂q˙iηi′)dt=∫t1t2∑i(∂L∂qi−ddt∂L∂q˙i)ηi dt,0 = \frac{d}{d\varepsilon}S[q + \varepsilon\eta]\Big|_{\varepsilon=0} = \int_{t_1}^{t_2}\sum_i\left(\frac{\partial\mathcal L}{\partial q_i}\eta_i + \frac{\partial\mathcal L}{\partial\dot q_i}\eta_i'\right)dt = \int_{t_1}^{t_2}\sum_i\left(\frac{\partial\mathcal L}{\partial q_i} - \frac{d}{dt}\frac{\partial\mathcal L}{\partial\dot q_i}\right)\eta_i\,dt ,

the boundary terms [∂L∂q˙iηi]t1t2\big[\frac{\partial\mathcal L}{\partial\dot q_i}\eta_i\big]_{t_1}^{t_2} vanishing because η(t1)=η(t2)=0\eta(t_1) = \eta(t_2) = 0. Taking η\eta with only the ii-th component non-zero, the fundamental lemma gives the ii-th equation.

∎

Example— Three Lagrangians

  • A particle in a potential, Cartesian coordinates: L=12m∣q˙∣2−V(q)\mathcal L = \tfrac12 m|\dot{\mathbf q}|^2 - V(\mathbf q). Then ∂L/∂q˙i=mq˙i\partial\mathcal L/\partial\dot q_i = m\dot q_i and ∂L/∂qi=−∂V/∂qi\partial\mathcal L/\partial q_i = -\partial V/\partial q_i, so the Euler–Lagrange equations are mq′′=−∇Vm\mathbf q'' = -\nabla V: Newton's law.
  • The pendulum, with the angle θ\theta as coordinate: T=12mℓ2θ˙2T = \tfrac12 m\ell^2\dot\theta^2 and V=−mgℓcos⁡θV = -mg\ell\cos\theta, so mℓ2θ′′=−mgℓsin⁡θm\ell^2\theta'' = -mg\ell\sin\theta, i.e. θ′′=−gℓsin⁡θ\theta'' = -\frac g\ell\sin\theta. The tension in the rod never appears.
  • A central force in polar coordinates: L=12m(r˙2+r2θ˙2)−V(r)\mathcal L = \tfrac12 m(\dot r^2 + r^2\dot\theta^2) - V(r). The θ\theta-equation is ddt(mr2θ′)=0\frac{d}{dt}(mr^2\theta') = 0 — conservation of angular momentum, because L\mathcal L does not depend on θ\theta — and the rr-equation is mr′′−mrθ′2+V′(r)=0mr'' - mr\theta'^2 + V'(r) = 0, the radial equation used above.

Theorem— Proposition (conserved quantities from the Lagrangian)

Along solutions of the Euler–Lagrange equations: (1) if L\mathcal L does not depend on qiq_i (a cyclic coordinate), the conjugate momentum pi=∂L/∂q˙ip_i = \partial\mathcal L/\partial\dot q_i is constant; (2) if L\mathcal L does not depend explicitly on tt, the energy function h=∑iq˙i ∂L/∂q˙i−Lh = \sum_i \dot q_i\,\partial\mathcal L/\partial\dot q_i - \mathcal L is constant. When TT is a quadratic form in the velocities and VV does not depend on them, h=T+Vh = T + V.

Proof

(1) is the ii-th Euler–Lagrange equation. (2) By the chain rule,

dhdt=∑i(q¨i∂L∂q˙i+q˙iddt∂L∂q˙i)−∑i(∂L∂qiq˙i+∂L∂q˙iq¨i)−∂L∂t=∑iq˙i(ddt∂L∂q˙i−∂L∂qi)−∂L∂t,\frac{dh}{dt} = \sum_i\left(\ddot q_i\frac{\partial\mathcal L}{\partial\dot q_i} + \dot q_i\frac{d}{dt}\frac{\partial\mathcal L}{\partial\dot q_i}\right) - \sum_i\left(\frac{\partial\mathcal L}{\partial q_i}\dot q_i + \frac{\partial\mathcal L}{\partial\dot q_i}\ddot q_i\right) - \frac{\partial\mathcal L}{\partial t} = \sum_i\dot q_i\left(\frac{d}{dt}\frac{\partial\mathcal L}{\partial\dot q_i} - \frac{\partial\mathcal L}{\partial q_i}\right) - \frac{\partial\mathcal L}{\partial t},

which is 00. If T=12∑aij(q)q˙iq˙jT = \tfrac12\sum a_{ij}(q)\dot q_i\dot q_j, Euler's theorem on homogeneous functions gives ∑q˙i ∂T/∂q˙i=2T\sum\dot q_i\,\partial T/\partial\dot q_i = 2T, so h=2T−(T−V)=T+Vh = 2T - (T - V) = T + V.

∎

These are the simplest cases of Noether's theorem (Emmy Noether, 1918): every continuous symmetry of the action gives a conserved quantity — translations give momentum, rotations angular momentum, time translations energy.

Formal mathematicsF

Mechanics in Lean

Mathlib has no physics, but it has the calculus to state Newton's law exactly: a motion is a pair r,v:R→E\mathbf r, \mathbf v : \R \to E with HasDerivAt r (v t) t and HasDerivAt v (a t) t. Each conservation law is then proved as in the lesson: differentiate the conserved quantity, get 00, and conclude it is constant.

First, uniform gravity — position, velocity and acceleration of a projectile:

projectileLean 4Proved here from basic factsFormally verified
/-- A projectile in uniform gravity: the height `y(t) = y₀ + v₀ t - g t²/2` has velocity
`v(t) = v₀ - g t`, whose derivative is the constant acceleration `-g`. -/
theorem projectile (y₀ v₀ g t : ℝ) :
    HasDerivAt (fun s => y₀ + v₀ * s - g * s ^ 2 / 2) (v₀ - g * t) t ∧
      HasDerivAt (fun s => v₀ - g * s) (-g) t := by
  constructor
  · have h := (((hasDerivAt_id' t).const_mul v₀).const_add y₀).sub
      ((hasDerivAt_pow 2 t).const_mul g |>.div_const 2)
    convert h using 1
    push_cast
    ring
  · have h := ((hasDerivAt_id' t).const_mul g).const_sub v₀
    convert h using 1
    ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor

Conservation of energy, in any real inner product space (so in R3\R^3, but also for systems with many particles), for a force −∇V-\nabla V given by Mathlib's HasGradientAt. The proof is the human one: E′=m⟨v,v′⟩+⟨∇V(r),r′⟩=0E' = m\langle \mathbf v, \mathbf v'\rangle + \langle\nabla V(\mathbf r), \mathbf r'\rangle = 0.

energy_conservationLean 4Proved here from basic factsFormally verified
/-- **Conservation of energy** for a conservative force, in any (real inner product) space.
Suppose the particle of mass `m ≠ 0` moves by Newton's law with force `F = -∇V`: `r' = v` and
`v' = -(1/m) ∇V(r)`. Then the total energy `E = ½ m ⟪v, v⟫ + V(r)` is constant. Proof: by the
product and chain rules, `E' = m ⟪v, v'⟫ + ⟪∇V(r), r'⟫ = -⟪v, ∇V(r)⟫ + ⟪∇V(r), v⟫ = 0`. -/
theorem energy_conservation {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
    [CompleteSpace E] {m : ℝ} (hm : m ≠ 0) {V : E → ℝ} {gradV : E → E}
    (hV : ∀ x, HasGradientAt V (gradV x) x) {r v : ℝ → E}
    (hr : ∀ t, HasDerivAt r (v t) t) (hv : ∀ t, HasDerivAt v (-(1 / m) • gradV (r t)) t)
    (s t : ℝ) :
    m / 2 * inner ℝ (v s) (v s) + V (r s) = m / 2 * inner ℝ (v t) (v t) + V (r t) := by
  have hE : ∀ τ, HasDerivAt (fun τ => m / 2 * inner ℝ (v τ) (v τ) + V (r τ)) 0 τ := by
    intro τ
    have hkin := ((hv τ).inner ℝ (hv τ)).const_mul (m / 2)
    have hpot := (hasGradientAt_iff_hasFDerivAt.mp (hV (r τ))).comp_hasDerivAt τ (hr τ)
    have h := hkin.add hpot
    convert h using 1
    · rfl
    · simp only [InnerProductSpace.toDual_apply_apply, inner_smul_right, inner_smul_left,
        real_inner_comm (gradV (r τ)) (v τ), RCLike.conj_to_real]
      field_simp
      ring
  exact is_const_of_deriv_eq_zero (fun τ => (hE τ).differentiableAt) (fun τ => (hE τ).deriv) s t
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor

Angular momentum. The library facts v×v=0\mathbf v \times \mathbf v = 0 and r⋅(r×v)=0\mathbf r \cdot (\mathbf r \times \mathbf v) = 0, then conservation of r×v\mathbf r \times \mathbf v under any force parallel to r\mathbf r (checked coordinate by coordinate), and its consequence that the motion is planar:

cross_self_zeroLean 4Applies a library theoremFormally verified
/-- The cross product of a vector with itself is zero (Mathlib's `cross_self`). It is why the
term `v × (m v)` drops out of `d/dt (r × m v) = v × m v + r × m v'`. -/
theorem cross_self_zero (v : Fin 3 → ℝ) : v ⨯₃ v = 0 :=
  cross_self v
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor
angular_momentum_conservedLean 4Proved here from basic factsFormally verified
/-- **Conservation of angular momentum** under a central force. If `r' = v` and `v' = k(t) r`
(acceleration always parallel to the position vector, as for any central force), then
`L = r × v` has derivative `v × v + r × (k r) = 0`, so it is constant. We check the derivative
coordinate by coordinate (`hasDerivAt_pi`). -/
theorem angular_momentum_conserved {r v : ℝ → Fin 3 → ℝ} {k : ℝ → ℝ}
    (hr : ∀ t, HasDerivAt r (v t) t) (hv : ∀ t, HasDerivAt v (k t • r t) t) (s t : ℝ) :
    r s ⨯₃ v s = r t ⨯₃ v t := by
  have hL : ∀ τ, HasDerivAt (fun τ => r τ ⨯₃ v τ) 0 τ := by
    intro τ
    rw [hasDerivAt_pi]
    have hri : ∀ i, HasDerivAt (fun τ => r τ i) (v τ i) τ := hasDerivAt_pi.mp (hr τ)
    have hvi : ∀ i, HasDerivAt (fun τ => v τ i) (k τ * r τ i) τ := by
      intro i
      simpa using hasDerivAt_pi.mp (hv τ) i
    intro i
    fin_cases i
    · have h := ((hri 1).mul (hvi 2)).sub ((hri 2).mul (hvi 1))
      convert h using 1
      · funext τ; simp [cross_apply]
      · simp; ring
    · have h := ((hri 2).mul (hvi 0)).sub ((hri 0).mul (hvi 2))
      convert h using 1
      · funext τ; simp [cross_apply]
      · simp; ring
    · have h := ((hri 0).mul (hvi 1)).sub ((hri 1).mul (hvi 0))
      convert h using 1
      · funext τ; simp [cross_apply]
      · simp; ring
  exact is_const_of_deriv_eq_zero (fun τ => (hL τ).differentiableAt) (fun τ => (hL τ).deriv) s t
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor
dot_self_cross_zeroLean 4Applies a library theoremFormally verified
/-- A vector is perpendicular to its cross product with any other vector:
`r · (r × v) = 0` (Mathlib's `dot_self_cross`). -/
theorem dot_self_cross_zero (r v : Fin 3 → ℝ) : r ⬝ᵥ (r ⨯₃ v) = 0 :=
  dot_self_cross r v
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor
motion_in_planeLean 4Proved here from basic factsFormally verified
/-- **Central-force motion is planar.** Under the hypotheses of `angular_momentum_conserved`,
the position `r(t)` is perpendicular to the constant vector `L = r(0) × v(0)` at every time,
so (when `L ≠ 0`) the particle stays in the plane through the origin perpendicular to `L`. -/
theorem motion_in_plane {r v : ℝ → Fin 3 → ℝ} {k : ℝ → ℝ}
    (hr : ∀ t, HasDerivAt r (v t) t) (hv : ∀ t, HasDerivAt v (k t • r t) t) (t : ℝ) :
    r t ⬝ᵥ (r 0 ⨯₃ v 0) = 0 := by
  rw [angular_momentum_conserved hr hv 0 t]
  exact dot_self_cross_zero (r t) (v t)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor

Kepler's first law, in two formal pieces: the conic u=(1+ecos⁡θ)/pu = (1 + e\cos\theta)/p solves Binet's equation u¨+u=1/p\ddot u + u = 1/p, and a curve r(1+ecos⁡θ)=pr(1 + e\cos\theta) = p is the conic (1−e2)x2+2pex+y2=p2(1 - e^2)x^2 + 2pex + y^2 = p^2 in Cartesian coordinates:

binet_conicLean 4Proved here from basic factsFormally verified
/-- The orbit equation. With `u = 1/r` as a function of the polar angle `θ`, the inverse-square
law gives Binet's equation `u'' + u = 1/p`. Its solutions `u(θ) = (1 + e cos θ)/p` (for constants
`e`, `p` with `p ≠ 0`) indeed satisfy it: `u' = -(e/p) sin θ`, `u'' = -(e/p) cos θ`. -/
theorem binet_conic (e p θ : ℝ) :
    HasDerivAt (fun φ => (1 + e * cos φ) / p) (-(e / p) * sin θ) θ ∧
      HasDerivAt (fun φ => -(e / p) * sin φ) (1 / p - (1 + e * cos θ) / p) θ := by
  constructor
  · have h := (((hasDerivAt_cos θ).const_mul e).const_add 1).div_const p
    convert h using 1
    ring
  · have h := (hasDerivAt_sin θ).const_mul (-(e / p))
    convert h using 1
    ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor
orbit_is_conicLean 4Proved here from basic factsFormally verified
/-- **Kepler's first law, the geometric step.** If a point at distance `r ≥ 0` from the origin and
polar angle `θ` lies on the orbit `r (1 + e cos θ) = p`, then its Cartesian coordinates
`x = r cos θ`, `y = r sin θ` satisfy `(1 - e²) x² + 2 p e x + y² = p²`: a conic with a focus at
the origin — an ellipse if `0 ≤ e < 1` (a circle if `e = 0`), a parabola if `e = 1`, a hyperbola
branch if `e > 1`. Proof: `r = p - e x`, and `x² + y² = r²`. -/
theorem orbit_is_conic {r θ e p : ℝ} (horbit : r * (1 + e * cos θ) = p) :
    (1 - e ^ 2) * (r * cos θ) ^ 2 + 2 * p * e * (r * cos θ) + (r * sin θ) ^ 2 = p ^ 2 := by
  have hr : r = p - e * (r * cos θ) := by linarith
  have hpyth : (r * cos θ) ^ 2 + (r * sin θ) ^ 2 = r ^ 2 := by
    have := sin_sq_add_cos_sq θ
    calc (r * cos θ) ^ 2 + (r * sin θ) ^ 2 = r ^ 2 * (sin θ ^ 2 + cos θ ^ 2) := by ring
      _ = r ^ 2 := by rw [this, mul_one]
  calc (1 - e ^ 2) * (r * cos θ) ^ 2 + 2 * p * e * (r * cos θ) + (r * sin θ) ^ 2
      = ((r * cos θ) ^ 2 + (r * sin θ) ^ 2) - (e * (r * cos θ)) ^ 2
          + 2 * p * (e * (r * cos θ)) := by ring
    _ = r ^ 2 - (e * (r * cos θ)) ^ 2 + 2 * p * (e * (r * cos θ)) := by rw [hpyth]
    _ = (p - e * (r * cos θ)) ^ 2 - (e * (r * cos θ)) ^ 2 + 2 * p * (e * (r * cos θ)) := by
        rw [← hr]
    _ = p ^ 2 := by ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor

The two algebraic computations behind the relation between energy and eccentricity, and behind the third law (the inputs — the perihelion distance, the area of the ellipse and the areal velocity — are taken from the human proofs):

eccentricity_energyLean 4Proved here from basic factsFormally verified
/-- **Energy determines the shape.** At perihelion the radial velocity is `0` and
`r = p/(1 + e)`, so the energy is `E = L²/(2 m r²) - k/r`. With `p = L²/(m k)` this equals
`k (e² - 1)/(2p)`: hence `e < 1` (an ellipse) exactly when `E < 0`. -/
theorem eccentricity_energy {m k L e : ℝ} (hm : 0 < m) (hk : 0 < k) (hL : L ≠ 0)
    (he : 0 ≤ e) :
    let p := L ^ 2 / (m * k)
    let r := p / (1 + e)
    L ^ 2 / (2 * m * r ^ 2) - k / r = k * (e ^ 2 - 1) / (2 * p) := by
  intro p r
  have hp : p ≠ 0 := by positivity
  have h1e : 1 + e ≠ 0 := by positivity
  have hr : r ≠ 0 := div_ne_zero hp h1e
  have hpL : L ^ 2 = p * (m * k) := by
    simp only [p]; field_simp
  simp only [r]
  rw [hpL]
  field_simp
  ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor
kepler_third_lawLean 4Proved here from basic factsFormally verified
/-- **Kepler's third law, the algebraic step.** An ellipse with semi-latus rectum
`p = L²/(m k)` and semi-major axis `a` has semi-minor axis `b` with `b² = p a` (since
`a = p/(1 - e²)` and `b = a √(1 - e²)`). Its area `πab` is swept at the constant rate `L/(2m)`,
so the period is `T = πab / (L/(2m))`. Then `T² = 4π² m a³ / k`. -/
theorem kepler_third_law {m k L a b T : ℝ} (hm : 0 < m) (hk : 0 < k) (hL : L ≠ 0)
    (hb : b ^ 2 = L ^ 2 / (m * k) * a) (hT : T = π * a * b / (L / (2 * m))) :
    T ^ 2 = 4 * π ^ 2 * m * a ^ 3 / k := by
  have hm0 : m ≠ 0 := hm.ne'
  have hk0 : k ≠ 0 := hk.ne'
  rw [hT]
  calc (π * a * b / (L / (2 * m))) ^ 2 = 4 * π ^ 2 * m ^ 2 * a ^ 2 * b ^ 2 / L ^ 2 := by
        field_simp
        ring
    _ = 4 * π ^ 2 * m * a ^ 3 / k := by
        rw [hb]
        field_simp
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor

The damped oscillator: x=e−γtcos⁡ωtx = e^{-\gamma t}\cos\omega t solves x′′+2γx′+(γ2+ω2)x=0x'' + 2\gamma x' + (\gamma^2 + \omega^2)x = 0:

damped_oscillatorLean 4Proved here from basic factsFormally verified
/-- The underdamped oscillator `x'' + 2γ x' + ω₀² x = 0` with `ω₀² = γ² + ω²` is solved by
`x(t) = e^{-γt} cos(ωt)`: we compute its velocity `v` and check `v' = -2γ v - ω₀² x`. -/
theorem damped_oscillator (γ ω t : ℝ) :
    HasDerivAt (fun s => exp (-γ * s) * cos (ω * s))
        (exp (-γ * t) * (-γ * cos (ω * t) - ω * sin (ω * t))) t ∧
      HasDerivAt (fun s => exp (-γ * s) * (-γ * cos (ω * s) - ω * sin (ω * s)))
        (-2 * γ * (exp (-γ * t) * (-γ * cos (ω * t) - ω * sin (ω * t)))
          - (γ ^ 2 + ω ^ 2) * (exp (-γ * t) * cos (ω * t))) t := by
  have hl : ∀ c : ℝ, HasDerivAt (fun s => c * s) c t := fun c => by
    simpa using (hasDerivAt_id' t).const_mul c
  have he := (hl (-γ)).exp
  constructor
  · have h := he.mul (hl ω).cos
    convert h using 1
    ring
  · have h := he.mul ((((hl ω).cos).const_mul (-γ)).sub (((hl ω).sin).const_mul ω))
    convert h using 1
    simp only [Pi.sub_apply]
    ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ClassicalMechanics.leanTry it in the Lean web editor

What is and is not formalised. Independently proved: the projectile, energy conservation for conservative forces, conservation of angular momentum and planarity under central forces, the Binet solution, the conic identity, the algebra of the energy–eccentricity relation and of the third law, and the damped oscillator. Cited from Mathlib: the two cross-product identities. Not formalised: the derivation of Binet's equation from Newton's law (the change of parameter from tt to θ\theta), the area of an ellipse and the areal-velocity argument of Kepler's second law, the reduction of the two-body problem, the resonance formula, and the Euler–Lagrange equations, whose proof needs differentiation under the integral sign and the fundamental lemma — all within reach of Mathlib, but not done here.

ComputationC

Simulating orbits and pendulums

Integrating Newton's equations numerically is how real orbits are computed. But the choice of method matters: the velocity Verlet (leapfrog) method, used in molecular dynamics and celestial mechanics, respects the geometry of mechanics — it is symplectic and conserves angular momentum exactly for central forces — while the explicit Euler method spirals outwards and gains energy. The first experiment checks Kepler's predictions (eccentricity, perihelion, aphelion and period) against a simulation:

Kepler orbits: Verlet versus EulerPythonNumerical approximationComputationally tested
"""Kepler's laws from Newton's law, numerically - and why the integrator matters.

We integrate r'' = -r / |r|^3 (units with GM = 1) from r(0) = (1, 0),
v(0) = (0, 1.2). Theory: energy E = -0.28, angular momentum L = 1.2, an
ellipse with eccentricity e = sqrt(1 + 2 E L^2) = 0.44, semi-major axis
a = -1/(2E), perihelion a(1 - e) = 1 and period 2 pi a^(3/2). The velocity
Verlet (leapfrog) method conserves L exactly (up to rounding) and keeps E
within a small bounded band; explicit Euler spirals outwards, gaining energy.

Runs unchanged in the browser (Pyodide) using only the standard library.
"""

import math

def accel(x, y):
    """Inverse-square attraction towards the origin, GM = 1."""
    r3 = (x * x + y * y) ** 1.5
    return -x / r3, -y / r3

def energy(x, y, vx, vy):
    """Energy per unit mass: kinetic plus potential -1/r."""
    return 0.5 * (vx * vx + vy * vy) - 1 / math.hypot(x, y)

def ang_mom(x, y, vx, vy):
    """Angular momentum per unit mass, x vy - y vx."""
    return x * vy - y * vx

def verlet_step(state, h):
    """One velocity Verlet (leapfrog) step."""
    x, y, vx, vy = state
    ax, ay = accel(x, y)
    vx, vy = vx + h / 2 * ax, vy + h / 2 * ay
    x, y = x + h * vx, y + h * vy
    ax, ay = accel(x, y)
    return x, y, vx + h / 2 * ax, vy + h / 2 * ay

def euler_step(state, h):
    """One explicit Euler step."""
    x, y, vx, vy = state
    ax, ay = accel(x, y)
    return x + h * vx, y + h * vy, vx + h * ax, vy + h * ay

def run(step, state, h, n):
    """Apply n steps; return the list of states (including the initial one)."""
    states = [state]
    for _ in range(n):
        state = step(state, h)
        states.append(state)
    return states

def first_return_time(states, h):
    """Time of the first upward crossing of y = 0 with x > 0 after the start."""
    for i in range(1, len(states)):
        (x0, y0, _, _), (x1, y1, _, _) = states[i - 1], states[i]
        if i > 1 and y0 < 0 <= y1 and x1 > 0:
            return (i - 1 + (-y0) / (y1 - y0)) * h
    return None

def kepler_predictions(state):
    """Energy, angular momentum, eccentricity, semi-major axis and period."""
    E = energy(*state)
    L = ang_mom(*state)
    e = math.sqrt(1 + 2 * E * L * L)
    a = -1 / (2 * E)
    return E, L, e, a, 2 * math.pi * a**1.5

def main():
    start = (1.0, 0.0, 0.0, 1.2)
    E, L, e, a, T = kepler_predictions(start)
    print(f"Theory: E = {E:.4f}, L = {L:.4f}, e = {e:.4f}, a = {a:.4f}")
    print(f"        perihelion {a * (1 - e):.4f}, aphelion {a * (1 + e):.4f},"
          f" period {T:.4f}")
    h, n = 0.001, 60000  # about four orbits
    for name, step in [("Verlet", verlet_step), ("Euler", euler_step)]:
        states = run(step, start, h, n)
        radii = [math.hypot(s[0], s[1]) for s in states]
        energies = [energy(*s) for s in states]
        momenta = [ang_mom(*s) for s in states]
        print(f"{name} (h = {h}, {n} steps):")
        e_drift = max(abs(en - E) for en in energies)
        print(f"   max |E(t) - E(0)| = {e_drift:.2e}")
        drift = max(abs(m - L) for m in momenta)
        print(f"   max |L(t) - L(0)| = {drift:.2e}")
        print(f"   r ranges over [{min(radii):.4f}, {max(radii):.4f}]")
        ret = first_return_time(states, h)
        shown = f"{ret:.4f}" if ret else "none"
        print(f"   first return to the x-axis at t = {shown}")
    print()
    print("Epistemic status: numerical integration of one orbit. Verlet keeps L")
    print("constant to rounding error and E in a narrow band, matching Kepler's")
    print("predictions to several digits; Euler drifts outwards. The laws")
    print("themselves are theorems proved in the lesson, not consequences of")
    print("this simulation.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The second compares three answers to "how long does a pendulum take to swing?": the small-angle law, the exact formula from energy conservation (an elliptic integral, which Gauss's arithmetic–geometric mean evaluates with astonishing speed), and a simulation.

Pendulum period: small angles, elliptic integrals, simulationPythonNumerical approximationExact computationComputationally tested
"""The period of a pendulum: small-angle law, exact formula and simulation.

For theta'' = -(g/l) sin theta released from rest at amplitude theta0,
conservation of energy gives the exact period
    T = 4 sqrt(l/g) K(k),  k = sin(theta0 / 2),
where K is the complete elliptic integral of the first kind. Gauss's
arithmetic-geometric mean computes it: K(k) = pi / (2 AGM(1, sqrt(1 - k^2))).
We compare this with the small-angle period 2 pi sqrt(l/g), with the series
T0 (1 + theta0^2/16 + 11 theta0^4/3072), and with a numerical simulation.

Runs unchanged in the browser (Pyodide) using only the standard library.
"""

import math

def agm(a, b, tol=1e-15):
    """Arithmetic-geometric mean of positive a and b."""
    if a <= 0 or b <= 0:
        raise ValueError("AGM needs positive numbers")
    while abs(a - b) > tol * a:
        a, b = (a + b) / 2, math.sqrt(a * b)
    return a

def exact_period(theta0, omega0=1.0):
    """Exact period 2 pi / (omega0 AGM(1, cos(theta0/2))), for 0 <= theta0 < pi."""
    if not 0 <= theta0 < math.pi:
        raise ValueError("amplitude must lie in [0, pi)")
    return 2 * math.pi / (omega0 * agm(1.0, math.cos(theta0 / 2)))

def series_period(theta0, omega0=1.0):
    """Two-term series T0 (1 + theta0^2/16 + 11 theta0^4/3072)."""
    t0 = 2 * math.pi / omega0
    return t0 * (1 + theta0**2 / 16 + 11 * theta0**4 / 3072)

def simulated_period(theta0, h=1e-3):
    """Period from velocity Verlet: four times the time to first reach theta = 0."""
    theta, omega, t = theta0, 0.0, 0.0
    while True:
        a = -math.sin(theta)
        omega_half = omega + h / 2 * a
        new_theta = theta + h * omega_half
        omega = omega_half + h / 2 * (-math.sin(new_theta))
        if new_theta <= 0 < theta:
            frac = theta / (theta - new_theta)
            return 4 * (t + frac * h)
        theta, t = new_theta, t + h

def main():
    print("Pendulum with g/l = 1 (small-angle period 2 pi = 6.283185)")
    print("amplitude   exact (AGM)   series      simulated    exact / 2pi")
    for degrees in [5, 30, 60, 90, 120, 150, 170]:
        theta0 = math.radians(degrees)
        ex = exact_period(theta0)
        se = series_period(theta0)
        si = simulated_period(theta0)
        ratio = ex / (2 * math.pi)
        print(f"  {degrees:3d} deg    {ex:9.6f}   {se:9.6f}   {si:9.6f}"
              f"    {ratio:8.4f}")
    print("Small swings are almost isochronous (Galileo's observation), but a")
    print("swing of 90 degrees takes 18% longer, and the period grows without")
    print("bound as the amplitude approaches 180 degrees (the inverted pendulum")
    print("is an unstable equilibrium).")
    print()
    print("Epistemic status: the exact column evaluates a proved formula")
    print("(energy conservation plus Gauss's AGM identity for elliptic")
    print("integrals) in floating point; the simulated column is numerical")
    print("evidence that agrees with it to about six digits.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Both are numerical: the exact period formula is a theorem evaluated in floating point, and the simulations are evidence that agrees with the theory to many digits — not a substitute for the proofs above.

Exercises

Exercises

1. Classical mechanics

Warm-upHuman

A football is kicked from the ground at 20 m/s20\ \mathrm{m/s}, at 45∘45^\circ above the horizontal. Ignoring air resistance and taking g=10 m/s2g = 10\ \mathrm{m/s^2}, how far away (in metres) does it land?

2. Classical mechanics

Warm-upHuman

An astronaut has mass 7070 kg. On the Moon (g≈1.6 m/s2g \approx 1.6\ \mathrm{m/s^2}), which statement is correct?

Choose one

3. Classical mechanics

Warm-upHuman

A hockey puck slides in a straight line at constant speed across perfectly frictionless ice. What is the net horizontal force on it?

Choose one

4. Classical mechanics

CoreHuman

A mass of 0.50.5 kg hangs on a spring of stiffness k=18 N/mk = 18\ \mathrm{N/m}. What is the angular frequency ω\omega of its small oscillations, in rad/s?

5. Classical mechanics

CoreHuman

An asteroid orbits the Sun on an ellipse with semi-major axis 44 AU (Earth's is 11 AU, with period 11 year). Using Kepler's third law, what is its period in years?

6. Classical mechanics

CoreHuman

A particle moves under a central force F=f(r,t) r^\mathbf F = f(\mathbf r, t)\,\hat{\mathbf r} (always pointing along the line to the origin). Which of the following are guaranteed to be constant? (Select all that apply.)

Choose all that apply

7. Classical mechanics

StretchHuman

A comet moves under the Sun's gravity with total energy E>0E > 0 and angular momentum L≠0L \ne 0. What is the shape of its orbit?

Choose one

8. Classical mechanics

StretchHuman

For a particle in the plane under a central potential, L=12m(r˙2+r2θ˙2)−V(r)\mathcal L = \tfrac12 m(\dot r^2 + r^2\dot\theta^2) - V(r). What is the Euler–Lagrange equation for θ\theta?

Choose one

9. Classical mechanics

StretchFormal

In Lean, r v : ℝ → Fin 3 → ℝ describe a motion with hr : ∀ t, HasDerivAt r (v t) t. Which extra hypothesis expresses “the force is central”, so that r t ⨯₃ v t is constant?

Choose one

10. Classical mechanics

StretchComputational

Write verlet(x0, v0, h, n, accel) implementing the velocity Verlet method for x′′=a(x)x'' = a(x): each step does v←v+h2a(x)v \leftarrow v + \tfrac h2 a(x), then x←x+hvx \leftarrow x + h v, then v←v+h2a(x)v \leftarrow v + \tfrac h2 a(x). Return the final (x, v). Test it on the harmonic oscillator a(x)=−xa(x) = -x: after one period 2π2\pi the state should return to its start, and the energy 12v2+12x2\tfrac12 v^2 + \tfrac12 x^2 should stay almost constant.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Common misconceptionsH

Common misconceptions

Misconception

"A force is needed to keep an object moving." Newton's first law says the opposite: with no net force, velocity stays constant. Everyday experience misleads because friction and air resistance are forces that slow things down; a hockey puck on smooth ice, or a space probe coasting between planets, keeps moving with no push. A force is needed to change velocity — to speed up, slow down or turn.

Misconception

"Mass and weight are the same thing." Mass (mm, in kg) measures resistance to acceleration and is the same everywhere; weight (mgm\mathbf g, in newtons) is the gravitational force and depends on where you are — about one sixth as much on the Moon. Bathroom scales measure a force and are calibrated to display kilograms for Earth's gg. (That all bodies fall with the same acceleration, because gravitational and inertial mass are equal, is a deep experimental fact — the starting point of general relativity.)

Misconception

"A planet in orbit feels an outward centrifugal force that balances gravity." In an inertial frame the only force on the planet is gravity, which points inwards and supplies the centripetal acceleration v2/rv^2/r of circular motion. "Centrifugal force" is a fictitious force that appears only when one describes the motion in a rotating frame of reference.

Misconception

"Nature minimises the action." The principle is that the action is stationary. For short time intervals the true path does minimise it, but not in general: for a harmonic oscillator of period PP, the true path is not a minimum among paths over a time interval longer than P/2P/2 (the first conjugate point, in Jacobi's theory).

Misconception

"Heavier objects fall faster." Without air resistance, all bodies near the Earth fall with the same acceleration gg: the mass cancels in ma=mgm\mathbf a = m\mathbf g. With air resistance the drag force depends on shape and speed, which is why a feather and a hammer fall differently on Earth — and identically on the Moon, as the Apollo 15 astronauts showed in 1971.

ViewpointsH

Many ways of seeing

Geometry— Configuration spaces, phase space and the hidden symmetry of Kepler orbits

The positions of a mechanical system form a configuration space, typically a manifold: a circle S1S^1 for a pendulum, a torus S1×S1S^1 \times S^1 for a double pendulum, the rotation group SO(3)SO(3) for a rigid body. Positions and momenta together form phase space, the cotangent bundle T∗QT^*Q, which carries a canonical symplectic form; Hamilton's equations q˙=∂H/∂p\dot q = \partial H/\partial p, p˙=−∂H/∂q\dot p = -\partial H/\partial q say that the motion is the flow of the vector field determined by the energy HH and this form (see symplectic geometry). The Kepler problem has a striking geometric feature: besides L\mathbf L, the Laplace–Runge–Lenz vector A=p×L−mk r^\mathbf A = \mathbf p \times \mathbf L - mk\,\hat{\mathbf r} is conserved. It points to the perihelion and has length mkemke, and r⋅A=L2−mkr\mathbf r \cdot \mathbf A = L^2 - mkr gives the conic equation r=p/(1+ecos⁡θ)r = p/(1 + e\cos\theta) in one line. Its conservation reflects a hidden four-dimensional rotational symmetry of the bound orbits (exploited by Fock in 1935 for the hydrogen atom) and explains why the orbits close.

Topology— Cylinders, tori and stability

The pendulum's phase space is a cylinder S1×RS^1 \times \R: the angle is periodic, the angular velocity is not. Its energy levels are circles (swings), curves winding round the cylinder (rotations), and two separatrices through the unstable top position. More generally, the Liouville–Arnold theorem says that if a system with nn degrees of freedom has nn independent conserved quantities in involution, every compact connected level set is an nn-dimensional torus, on which the motion is quasi-periodic. Do these tori survive small perturbations, such as the pull of Jupiter on Earth? The KAM theorem (Kolmogorov 1954, Arnold 1963, Moser 1962) says that, under non-degeneracy conditions, most of them do — the ones whose frequencies are "sufficiently irrational" — while resonant tori break up, giving chaotic zones. Topology and number theory meet in the stability of the solar system. See dynamical systems.

Algebra— Poisson brackets and the Lie algebra of conserved quantities

For functions f,gf, g on phase space, the Poisson bracket {f,g}=∑i(∂f∂qi∂g∂pi−∂f∂pi∂g∂qi)\{f, g\} = \sum_i\left(\frac{\partial f}{\partial q_i}\frac{\partial g}{\partial p_i} - \frac{\partial f}{\partial p_i}\frac{\partial g}{\partial q_i}\right) makes them a Lie algebra, and Hamilton's equations become f˙={f,H}\dot f = \{f, H\}. So ff is conserved exactly when {f,H}=0\{f, H\} = 0, and conserved quantities form a Lie subalgebra. The components of angular momentum satisfy {Lx,Ly}=Lz\{L_x, L_y\} = L_z and its cyclic permutations — the Lie algebra so(3)\mathfrak{so}(3) of the rotation group — and, for negative energies, L\mathbf L together with a rescaled Runge–Lenz vector spans so(4)\mathfrak{so}(4). Replacing Poisson brackets by commutators of operators is Dirac's route from classical to quantum mechanics, and Noether's theorem becomes a statement about Lie group actions (the moment map).

Analysis— The calculus of variations

The Euler–Lagrange equations are the first-order condition of an optimisation problem in an infinite-dimensional space of paths. The same mathematics finds the brachistochrone (the curve of fastest descent, a cycloid — Johann Bernoulli's challenge of 1696), geodesics on surfaces, minimal surfaces such as soap films, and the shapes of hanging chains. Second-order conditions are subtler than in finite dimensions: the Legendre condition ∂2L/∂q˙2>0\partial^2\mathcal L/\partial\dot q^2 > 0 and the absence of conjugate points (Jacobi) are what make a stationary path a local minimum. Proving that minimisers exist — the "direct method", using compactness in function spaces — became a major theme of twentieth-century analysis, motivated by Hilbert's 20th problem.

Probability— Phase-space volume and statistical mechanics

Liouville's theorem: the flow of Hamilton's equations preserves volume in phase space (the vector field (∂H/∂p,−∂H/∂q)(\partial H/\partial p, -\partial H/\partial q) has divergence ∑i(∂2H/∂qi∂pi−∂2H/∂pi∂qi)=0\sum_i(\partial^2 H/\partial q_i\partial p_i - \partial^2 H/\partial p_i\partial q_i) = 0). For a gas of 102310^{23} molecules we cannot follow trajectories, but we can ask how a probability distribution on phase space evolves — and Liouville's theorem says the uniform distribution on an energy level (the microcanonical ensemble) is invariant. Boltzmann's hope that time averages equal such ensemble averages (the ergodic hypothesis) led to ergodic theory. Volume preservation alone already gives the Poincaré recurrence theorem: for a system confined to a bounded region of phase space, almost every initial state is revisited arbitrarily closely, again and again.

Physics— Why orbits close, and where Newton is not enough

Bertrand's theorem (1873): among central forces f(r)f(r), only the inverse-square law and Hooke's law f=−krf = -kr have the property that every bounded orbit is closed. For any other law, orbits precess. Mercury's perihelion does precess, by about 574′′574'' per century relative to the distant stars. About 531′′531'' of this is explained by the pull of the other planets, but 43′′43'' per century remained unexplained by Newtonian mechanics until Einstein's general relativity in 1915 (see relativity). Classical mechanics also fails at small scales, where quantum mechanics replaces trajectories by wave functions; yet the Lagrangian and Hamiltonian formalisms developed here survive both revolutions, in Feynman's sum over paths and in the Hamiltonian operator.

History & global context

History and global context

  • Before Newton. The Mohist Canon (China, around the 4th–3rd centuries BCE) contains statements about force and motion that some historians read as anticipating inertia. Aristotle held that motion requires a continuing cause; John Philoponus in 6th-century Alexandria and Ibn Sīnā (Avicenna) in 11th-century Persia criticised this with theories of an "impetus" imparted to a moving body, developed further by Jean Buridan in 14th-century Paris. Galileo Galilei established the laws of falling bodies and the parabolic path of projectiles (Two New Sciences, 1638).
  • Kepler. Johannes Kepler published his first two laws in Astronomia nova (1609) and the third in Harmonices mundi (1619), working from Tycho Brahe's observations. Christiaan Huygens built the pendulum clock (1656) and found the formula v2/rv^2/r for centripetal acceleration (Horologium oscillatorium, 1673).
  • Newton. Isaac Newton's Philosophiæ Naturalis Principia Mathematica (1687) stated the laws of motion and universal gravitation and derived Kepler's laws, largely in geometric language. Émilie du Châtelet's French translation of the Principia with her commentary (published posthumously in 1756 and 1759) remains the standard French edition, and her advocacy of vis viva (kinetic energy) helped shape the concept of energy.
  • Analytical mechanics. Leonhard Euler wrote Newton's law as differential equations in Cartesian components (1750s) and derived the equations of rigid-body motion. Jean le Rond d'Alembert stated his principle of virtual work for dynamics (1743). Joseph-Louis Lagrange's Mécanique analytique (1788) contained no figures, by design. William Rowan Hamilton (1834–35) reformulated mechanics with his principle and canonical equations, developed further by Carl Jacobi.
  • Symmetry and chaos. Emmy Noether proved her theorem connecting symmetries and conservation laws (1918). Henri Poincaré's study of the three-body problem (1890) revealed chaotic motion, and Andrey Kolmogorov, Vladimir Arnold and Jürgen Moser established the KAM theory of stability (1954–63).
Further reading

Further reading

  • John R. Taylor, Classical Mechanics (2005) — a clear undergraduate text covering everything in this lesson, with Lagrangian mechanics and chaos.
  • Vladimir I. Arnold, Mathematical Methods of Classical Mechanics (1974; English 1978, 2nd edition 1989) — the classic mathematical treatment: variational principles, manifolds, symplectic geometry.
  • Lev D. Landau and Evgeny M. Lifshitz, Mechanics (1960; 3rd edition 1976) — concise, starting from the principle of least action.
  • Herbert Goldstein, Classical Mechanics (1950; 3rd edition with Poole and Safko, 2002).
  • Daniel Kleppner and Robert Kolenkow, An Introduction to Mechanics (1973; 2nd edition 2014) — Newtonian mechanics in depth.
  • Richard P. Feynman, Robert B. Leighton and Matthew Sands, The Feynman Lectures on Physics, Volume I (1963), and the chapter on the principle of least action in Volume II.

Next in the Lumenary: dynamical systems, smooth manifolds, symplectic geometry, relativity and quantum mechanics.