Ordinary differential equations as evolution laws. Prove Picard–Lindelöf using Banach's fixed point, examine uniqueness failures and finite-time blow-up, use Grönwall for continuous dependence on data, and review analytic solution methods: separable, first-order linear, and constant-coefficient second-order linear equations through the damped oscillator.
After this lesson you can
Formulate initial value problems and reduce any order-n ODE to a first-order system.
Prove Picard–Lindelöf and explain the roles of Lipschitz continuity and the local interval.
Use Grönwall's inequality to bound separation between solutions.
Solve separable, first-order linear and constant-coefficient second-order linear ODEs.
Analyze the damped oscillator and classify its regimes by characteristic-polynomial roots.
Motivation: an evolution law determines a future (sometimes)
An ordinary differential equation (ODE) says how a state changes as a function of itself: it gives the local rule generating a trajectory, not the trajectory. This way of describing the world appears throughout what you will build.
Mechanics and robotics. Newton’s second law, mq¨=F(q,q˙,t), is a second-order ODE. Simulating a robot arm or vehicle means integrating it, and all control relies on future motion being determined by current position and velocity.
Continuous-depth networks. A residual block hk+1=hk+ηgθ(hk) (residual block) is an Euler step of h˙=gθ(h). Neural ODEs take the limit and define the model as an ODE flow.
Optimization.Gradient floww˙=−∇L(w) is the small-step limit of gradient descent, and momentum is a damped oscillator (heavy-ball momentum), as seen at the end.
Populations, epidemics, circuits, chemical reactions. Almost every mechanistic scientific model is an ODE, and the important question is what it predicts long term.
Before solving one there are three foundational, not merely technical, questions. Existence: given the rule and an initial state, is there really a trajectory? Uniqueness: is there one, or does the law leave the future open? Duration: does the trajectory live forever or cease to exist? All three answers depend on the rule, and this lesson answers precisely: first Picard–Lindelöf, using lesson 5’s Banach fixed point and answering all three in the good case; then bad cases, less exotic than they seem; then Grönwall’s inequality, measuring how neighboring trajectories separate; and finally methods that actually solve ODEs by hand (separable, first-order linear, second-order linear), the vocabulary for reading any more complicated system.
The initial value problem
Let Ω⊂R×Rn be open and f:Ω→Rn continuous.
We write x˙ for dx/dt and sometimes x′ when n=1. Two reformulations will be used constantly.
Integral form. A continuous function x:I→Rn with graph in Ω solves the IVP if and only if
x(t)=x0+∫t0tf(s,x(s))dspara todo t∈I.
One way, because x is differentiable and x˙=f(t,x(t)) continuous, so it can be integrated. The other, because integrand s↦f(s,x(s)) is continuous and the fundamental theorem of calculus says the integral is differentiable with derivative f(t,x(t)), and equals x0 at t0. Integral form is convenient: it works with continuous functions, requires no differentiation and turns the ODE into fixed-point equation x=T(x).
Reduction to first order. An order-n ODE, x(n)=g(t,x,x˙,…,x(n−1)), is equivalent to a first-order system for vector y=(x,x˙,…,x(n−1)):
y˙1=y2,…,y˙n−1=yn,y˙n=g(t,y1,…,yn).
And a nonautonomous ODE in Rn becomes autonomous in Rn+1 by adding variable yn+1=t with y˙n+1=1. Thus studying x˙=f(t,x) with x∈Rn suffices. The most-used example is the damped oscillator, x¨+cx˙+kx=0, which with y=(x,x˙) becomes
y˙=[0−k1−c]y.
The matrix is the companion matrix of polynomial λ2+cλ+k, with trace −c and determinant k. We will meet it again.
Intuition: the slope field
For n=1, ODE x˙=f(t,x) has an immediate geometric reading. At each point (t,x) of the plane, f(t,x) is a slope: draw a small segment with that tilt to obtain the slope field. A solution is a curve x(t) tangent at each point to its segment. Solving the IVP is letting the field carry you from (t0,x0) like a leaf in a current.
InteractiveSlope field: three questions, one picture
slope f(t,x)
launched solutions (RK4)
the latest
exact solutions without waiting
the one waiting at 0 from c₁ to c₂
Solutions waiting at equilibrium
x′=∣x∣
Solutions launched3
Last point (t0,x0)(−2.50, −1.00)
Last solution: exists throughout the window.
Magenta solutionc1=−1.00,c2=0.20
Passes through the origin?yes (c₁ ≤ 0 ≤ c₂)
f(x)=∣x∣ is continuous but not Lipschitz at 0: f(x)/x=1/x is unbounded. A family of solutions passes through (c,0); the numerical integrator sees only one.
Choose an equation and click in the plane to launch solutions (integrated by fourth-order Runge–Kutta forward and backward). With x′=∣x∣ dashed curves are exact solutions crossing axis x=0 without stopping; the magenta one stops at 0 between c1 and c2: move c1 and the waiting time to see a two-parameter family passes through the origin (all with c1≤0≤c2), and launch a solution at x=0 to see the integrator finds only one. With x′=x2 launch solutions with x0>0 and compare blow-up time to 1/x0. With logistic, verify lines x=0 and x=1 never cross, and x0<0 blows up. With the forced equation, observe all solutions eventually meet the same curve. Enter your own f(t,x) to explore.
Four observations from the figure, proved in the rest of the lesson.
Through each point of the logistic, x2 and forced equations passes one curve. Solutions neither cross nor touch: at each point the field specifies one direction and neighboring curves neither split nor merge. This is uniqueness.
With x′=∣x∣ that fails on axis x=0. Curve x≡0 is a solution, as is x=t2/4 for t≥0 leaving the origin at t=0, and those leaving at any other instant. The law does not determine the future from the origin.
With x′=x2 curves escape upward in finite time. No solution is defined for all t: existence is generally local.
With the forced equation all solutions converge together. This is not general: it happens when the field contracts in x, quantified by Grönwall.
The Picard–Lindelöf theorem
The key to uniqueness is how f varies when only x moves, and differentiability is unnecessary.
This is lesson 1’s Lipschitz continuity with time as a parameter. If ∂f/∂x exists and is continuous, f is locally Lipschitz in x by the mean value theorem and compactness of closed balls. But that much is unnecessary: ∣x∣ is Lipschitz with L=1 without being differentiable at 0. What excludes ∣x∣ is its slope f(x)/x=1/x being unbounded near 0.
Let R={(t,x):∣t−t0∣≤a,∥x−x0∥≤b}⊂Ω be a closed rectangle around the initial datum. Since f is continuous on a compact set it is bounded, M=maxR∥f∥, and call L a Lipschitz constant in x on R. The central result is known as the Picard–Lindelöf theorem (or Cauchy–Lipschitz).
Proof
Let X={φ∈C(Ih;Rn):∥φ−x0∥∞≤b} have the supremum distance. It is a closed subset of space C(Ih;Rn), which is complete (supremum-norm completeness), so X is a complete metric space. Define the Picard operator
(Tφ)(t)=x0+∫t0tf(s,φ(s))ds.
T maps X into X. If φ∈X, point (s,φ(s)) lies in R, so s↦f(s,φ(s)) is continuous and Tφ is continuous (even C1). Also ∥Tφ(t)−x0∥≤M∣t−t0∣≤Mh≤b.
Taking the supremum over t, d(Tφ,Tψ)≤qd(φ,ψ) with q=hL<1.
Conclusion. By Banach’s theorem, T has a unique fixed point in X, and iterates φk=Tkφ0 converge to it with a priori bound d(φk,x)≤1−qqkd(φ1,φ0). By integral form, fixed points of T are exactly IVP solutions with graph in R.
∎
Read carefully: the proof is one idea, turn the ODE into a fixed-point equation and check Banach’s two assumptions. hM≤b makes T keep functions inside the rectangle where f is controlled (self-map), and hL<1 makes it a contraction. Both conditions appear in the next figure: the first limits size, the second sensitivity.
InteractivePicard iterations
error on [0,h]
error on [0,0.9t∗]
Banach bound qk∥φ1−φ0∥/(1−q)
current iterate φk
previous iterates
exact solution
guaranteed interval [0,h]
Problem
k = 10
x′=x2,x(0)=1
Error of φk on [0,h]1.7e−12
q=hL0.80
M, L in the rectangle4.00, 4.00
Maximum guaranteed h0.250
Optimum over b0.25 with b = 1.00
Actual interval of existence[0, 1.000)
The assumptions hold (hM≤b and hL<1): T is a contraction and error decreases at least as fast as qk.
Iterates φk (current magenta, earlier blue) versus the exact solution (dashed). With x′=λx and x(0)=1 iterates are exactly Taylor polynomials of eλt, and the theorem only guarantees h<1/∣λ∣. With x′=x2 and x′=1+x2 (whose solution is tant), the rectangle of half-width b fixes M and L and the guaranteed interval is min(b/M,1/L): optimize it over b. The graph compares measured error on [0,h] and on an interval nearly reaching blow-up with the Banach bound, drawn only while assumptions hold. Extend h past the guarantee and observe what breaks: the proof, not convergence.
What appears is instructive. The interval guaranteed by the proof is pessimistic: for x′=x2 with x(0)=1, the optimum over b is h→1/4 (with b=1, M=4 and L=4 and both ratios b/M and 1/L are 1/4), while solution 1/(1−t) exists until t=1. And within the guarantee, convergence is much faster than the geometric bound. The explanation is that supremum-norm contraction discards information: the integral from t0 to t sees only what happens on [t0,t].
Proof
Iterates remain in the ball by the same self-map argument. For k=0: ∥φ1(t)−x0∥≤M∣t−t0∣. If the bound holds for k−1, integral form and the Lipschitz condition give
Series ∑kMLkhk+1/(k+1)!=(M/L)(eLh−1) converges for any h, so partial sums φk=x0+∑j<k(φj+1−φj) converge uniformly (uniform convergence) to a continuous function φ. Passing to the limit in integral form (uniform convergence and continuity of f permit this), φ=Tφ.
∎
Thus condition hL<1 is an artifact of choosing the supremum norm. Error of φk is of order (Lh)k/k!, which for x′=λx is exactly the Taylor remainder of eλt (iterates are its degree-k polynomials, as the figure shows). An equivalent view: with weighted norm ∥φ∥L=maxte−2L∣t−t0∣∥φ(t)∥ the Picard operator is a contraction with constant 1/2 on all Ih, regardless of L.
Maximal solutions and the blow-up alternative
The theorem is local, but solutions can be glued. Two solutions agreeing at one time agree on their common interval (proved with Grönwall), so the union of all IVP solutions is a solution on a maximal open interval (t−,t+). What follows is the continuation theorem, stated without proof (see Teschl, chapter 2):
A solution ceases to exist only by going to infinity (or the boundary of Ω): it cannot simply “end.” This turns duration into a question of bounds, answered by Grönwall.
When the assumption fails
Without Lipschitz there are infinitely many solutions
Let x˙=∣x∣ with x(0)=0. Constant function x≡0 is a solution. But for any c≥0, so is
xc(t)={0(t−c)2/4t≤ct≥c,
because on segment t>c it is x˙c=(t−c)/2=xc, and at t=c one-sided derivatives are 0 on both sides, so xc is C1. Since x˙=∣x∣≥0, solutions are nondecreasing, and those passing through the origin have the form −(c1−t)2/4 for t≤c1, 0 on [c1,c2] and (t−c2)2/4 for t≥c2, with c1≤0≤c2 (and c1=−∞ or c2=+∞ also work): a two-parameter family through one point, drawn by the first interactive’s sliders. The solution can wait at equilibrium as long as it wants and depart whenever it likes.
Why does the proof fail? Because f(x)=∣x∣ is continuous but ∣f(x)−f(0)∣/∣x∣=1/∣x∣ is unbounded near 0: there is no L. The Picard operator is no longer a contraction on any interval around t=0. In the next fragment you will see the numerical integrator sees only one solution (the one starting with x(0)=0 is zero, and with x(0)=10−12 it changes to x(6)≈9): the computer does not know there are more.
Without Lipschitz existence remains: Peano
Existence does survive removing the Lipschitz condition.
The proof uses compactness rather than contractions. Euler polygonal approximations with step δ lie in the rectangle, are equicontinuous (with Lipschitz constant M) and bounded, so by Arzelà–Ascoli a subsequence converges uniformly as δ→0. The limit satisfies integral form. What is lost is uniqueness (the limit may depend on the subsequence, as with ∣x∣) and with it a guarantee that the whole sequence converges: neither polygonal approximations nor Picard iterates, which with a merely continuous field may oscillate without converging.
Without a global bound, the solution dies: x′=x2
The third phenomenon is finite-time blow-up. With x(0)=x0>0, separating variables (justified below), −1/x=t−1/x0, that is,
x(t)=1−x0tx0,t+=x01.
A larger initial condition blows up sooner: x0=2 lives until t=1/2. Here f(x)=x2 is smooth and locally Lipschitz, so there is a unique solution through each point, but it grows so fast that ∫x0∞dx/x2=1/x0 is finite, exactly the time taken to reach infinity. Growing faster than linearly does not suffice by itself (x′=xlnx grows faster than a line and its solutions are global because ∫∞dx/(xlnx) diverges), but growth like xp with p>1 does. The general pattern seen with Grönwall: a field growing at most linearly gives global solutions, while one growing faster may not.
The opening slope field shows three situations to remember: globally Lipschitz (existence for all R), locally Lipschitz (existence and uniqueness, but local), and not Lipschitz (existence without uniqueness). Here is a summary for x(0)=0 in the four fields of an exercise below:
f(x)
Lipschitz near 0?
Solutions through (0,0)
∣x∣
no (f(x)/x→∞)
infinitely many
∣x∣
yes, L=1
one: x≡0
x1/3
no (f(x)/x→∞)
infinitely many (x≡0 and ±(2(t−c)/3)3/2)
sinx
yes, L=1 (∣cosx∣≤1)
one: x≡0
Grönwall’s inequality
How far apart can two solutions with very close initial data get? This sensitivity question governs weather forecasting and gradient computation for a Neural ODE. The answer is an integral inequality with a one-line proof and enormous consequences.
The tool is Grönwall’s inequality in integral form.
Proof
Let U(t)=∫t0tu(s)ds: it is class C1, U(t0)=0 and U′=u≤α+LU. Multiply by integrating factor e−L(t−t0):
Integrate from t0 to t (with U(t0)=0) and assume L>0: e−L(t−t0)U(t)≤Lα(1−e−L(t−t0)), that is, LU(t)≤α(eL(t−t0)−1). Substitute in the assumption to get u(t)≤α+LU(t)≤αeL(t−t0). Case L=0 is trivial.
∎
The most-used conclusion is this.
Proof
Let u=∥x−y∥ and Δ0=u(t0). By integral form of both equations and the triangle inequality, u(t)≤Δ0+∫t0t(∥f(s,x)−f(s,y)∥+∥f(s,y)−g(s,y)∥)ds≤Δ0+∫t0t(Lu+ε)ds. With v=u+ε/L, this is v(t)≤(Δ0+ε/L)+L∫t0tvds, and Grönwall gives v≤(Δ0+ε/L)eL(t−t0). Subtract ε/L.
∎
Three consequences:
Uniqueness. If Δ0=0 and ε=0, then x=y. Two solutions of an ODE with f locally Lipschitz in x agreeing at one time agree throughout any common interval (the union of both graphs over a compact interval is compact, and a continuous function locally Lipschitz in x is Lipschitz on any compact set: use the local constant for nearby points and 2max∥f∥/δ for points at least δ apart). This completes Picard–Lindelöf: the solution is unique among all solutions, not just those remaining in the rectangle. In particular, one-dimensional solution curves cannot cross, and equilibrium is a barrier.
Continuous dependence. With ε=0, ∥x(t)−y(t)∥≤Δ0eL(t−t0): on each bounded interval the solution depends continuously on initial data. With Δ0=0 it also depends continuously on the field: if f(t,x;μ) is Kμ-Lipschitz in parameter μ, perturbing μ by δμ gives ε=Kμ∣δμ∣. The IVP is well posed in Hadamard’s sense (existence, uniqueness and continuous dependence).
Global existence with linear growth. If ∥f(t,x)∥≤A+B∥x∥ on [t0,T]×Rn, with B>0, any solution satisfies ∥x(t)∥≤∥x0∥+∫(A+B∥x∥), and with v=∥x∥+A/B Grönwall gives ∥x(t)∥≤(∥x0∥+A/B)eB(t−t0). A solution bounded on bounded intervals cannot blow up, and the blow-up alternative says it exists on all [t0,T]. This includes every globally Lipschitz field (because ∥f(t,x)∥≤∥f(t,0)∥+L∥x∥) and the linear equations below. Case x′=x2 is excluded because x2 is not bounded by a line.
The exponential bound is the best one can say without knowing more of the field, but is not always sharp. The next figure tests it.
InteractiveThe Grönwall envelope
Solutions from x0=0.15 and x0+Δ0, with Δ0=10−1.7.
separation ∣x2−x1∣
envelope Δ0eLt
refined bound
x1(t)
x2(t)
x′=x(1−x)
L=max∣f′∣ in the region1.00
Separation at T2.62e−4
Envelope Δ0eLT5.79e1
Envelope / separation2.2e5
Max separation / envelope (always ≤1)1.000 at t = 0.00
Near x=1 the field contracts (f′=−1), but L is the maximum of ∣f′∣ over the entire visited region: the envelope grows while actual separation collapses.
Two solutions of x′=f(x) with initial data x0 and x0+Δ0. Left, both trajectories; right, on a logarithmic scale, their actual separation (magenta) and Grönwall envelope Δ0eLt (dashed), with L the maximum of ∣f′∣ in the region they visit. For x′=x they agree. For logistic, near stable equilibrium x=1, separation plummets while the envelope still grows. Enable the refined bound, integrating at each instant the signed maximum of f′ between the two solutions instead of the maximum of ∣f′∣, and verify it also bounds separation while tracking it. The ‘max separation / envelope’ readout never exceeds 1.
The pessimism comes from Grönwall using the maximum of ∣f′∣ and its absolute value: it does not distinguish an expanding field (f′>0) from a contracting one (f′<0). In dimension 1 this is easily fixed: difference Δ=x2−x1 does not change sign (uniqueness) and, by the mean value theorem, Δ˙=f(x2)−f(x1)=f′(ξ(t))Δ with ξ(t) between the solutions, so ∣Δ(t)∣=Δ0exp∫t0tf′(ξ(s))ds≤Δ0exp∫t0tm(s)ds, where m(s) is the signed maximum of f′ on the segment between x1(s) and x2(s). This is the figure’s refined bound, negative in the exponent when the field contracts. For small separations, m(s)≈f′(x1(s)) and the bound becomes nearly exact, Δ0exp∫t0tf′(x1(s))ds: this is the variational equation in the sensitivity lesson, where solution derivatives with respect to initial data solve their own linear ODE. For n-dimensional systems, the refined version replaces L by the Jacobian’s logarithmic norm along the solution, which can be negative (when the segment between solutions lies in the domain).
The opposite of logistic is what matters in practice. If the field truly expands, error grows like eLt and no trick avoids it: forecasts of a chaotic system degrade exponentially, with characteristic time 1/L, and numerical integrator errors are amplified by the same exponential (Euler and Runge–Kutta methods are the simulation lesson’s topic).
Analytic solution methods
With existence and uniqueness established, how are solutions found? Most ODEs have no formula, and those that do are few and almost always in three families. They matter little as calculation tools and greatly as vocabulary: near equilibrium any system reads like one of these models (stability by linearization).
Separable equations
Proof
(1) The constant is a solution, and unique by uniqueness. (2) If x is a solution with x(t0)=x0, it cannot touch a zero of h: at that point x(t1)=ξ with h(ξ)=0 the constant ξ would be another solution through the same point, forbidden by uniqueness. Thus x(t)∈J while it exists and dtdH(x(t))=x˙(t)/h(x(t))=g(t). Integration gives H(x(t))=G(t). Conversely, x=H−1∘G is differentiable and x˙=g(t)/H′(x)=g(t)h(x).
∎
Equilibria are zeros of h and are lost by dividing by h(x). Thus handle them separately: the proof explains why no other solutions touch an equilibrium (uniqueness makes it a barrier), but the mechanical “move dx/h(x) to one side” method does not produce them. They are often recovered at the end: passing from ln∣x∣=G(t)+C to x=KeG(t), constant K, initially unable to be 0, may be set to 0 and returns equilibrium x≡0.
First-order linear equations
Proof
If x is a solution, dtd(e−A(t)x(t))=e−A(x˙−ax)=e−A(t)b(t), and integration from t0 (where A=0) gives the formula, thus the only possibility. Conversely the formula defines a C1 function that, differentiated, satisfies the equation and initial datum.
∎
Factor e−A(t) is the integrating factor, and writing the solution as the homogeneous solution with constant x0 replaced by a function is variation of constants: multiply the equation to turn the left side into an exact derivative. The formula has an interpretation worth remembering. First term eA(t)x0 is the homogeneous solution: initial state evolving without forcing. The second sums contributions of force b(s) at each time s, each evolved from s to t by factor eA(t)−A(s). This is superposition; next lesson generalizes it as Duhamel’s formula for systems. All solutions form an affine space: a particular solution plus any homogeneous solution. And there is no blow-up because the field grows linearly: a,b continuous on I suffice for existence on all I.
With constant a=−1/τ, the formula is x(t)=e−t/τx0+∫0te−(t−s)/τb(s)ds: output is a moving average of input with an exponential kernel of memory τ. Its Euler discretization with step Δt is xn+1=(1−α)xn+ατbn with α=Δt/τ, the exponential moving average of time series (simple exponential smoothing) and of optimizers with momentum and second-moment statistics.
Second-order linear equations with constant coefficients
This is the most important second-order ODE case. With unit mass, x¨+cx˙+kx=0, with c≥0 (damping) and k>0 (stiffness).
The equation follows by seeking solutions eλt: since dtdeλt=λeλt, substitution gives p(λ)eλt=0. Every root of p gives a solution. It remains to show there are no others and handle missing real roots.
Proof
Dimension 2. With y=(x,x˙) the equation is linear system y˙=Cy with constant C, having a unique global solution for any initial data (Picard–Lindelöf and linear growth). Thus x↦(x(0),x˙(0)) is a linear map from solutions to R2 that is injective (uniqueness) and surjective (existence): a linear bijection, so dimension is 2. It suffices to exhibit two solutions with independent initial conditions, checked by determinant W(0)=x1(0)x˙2(0)−x˙1(0)x2(0) (the Wronskian).
Distinct real roots.xi=eλit are solutions and W(0)=λ2−λ1=0.
Double root.x1=eλt is a solution. For x2=teλt: x˙2=(1+λt)eλt, x¨2=(2λ+λ2t)eλt, and x¨2+cx˙2+kx2=(λ2+cλ+k)teλt+(2λ+c)eλt=0, because p(λ)=0 and λ=−c/2. W(0)=1.
Complex roots. The equation is real and z(t)=e(−c/2+iωd)t solves its complex version (same calculation, with complex λ), so its real and imaginary parts, e−ct/2cosωdt and e−ct/2sinωdt, solve the real equation. By Euler’s formulaz=e−ct/2(cosωdt+isinωdt). W(0)=det[1−c/20ωd]=ωd=0.
∎
The classification is that of 2×2 matrices in linear algebra lesson 10, in another guise: earlier matrix C has characteristic polynomial p, trace τ=−c and determinant δ=k, so plane (c,k) is the trace–determinant plane of trace, determinant and eigenvalues, and parabola k=c2/4 separating regimes is the same boundary seen there between complex eigenvalues and real ones. Roots of p are eigenvalues of C; what changes between regimes is only their distribution in the complex plane.
InteractiveThe damped oscillator
Phase plane (x,x′): a spiral toward the origin for complex roots, approach without rotations for real roots.
Roots of λ2+cλ+k. The dashed curve traces them as c varies with fixed k; the circle marks the critical point.
x(t) (RK4)
current time
envelope ±Ae−ct/2
damper
External force
t = 20.0
Regimeunderdamped
Discriminant c2−4k−15.36
λ=−0.40±1.96i
Damping ratio ζ=c/(2k)0.20
Decay rate −maxReλ0.400
Frequency ωd1.960
Complex conjugate roots: oscillation has frequency ωd=k−c2/4 and the envelope decays as e−ct/2.
A mass attached to a spring (stiffness k) and damper (coefficient c): x′′+cx′+kx=0 (mass 1), integrated by Runge–Kutta. Above, the mass; center, x(t) with envelope ±Ae−ct/2; lower left, phase plane (x,x′); lower right, characteristic polynomial roots in the complex plane, with their path as c varies (dashed curve). Raise c: complex roots descend to the real axis, merge at c=2k (‘Critical’ button) and separate along the real axis. Notice the decay rate. Switch to ‘forced’ and vary ω to see resonance.
The interactive’s three readouts are the same information. Roots tell all: real part is decay rate, imaginary part frequency. Phase plane shows the same motion as a trajectory: a spiral toward the origin with complex roots and direct entry (no turns) with real roots. Time graph is the projection of that trajectory onto axis x.
Two numbers summarize behavior. Natural frequency ω0=k is that of the undamped oscillator, and damping ratioζ=c/(2k)=c/(2ω0) gives the regime: ζ<1 underdamped, ζ=1 critical, ζ>1 overdamped. In the underdamped regime ωd=ω01−ζ2 is slightly less than ω0 and the envelope decays like e−ζω0t.
Proof
For c<2k roots are complex with real part −c/2, so σ=c/2, increasing. For c≥2k the slow root is λ1=−c/2+c2/4−k=−k/(c/2+c2/4−k) (multiply and divide by the conjugate), and the denominator increases with c, so σ=∣λ1∣ decreases. At c=2k both branches equal k.
∎
This is counterintuitive and fundamental: more damping does not mean faster decay. Going from c=2k to c=4k gives slow root λ1=−(2−3)k≈−0.27k, nearly four times slower than critical: the overdamped system “crawls” because friction prevents spring force from returning it to rest.
Forcing and resonance
With sinusoidal external force, x¨+cx˙+kx=Fcosωt, the general solution is a particular solution plus the homogeneous one, which decays if c>0. Long term what remains is an oscillation at the force’s frequency, with amplitude obtained by a complex-number calculation.
Proof
By linearity and since Re commutes with differentiation in t, solve the complex version with right side Feiωt and take the real part. For z=Ceiωt, z¨+cz˙+kz=p(iω)Ceiωt, which is Feiωt if C=F/p(iω) (p(iω)=(k−ω2)+icω=0: if ω=0 its imaginary part cω does not vanish, and if ω=0 it equals k>0). The difference between any solution and xp solves the homogeneous equation, which decays because both roots have negative real part when c>0. Amplitude is ∣C∣. For the maximum, A is maximal when radicand D(s)=(k−s)2+c2s, with s=ω2, is minimal: D′(s)=−2(k−s)+c2=0 gives s=k−c2/2, admissible if c2<2k, and then D=c2k−c4/4.
∎
Remember two facts from this formula. First, the peak grows like 1/c as c→0. Second, without damping (c=0) and with ω=k polynomial p(iω) vanishes and the calculation fails: the solution is x(t)=2ωFtsinωt, growing linearly (check by differentiating: x¨+ω2x=Fcosωt). This is pure resonance, why bridges and wings are designed so natural frequencies are far from the forces they receive. In the preceding interactive’s ‘forced’ mode, with c=0.5 and k=4, the peak is at ωr≈1.97 with amplitude ≈1.008.
Back to momentum
The damped oscillator is the continuous model of momentum. Heavy ball wk+1=wk−η∇L(wk)+β(wk−wk−1) is, with h=η and β=1−γh, a discretization of w¨+γw˙+∇L(w)=0: replace w¨ by central difference (wk+1−2wk+wk−1)/h2 and w˙ by backward difference (wk−wk−1)/h, multiply by h2 and solve for wk+1. If L is a quadratic 21∑iμiyi2, in its Hessian eigenvector basis each coordinate obeys y¨i+γy˙i+μiyi=0: an oscillator with k=μi.
Apply the preceding theorem. Pure gradient flow, y˙i=−μiyi, has slowest direction decay rate μmin. With momentum and γ=2μmin the slowest direction is critical and decays at rate μmin, and the others (with μi>μmin) are underdamped at rate γ/2=μmin: all decay at the same speed, with characteristic time 1/μmin instead of 1/μmin. For a meaningful comparison fix the time scale using the stiffest direction (the discrete method’s stable step is order 1/μmax in h): with μmax=1 and condition number κ=μmax/μmin, time goes from κ to κ. This is the acceleration studied in momentum as an ODE (and why critical damping is called optimal). This is continuous analysis; the discrete stability limit is another calculation.
Implementation from scratch
Begin with symbolic Picard iteration: exact iterates for x′=x and x′=t+x2 with x(0)=0, compared with the solution’s Taylor expansion.
[ ]Picard iterates with sympyBrowser
import sympy as sp
t, s = sp.symbols("t s")
def picard_sym(f, x0, n):
"""Iterados de Picard x_{k+1}(t) = x0 + integral de 0 a t de f(s, x_k(s)) ds, exactos."""
iterados = [sp.sympify(x0)]
for _ in range(n):
xk = iterados[-1]
iterados.append(sp.expand(x0 + sp.integrate(f(s, xk.subs(t, s)), (s, 0, t))))
return iterados
print("x' = x, x(0) = 1")
for k, p in enumerate(picard_sym(lambda s, x: x, 1, 4)):
print(f" k={k}: {p}")
print("\nx' = t + x^2, x(0) = 0")
its = picard_sym(lambda s, x: s + x**2, 0, 4)
for k, p in enumerate(its):
print(f" k={k}: {p}")
# serie de Taylor de la solución, por recurrencia: (m+1) c_{m+1} = [m = 1] + sum c_i c_{m-i}
c = [sp.Integer(0)]
for m in range(30):
c.append((sp.Integer(1 if m == 1 else 0) + sum(c[i] * c[m - i] for i in range(m + 1))) / (m + 1))
print("\nTaylor de la solución:", " + ".join(f"({c[m]}) t^{m}" for m in range(14) if c[m] != 0), "+ ...")
for k, p in enumerate(its):
coef = [sp.Poly(p, t).coeff_monomial(t**m) if p != 0 else 0 for m in range(31)]
m = 0
while m < 31 and coef[m] == c[m]:
m += 1
print(f" el iterado {k} coincide con Taylor hasta el grado {m - 1}")
Iterates of x′=x are Taylor polynomials of et, one per iteration, as the figure showed. In the second problem something similar happens with more luck: iterate k agrees with the solution’s Taylor expansion through degree 3k+1, three orders per iteration. Generally, at minimum, iterate k gets the first k orders right: every integration increases by one the order at which φk and x can differ (the local version of the factorial bound). Degrees grow rapidly (2k−1 at x′=x2), so only a few steps are done by hand or with sympy.
Now the numerical version, with cumulative trapezoid integration written from scratch, for any scalar field. It stops when supremum distance between consecutive iterates falls below tolerance.
[ ]Numerical Picard iteration on a gridBrowser
import numpy as np
from scipy.integrate import solve_ivp
def cumtrapz(y, t):
"""Integral acumulada por trapecios: out[i] = integral de t[0] a t[i]."""
out = np.zeros_like(y)
out[1:] = np.cumsum(0.5 * (y[1:] + y[:-1]) * np.diff(t))
return out
def picard_grid(f, x0, t_grid, tol=1e-10, max_iter=300):
"""Itera x_{k+1} = x0 + integral de f(s, x_k(s)) ds hasta que la distancia sup entre iterados baje de tol."""
x = np.full_like(t_grid, float(x0))
with np.errstate(all="ignore"):
for k in range(1, max_iter + 1):
x_nuevo = x0 + cumtrapz(f(t_grid, x), t_grid)
if not np.all(np.isfinite(x_nuevo)):
return x_nuevo, k
if np.max(np.abs(x_nuevo - x)) < tol:
return x_nuevo, k
x = x_nuevo
return x, max_iter
def referencia(f, x0, T, t_grid):
sol = solve_ivp(lambda t, y: f(t, y), (0, T), [x0], t_eval=t_grid, rtol=1e-12, atol=1e-14)
return sol.y[0]
t_grid = np.linspace(0, 2, 2001)
x, k = picard_grid(lambda t, x: x, 1.0, t_grid)
print(f"x' = x en [0, 2]: {k} iteraciones, error frente a exp(t) = {np.max(np.abs(x - np.exp(t_grid))):.1e}")
x, k = picard_grid(lambda t, x: t + x**2, 0.0, np.linspace(0, 1.2, 2401))
ref = referencia(lambda t, y: t + y**2, 0.0, 1.2, np.linspace(0, 1.2, 2401))
print(f"x' = t + x^2 en [0, 1.2]: {k} iteraciones, distancia a solve_ivp = {np.max(np.abs(x - ref)):.1e}")
print("\nx' = x^2, x(0) = 1 (explota en t = 1): iteraciones para tol = 1e-8")
for T in [0.25, 0.5, 0.9, 1.2]:
x, k = picard_grid(lambda t, x: x**2, 1.0, np.linspace(0, T, 1001), tol=1e-8, max_iter=400)
estado = "converge" if np.all(np.isfinite(x)) and k < 400 else "no converge"
print(f" [0, {T}]: {k:3d} iteraciones, {estado}")
Three readouts. For x′=x on [0,2] about 18 iterations suffice, and final error (order 10−6) comes from the trapezoid rule with step 10−3, not iteration: iteration converges to the discretized operator’s fixed point, which differs from the solution by quadrature error. With x′=t+x2, lacking an elementary formula, distance to solve_ivp confirms iteration reaches the same place. And with x′=x2 the theorem’s limit appears: iteration count rises as the interval approaches blow-up at t=1, and past that time iteration does not converge: values explode.
With libraries: sympy.dsolve and solve_ivp
For ODEs with formulas, sympy.dsolve solves and verifies. For others, scipy.integrate.solve_ivp is the black box (internally a family of adaptive-step Runge–Kutta methods, covered in the numerical methods module’s Runge–Kutta methods lesson): here use it only to check what we proved.
[ ]Analytic solutions with sympy.dsolveBrowser
import sympy as sp
t = sp.symbols("t")
x = sp.Function("x")
# la explosión de x' = x^2 con x(0) = 2, y el ejemplo del factor integrante
s1 = sp.dsolve(sp.Eq(x(t).diff(t), x(t) ** 2), x(t), ics={x(0): 2})
s2 = sp.dsolve(sp.Eq(x(t).diff(t) + 2 * x(t), sp.exp(-t)), x(t), ics={x(0): 0})
print(s1)
print(s2, " en t = 1:", float(s2.rhs.subs(t, 1)))
# el oscilador subamortiguado, con x(0) = 1 y x'(0) = 0
c, k = sp.Rational(2, 5), 4
s3 = sp.dsolve(sp.Eq(x(t).diff(t, 2) + c * x(t).diff(t) + k * x(t), 0), x(t), ics={x(0): 1, x(t).diff(t).subs(t, 0): 0})
print(s3)
print("raíces del polinomio característico:", sp.solve(sp.Symbol("l") ** 2 + c * sp.Symbol("l") + k, sp.Symbol("l")))
[ ]solve_ivp: events and lack of uniquenessBrowser
import numpy as np
from scipy.integrate import solve_ivp
# 1) la explosión, detectada con un evento terminal
def explota(t, y):
return abs(y[0]) - 1e6
explota.terminal = True
sol = solve_ivp(lambda t, y: y**2, (0, 2), [2.0], events=explota, rtol=1e-10, atol=1e-12)
print(f"x' = x^2, x(0) = 2: el evento salta en t = {sol.t_events[0][0]:.6f} (teoría: 0.5 - 1e-6 = {0.5 - 1e-6:.6f})")
# 2) solve_ivp no ve la falta de unicidad de x' = sqrt|x|
f = lambda t, y: np.sqrt(np.abs(y))
for x0 in [0.0, 1e-12, 1e-8, 1e-4]:
s = solve_ivp(f, (0, 6), [x0], rtol=1e-10, atol=1e-14)
print(f"x(0) = {x0:.0e} -> x(6) = {s.y[0, -1]:.6f} (exacta (t/2 + sqrt(x0))^2 = {(3 + np.sqrt(x0))**2:.6f})")
# 3) x'' + 0.4 x' + 4 x = 0 como sistema de primer orden, frente a la fórmula cerrada
c, k = 0.4, 4.0
sol = solve_ivp(lambda t, y: [y[1], -c * y[1] - k * y[0]], (0, 10), [1.0, 0.0], rtol=1e-10, atol=1e-12, dense_output=True)
wd = np.sqrt(k - c**2 / 4)
tt = np.linspace(0, 10, 11)
exacta = np.exp(-c * tt / 2) * (np.cos(wd * tt) + (c / (2 * wd)) * np.sin(wd * tt))
print("error máximo frente a la fórmula cerrada:", np.max(np.abs(sol.sol(tt)[0] - exacta)))
The event turns blow-up into data: the integrator stops when ∣x∣ crosses the threshold and stopping time is blow-up time minus an order-1/umbral term (here 10−6). The second block is numerical uniqueness: for x(0)=0 the integrator returns the zero solution, and with x(0)=10−12, a trillionth change to the datum, it returns the departing solution x(6)≈9. In an ODE with uniqueness, Grönwall’s continuous dependence says Δ0=10−12 changes the solution by 10−12eLt; here the change is order 1 and no bound exists. Learn to recognize this warning: an ODE whose solution changes greatly when the datum barely changes likely has a non-Lipschitz field (or an unstable system, another case).
Common mistakes
Exercises
NumericBlow-up time
The solution of x′=x2 with x(0)=2 blows up at finite time t∗. Calculate t∗.
NumericA forced linear equation
Solve x′=−2x+e−t with x(0)=0 and give x(1).
QuizIs there a unique solution through the origin?
With x(0)=0, for which of these ODEs does the IVP have a unique solution?
More than one answer may be correct.
ProofThe Picard operator is a contraction
Prove: Let f be continuous on R=[t0−a,t0+a]×[x0−b,x0+b], with ∣f∣≤M and Lipschitz in x with constant L. If h≤a, hM≤b and hL<1, operator (Tφ)(t)=x0+∫t0tf(s,φ(s))ds has a unique fixed point in X={φ∈C[t0−h,t0+h]:∥φ−x0∥∞≤b}, and fixed points are IVP solutions with graph in R.
0
Use the supremum distance on X (here n=1 for simplicity).
Step 1 of 4. Before applying Banach two things about X and T must be checked. Which?
ProofGrönwall's inequality
Prove: Let u:[t0,T]→[0,∞) be continuous with u(t)≤α+L∫t0tu(s)ds, where α≥0 and L>0. Then u(t)≤αeL(t−t0).
0
Nothing is known of u except the integral inequality: in particular, differentiability is not assumed.
Step 1 of 4. Since u is not differentiable, what auxiliary function do you introduce?
NumericThe interval guaranteed by the theorem
For x′=x2 with x(0)=1, consider rectangle [−a,a]×[1−b,1+b] and theorem conditions hM≤b and hL<1. Optimizing over b>0, what is the supremum of h guaranteed by the theorem?
NumericHow long logistic growth takes
The solution of x′=x(1−x) with x(0)=0.1 reaches value 1/2 at time t1/2. Calculate t1/2.
NumericSteady-state amplitude
A mass has x′′+0.5x′+4x=cos(1.8t). After the transient decays, oscillation has amplitude A. Calculate A.
QuizWhich decays fastest?
All oscillators have k=4. Which has the greatest decay rate −maxReλ?
QuizCan two solutions cross?
Let x′=f(t,x) with f continuous and locally Lipschitz in x throughout the plane. Which statements are true?
More than one answer may be correct.
CodePicard for systems
Implement picard_numeric(f, x0, t_grid, tol=1e-10, max_iter=500) for a system x˙=f(t,x). x0 is a vector of shape (n,); f(t, X) receives t_grid (shape (N,)) and X of shape (n, N) and returns an array (n, N). Return (X, k): the last iterate (shape (n, N)) and number of iterations performed. Iterate Xk+1=x0+∫t0tf(s,Xk(s))ds using the cumulative trapezoid rule (along axis 1) and stop when max|X_nuevo - X| < tol. If it does not converge in max_iter iterations, return the last with k = max_iter (without raising exceptions even if inf or nan appears). Start from X0≡x0.
import numpy as np
def picard_numeric(f, x0, t_grid, tol=1e-10, max_iter=500):
"""Iteración de Picard en una rejilla para un sistema x' = f(t, x). Devuelve (X, k)."""
t_grid = np.asarray(t_grid, dtype=float)
x0 = np.asarray(x0, dtype=float)
X = np.tile(x0[:, None], (1, len(t_grid)))
# tu código: integral acumulada por trapecios a lo largo del eje 1, y el bucle con parada por tolerancia
return X, 0
Shift+Enter to run
Summary
Key idea
An ODE x˙=f(t,x) with f locally Lipschitz in x determines the trajectory from initial data: it exists, is unique and depends continuously on the data, proved by converting the ODE to a fixed-point equation and applying Banach. Duration is not guaranteed (it can blow up), and Grönwall’s bound eLt says how far neighboring solutions can separate.
Integral form and first order.x=x0+∫f is equivalent to the ODE with initial datum, and any order-n ODE is a first-order system in Rn.
Picard–Lindelöf. If f is continuous and Lipschitz in x, the Picard operator is a contraction on C[t0−h,t0+h] for small h: a unique local solution with convergent iterates (in fact factorially fast). The theorem is pessimistic about interval size.
Failures. Without Lipschitz there is existence (Peano) but not uniqueness (∣x∣). Without a growth bound there is finite-time blow-up (x2). A maximal solution only ends by going to infinity (or the domain boundary).
Grönwall. From u≤α+L∫u follows u≤αeL(t−t0), giving uniqueness, continuous dependence on data and parameters, and global existence for linear-growth fields. Exact for x′=x and pessimistic when the field contracts.
Methods. Separable: equilibria are lost when dividing by h(x). First-order linear: integrating factor and variation of constants, always global. Second-order linear: characteristic polynomial, three regimes and critical damping as fastest.
Oscillator and momentum. The forced oscillator has amplitude F/(k−ω2)2+c2ω2 and resonance at ωr=k−c2/2. Momentum discretizes it, and critical damping explains acceleration.