
Ordinary Differential Equations (7): Stability Theory
Will a bridge survive the wind? Will an ecosystem recover from a shock? Stability theory answers these questions using Lyapunov functions, linearization, and bifurcation analysis.
A small push hits a system. Does it return to rest, drift away, or break entirely? That single question decides whether bridges survive storms, ecosystems recover from droughts, and economies bounce back from crises. Stability theory answers it — and it does so without ever solving the differential equation. We will learn to read the destiny of a system off the geometry of its phase plane.

What You Will Learn#
- Three precise notions: Lyapunov stable, asymptotically stable, unstable
- Linearization via the Jacobian and the Hartman-Grobman theorem
- Lyapunov’s direct method — proving stability with energy-like functions
- LaSalle’s invariance principle for borderline cases
- Trace-determinant classification of all 2D linear systems
- Four canonical bifurcations: saddle-node, transcritical, pitchfork, Hopf
- Worked applications: pendulum, predator-prey, inverted pendulum control
Prerequisites#
- Chapter 6 : linear systems, eigenvalues, phase portraits
- Multivariable calculus: partial derivatives, Jacobian matrix
A Visual Tour Before the Theory#
Stability is, at heart, a geometric statement about how trajectories move in phase space. Six pictures tell the entire story of 2D linear systems.

Reading the six pictures. Each portrait is geometry made out of two eigenvalues $\lambda_{1,2}$ of the linearization. Read them in pairs.
- Saddle (real eigenvalues of opposite sign, $\lambda_1 > 0 > \lambda_2$ ). The two eigenvectors carve phase space into a cross: along the unstable manifold $E^u$ trajectories shoot outward at rate $e^{\lambda_1 t}$ , along the stable manifold $E^s$ they decay inward at rate $e^{\lambda_2 t}$ . Every other trajectory is a hyperbola threading between the two: it approaches the equilibrium along $E^s$ , swerves at the closest point, and leaves along $E^u$ . The pass between two mountains is the canonical picture — uphill in one direction, downhill in the perpendicular one, and you can balance on the saddle for an instant if you arrive on $E^s$ exactly.
- Stable / unstable node (real eigenvalues of the same sign). All trajectories enter (or leave) the equilibrium tangent to the eigenvector with the slower (smaller-magnitude) eigenvalue, because along the fast direction the contribution dies first. The picture is a “comb” of curves combed into the slow eigendirection.
- Stable / unstable spiral (complex pair $\alpha \pm i\beta$ ). The real part $\alpha$ is a radial decay/growth rate; the imaginary part $\beta$ is an angular frequency. In polar coordinates the linearized flow is $\dot r = \alpha r,\ \dot\theta = \beta$ , so trajectories trace logarithmic spirals — distance from the origin shrinks (or grows) like $e^{\alpha t}$ while the angle rotates at constant rate $\beta$ . The direction of rotation (clockwise vs counterclockwise) is fixed by the off-diagonal entries of $A$ , not by the eigenvalues themselves.
- Center (purely imaginary eigenvalues). $\alpha = 0$ kills the radial motion and only rotation survives; orbits are nested ellipses determined by $A$ . Centers are the only neutrally stable case in 2D linear systems and are structurally fragile — any small perturbation that adds dissipation turns the center into a spiral.
- Degenerate node (repeated real eigenvalue with one eigenvector). Only one eigendirection exists, and a generalized eigenvector contributes a $t\,e^{\lambda t}$ term, which bends every trajectory tangent to that eigenvector as it approaches the equilibrium. It is the pinched limit between a node (two eigendirections) and a spiral (none).
The single rule of thumb: the real parts decide whether you decay or grow; the imaginary parts decide whether you rotate; the eigenvectors set the axes the picture is drawn on.
For nonlinear systems, the same six pictures still appear — but only locally, near each equilibrium. The damped pendulum and the Lotka-Volterra predator-prey model both show this beautifully:

Stability Defined Precisely#
Consider $\mathbf{x}' = \mathbf{f}(\mathbf{x})$ with equilibrium $\mathbf{x}^*$ (so $\mathbf{f}(\mathbf{x}^*) = \mathbf{0}$ ).
$$ \|\mathbf{x}(0) - \mathbf{x}^*\| < \delta \;\Longrightarrow\; \|\mathbf{x}(t) - \mathbf{x}^*\| < \varepsilon \;\;\text{for all } t > 0. $$Intuition: nearby trajectories stay nearby forever.
Asymptotically stable. Lyapunov stable and $\mathbf{x}(t) \to \mathbf{x}^*$ as $t \to \infty$ . Intuition: nearby trajectories not only stay nearby but eventually return.
Unstable. Not Lyapunov stable.
The basin of attraction is the set of all initial conditions that converge to $\mathbf{x}^*$ . Asymptotic stability is a local property; the basin tells you how local.
Why two definitions? A center (closed orbits) is Lyapunov stable but not asymptotically stable — trajectories stay close but never settle. The Lotka-Volterra model is the classic example.
Linearization: The Jacobian Method#
$$ \mathbf{x}' \;\approx\; J(\mathbf{x} - \mathbf{x}^*), \qquad J_{ij} = \frac{\partial f_i}{\partial x_j}\bigg|_{\mathbf{x}^*}. $$Hartman-Grobman theorem#
If every eigenvalue of $J$ has nonzero real part (a hyperbolic equilibrium), then the nonlinear system is locally topologically equivalent to its linearization $\mathbf{u}' = J\mathbf{u}$ .
- All $\operatorname{Re}(\lambda) < 0$ : asymptotically stable
- Any $\operatorname{Re}(\lambda) > 0$ : unstable
- Purely imaginary eigenvalues: linearization fails — use Lyapunov methods
Example: damped pendulum#
$$\theta'' + \gamma\theta' + \omega_0^2\sin\theta = 0$$| Equilibrium | Jacobian | Verdict |
|---|---|---|
| $(0,0)$ hanging | $\begin{pmatrix}0 & 1 \\ -\omega_0^2 & -\gamma\end{pmatrix}$ | Both eigenvalues have $\operatorname{Re}<0$ when $\gamma>0$ : stable focus |
| $(\pi,0)$ inverted | $\begin{pmatrix}0 & 1 \\ \omega_0^2 & -\gamma\end{pmatrix}$ | One positive eigenvalue: saddle, unstable |
| |
Lyapunov’s Direct Method#

The big idea#
Stability without solving the ODE. Construct an energy-like scalar function $V(\mathbf{x})$ and show it decreases along trajectories.
Requirements.
- $V(\mathbf{x}^*) = 0$ and $V(\mathbf{x}) > 0$ otherwise (positive definite)
- $\dot V = \nabla V \cdot \mathbf{f}(\mathbf{x}) \leq 0$ along orbits
Stability theorems.
| Sign of $\dot V$ | Conclusion |
|---|---|
| $\dot V \leq 0$ | $\mathbf{x}^*$ Lyapunov stable |
| $\dot V < 0$ except at $\mathbf{x}^*$ | Asymptotically stable |
| $V > 0,\ \dot V > 0$ | Unstable (Chetaev) |
Why it works — the picture#
Trajectories cross level sets of $V$ inward. Since $V$ has a minimum at $\mathbf{x}^*$ , they cannot escape arbitrarily-small level sets, and (with strict descent) they slide all the way to the bottom.

How to find $V$ #
- Physical energy: kinetic + potential for mechanical systems
- Quadratic forms: $V = \mathbf{x}^T P \mathbf{x}$ where $P$ solves the Lyapunov equation $A^T P + PA = -Q$
- Trial: start with $V = x^2 + y^2$ , compute $\dot V$ , adjust coefficients
Example: pendulum energy#
$$V(\theta, \omega) = \tfrac{1}{2}\omega^2 + (1 - \cos\theta), \qquad \dot V = -\gamma\omega^2 \leq 0.$$The hanging position is stable. LaSalle’s principle (next) upgrades this to asymptotic.
LaSalle’s Invariance Principle#
Sometimes $\dot V \leq 0$ but vanishes on a whole set, not just at $\mathbf{x}^*$ . Standard Lyapunov only gives stability, not attraction.
Theorem. Let $E = \{\mathbf{x} : \dot V = 0\}$ and $M$ be the largest invariant subset of $E$ . Every bounded trajectory approaches $M$ .
If $M = \{\mathbf{x}^*\}$ , then $\mathbf{x}^*$ is asymptotically stable.
For the damped pendulum, $\dot V = 0$ requires $\omega = 0$ . But on the line $\omega = 0$ the dynamics force $\dot\omega = -\omega_0^2 \sin\theta \neq 0$ unless also $\theta = 0$ . So $M = \{(0,0)\}$ and we get asymptotic stability for free.
Trace-Determinant Classification#
For $\mathbf{x}' = A\mathbf{x}$ in 2D, set $\tau = \operatorname{tr}(A)$ and $\Delta = \det(A)$ . Then $\lambda_{1,2} = \tfrac12(\tau \pm \sqrt{\tau^2 - 4\Delta})$ , and:
| Region | Type |
|---|---|
| $\Delta < 0$ | Saddle |
| $\Delta > 0,\ \tau < 0,\ \tau^2 > 4\Delta$ | Stable node |
| $\Delta > 0,\ \tau > 0,\ \tau^2 > 4\Delta$ | Unstable node |
| $\Delta > 0,\ \tau < 0,\ \tau^2 < 4\Delta$ | Stable spiral |
| $\Delta > 0,\ \tau > 0,\ \tau^2 < 4\Delta$ | Unstable spiral |
| $\Delta > 0,\ \tau = 0$ | Center |
| $\tau^2 = 4\Delta$ | Degenerate / improper node |
A single picture compresses this entire table:

Bifurcations: When the Picture Itself Changes#
Slowly turn a parameter knob $r$ . Equilibria can be born, die, or swap stability. Four “normal forms” capture every codimension-1 bifurcation locally.

| Bifurcation | Normal form | What happens |
|---|---|---|
| Saddle-node | $\dot x = r + x^2$ | Two equilibria collide and annihilate at $r = 0$ |
| Transcritical | $\dot x = rx - x^2$ | Two equilibria pass through each other and exchange stability |
| Pitchfork | $\dot x = rx - x^3$ | One equilibrium splits into three (symmetry breaking) |
| Hopf | complex eigenvalues cross $i\mathbb{R}$ | A stable focus loses stability and a limit cycle appears |
Hopf is the mechanism behind every self-sustained oscillation in nature — from heartbeats to the pulsing of variable stars.
Application 1: Lotka-Volterra Predator-Prey#
$$x' = ax - bxy, \qquad y' = -cy + dxy$$ $$ H(x,y) = dx - c\ln x + by - a\ln y $$makes every orbit closed. The system has periodic population cycles (right panel of fig 2).
Application 2: Inverted Pendulum Control#
The inverted equilibrium is a saddle. Linear feedback $u = -K\mathbf{x}$ shifts the closed-loop eigenvalues into the open left half-plane, converting the saddle into a stable focus.
| |
Exercises#
Basic.
- Determine stability for: (a) $x' = -x,\ y' = -2y$ ; (b) $x' = y,\ y' = -\sin x - 0.5y$ .
- Use $V = x^2 + y^2$ to analyze $x' = -x + y^2,\ y' = -y$ .
- Find all bifurcation points of $\dot x = rx - x^3$ .
Advanced.
- Prove total energy is a Lyapunov function for the damped pendulum, then apply LaSalle.
- Analyze the Van der Pol oscillator: show the origin is unstable but a stable limit cycle exists.
- For Lotka-Volterra competition, derive the conditions for coexistence vs. exclusion.
Programming.
- Auto-classify 2D linear-system equilibria from trace and determinant; reproduce fig 3.
- Animate the Hopf bifurcation: sweep $\mu$ and watch the limit cycle grow.
Numerical Side: Letting SciPy Solve the Lyapunov Equation#
On paper, $A^\top P + PA = -Q$
looks like a matrix equation you can stare at. By hand, two dimensions is the limit. Past that, call scipy.linalg.solve_continuous_lyapunov:
| |
Under the hood it runs Bartels-Stewart: Schur-decompose $A = U T U^\top$ , transform the unknown to $\tilde P = U^\top P U$ , and back-substitute column by column on the resulting upper-triangular system. Cost is $O(n^3)$ , which beats the naive Kronecker-product flattening by a factor of $n^3$ .
Failure mode. If $A$
has eigenvalues on the imaginary axis the equation is singular and SciPy raises LinAlgError. That error is the numerical fingerprint of a non-hyperbolic equilibrium where Hartman-Grobman fails — same phenomenon, two languages.
When Linearization Fails: Center Manifolds#
Hartman-Grobman needs every Jacobian eigenvalue to have non-zero real part. The moment one sits on the imaginary axis, the linear part only tells you the neutral direction; nonlinear terms decide stability.
Toy case: $\dot x = -x^3$ . The Jacobian at $0$ is $0$ , so linear analysis is silent. But $V(x) = x^2/2$ gives $\dot V = -x^4 \le 0$ , hence stable. Lyapunov sees what eigenvalues miss.
Centre Manifold Theorem. With $n_s$ stable and $n_c$ center directions, an invariant $n_c$ -dimensional manifold $W^c$ exists; nearby trajectories collapse onto it exponentially. Stability of the full system reduces to stability on $W^c$ . Hopf normal forms (next chapter) are derived this way.
Practical rule. If np.linalg.eigvals(J) returns an eigenvalue with abs(real) < 1e-8, do not declare stability from spectrum alone. Either build a Lyapunov function or expand to higher Taylor order.
ML Connection: Lyapunov Neural Networks and Stability-Constrained Training#
$$ V_\theta(x) > 0,\quad V_\theta(0) = 0,\quad \nabla V_\theta(x)^\top f(x) < 0. $$Two implementation tricks I have actually used:
- Bake positivity into the architecture. Write $V_\theta(x) = \|\phi_\theta(x)\|^2 + \epsilon \|x\|^2$ with $\phi_\theta$ a standard MLP. Then $V_\theta \ge \epsilon\|x\|^2$ holds by construction, no penalty term needed.
- Verify the descent condition with an SMT solver. Sample-based loss is not a proof. After training, hand $V_\theta$ and $f$ to dReal or Z3, get a counterexample, retrain — CEGIS loop.
References worth tracking: Neural Lyapunov Control (Chang et al., 2019) and Learning Stability Certificates from Data (Boffi et al., 2020). Already deployed on legged robot controllers.
Summary#
| Concept | Key Point |
|---|---|
| Lyapunov stability | Nearby trajectories stay nearby |
| Asymptotic stability | Nearby trajectories converge to equilibrium |
| Linearization | Jacobian eigenvalues determine local fate (if hyperbolic) |
| Lyapunov function | Energy-like scalar that proves stability without integration |
| LaSalle’s principle | Upgrades $\dot V \leq 0$ to asymptotic stability via invariant sets |
| Trace-determinant plane | Single picture classifying every 2D linear system |
| Bifurcations | Saddle-node, transcritical, pitchfork, Hopf — four ways the picture changes |
References#
- Strogatz, Nonlinear Dynamics and Chaos, CRC Press (2015)
- Khalil, Nonlinear Systems, Prentice Hall (2002)
- Guckenheimer & Holmes, Nonlinear Oscillations, Dynamical Systems, and Bifurcations, Springer (1983)
- Perko, Differential Equations and Dynamical Systems, Springer (2001)
This is Part 7 of the 18-part series on Ordinary Differential Equations.
- Part 1: Origins and Intuition
- Part 2: First-Order Methods
- Part 3: Higher-Order Linear Theory
- Part 4: The Laplace Transform
- Part 5: Power Series and Special Functions
- Part 6: Linear Systems and the Matrix Exponential
- Part 7: Stability Theory (current)
- Part 8: Nonlinear Systems and Phase Portraits
- Part 9: Chaos Theory and the Lorenz System
- Part 10: Bifurcation Theory
- Part 11: Numerical Methods
- Part 12: Boundary Value Problems
- Part 13: Introduction to PDEs
- Part 14: Epidemic Models
- Part 15: Population Dynamics
- Part 16: Fundamentals of Control Theory
- Part 17: Physics and Engineering Applications
- Part 18: Frontiers and Series Finale
ODE Foundations 18 parts
- 01 Ordinary Differential Equations (1): Origins and Intuition
- 02 Ordinary Differential Equations (2): First-Order Methods
- 03 Ordinary Differential Equations (3): Higher-Order Linear Theory
- 04 Ordinary Differential Equations (4): The Laplace Transform
- 05 Ordinary Differential Equations (5): Power Series and Special Functions
- 06 Ordinary Differential Equations (6): Linear Systems and the Matrix Exponential
- 07 Ordinary Differential Equations (7): Stability Theory you are here
- 08 Ordinary Differential Equations (8): Nonlinear Systems and Phase Portraits
- 09 Ordinary Differential Equations (9): Chaos Theory and the Lorenz System
- 10 Ordinary Differential Equations (10): Bifurcation Theory
- 11 Ordinary Differential Equations (11): Numerical Methods
- 12 Ordinary Differential Equations (12): Boundary Value Problems
- 13 Ordinary Differential Equations (13): Introduction to Partial Differential Equations
- 14 Ordinary Differential Equations (14): Epidemic Models and Epidemiology
- 15 Ordinary Differential Equations (15): Population Dynamics
- 16 Ordinary Differential Equations (16): Fundamentals of Control Theory
- 17 Ordinary Differential Equations (17): Physics and Engineering Applications
- 18 Ordinary Differential Equations (18): Frontiers and Series Finale