Learning Objectives
By the end of this section you will be able to:
- Write the general solution of when the 2×2 matrix has two real distinct eigenvalues.
- Explain why the eigenvectors are the "natural axes" of the system and how they decouple the equations.
- Recognise the three qualitative pictures — stable node, unstable node, saddle — just from the signs of .
- Fit the constants to an initial condition by solving a single 2×2 linear system.
- Implement the eigenvalue method in NumPy and verify the closed-form solution with PyTorch autograd.
The Setup: Two Coupled Equations
A planar linear system is just two scalar ODEs that mix into each other:
Bundling the two unknowns into the vector compresses the whole system into one tidy line:
The coupling is the whole problem. If the two equations are independent and we already know the answer from the scalar case: .
For generic the off-diagonal entries couple and : you cannot integrate one without knowing the other. The whole eigenvalue method exists to un-couple the system — to find a new pair of coordinates in which the equations are independent again.
Where the trial solution comes from
Inspired by the scalar case, we look for solutions of the form for some scalar and some constant vector . Plug into :
Cancel (never zero) and you get the eigenvalue equation: .
The Key Insight: Eigenvectors Decouple the System
Suppose has two real distinct eigenvalues with eigenvectors and . The trick is to look at the problem in the basis instead of .
Any vector can be written as a unique combination . Differentiating in time and using :
and matching against gives:
What just happened
In the eigenbasis the two equations are completely independent scalar ODEs. Each one is just exponential growth or decay at its own rate :
Translating back into the original coordinates, .
The General Solution Formula
Putting it together, every solution of the coupled system is:
Two arbitrary constants — exactly what we expect for a second-order problem (two scalar equations, two free constants). They are pinned by the initial condition , which gives the linear system:
Because the two eigenvectors are linearly independent (this is exactly where the "distinct eigenvalues" hypothesis bites), the matrix is invertible and is unique.
The recipe in five steps
- Compute the characteristic polynomial .
- Find the two roots . Confirm they are real and distinct .
- For each , solve to get an eigenvector .
- Write .
- Solve the 2×2 linear system for the constants.
Three Personalities: Stable Node, Unstable Node, Saddle
The qualitative behavior of every real-distinct-eigenvalue system is controlled by just the signs of and . Three cases, three pictures:
| Case | Sign pattern | Origin behavior | Long-term direction |
|---|---|---|---|
| Stable node | λ₁ < λ₂ < 0 | All trajectories spiral into 0 | Tangent to the SLOWER eigenvector (λ₂, less negative) |
| Unstable node | 0 < λ₁ < λ₂ | All trajectories fly out from 0 | Tangent to the FASTER eigenvector (λ₂, more positive) |
| Saddle | λ₁ < 0 < λ₂ | Some come in, some go out | Ejected along the unstable eigenvector v₂ |
Why the "slow direction" wins (nodes)
In a stable node the trajectory is . If , then decays faster than . As , the term hangs on longer, so . The trajectory approaches the origin tangent to the slower eigenvector.
Same algebra in reverse for the unstable node, with dominated by the faster exponential.
Why the saddle is so dramatic
With , one mode decays and the other grows. Any initial condition with even the tiniest component eventually shoots off along — because the growing exponential wins, no matter how small starts.
The only way to actually approach the origin is to start exactly on the stable eigenvector line , where . That line is called the stable manifold; the opposite line is the unstable manifold. Saddle points are unforgiving: they are the reason "balancing a pencil on its tip" is impossible.
A handy classifier (no eigenvalues needed)
From the trace and the determinant you can read off the case directly without solving the quadratic:
- : saddle (one eigenvalue positive, one negative).
- : stable node.
- : unstable node.
(For the other cases — complex or repeated eigenvalues — see sections 23.05 and 23.06.)
Worked Example: A Saddle Point
Solve
Click to expand the full hand calculation
, so
Cross-check by trace–determinant: , , so ✓.
Discriminant: , so :
Opposite signs ⇒ saddle.
Solve . Both rows reduce to , so any nonzero multiple of works.
. Both rows give , so (and any scalar multiple) works.
At : . That gives the 2×2 system , . Subtract: , so and .
✓.
At : and , giving .
At : but , so .
By the stable mode has shrunk by a factor of relative to the unstable one. The trajectory is effectively on the line — exactly the picture the saddle predicts.
Differentiate: . Compute on each term: and ✓. Mode by mode the equation holds — and the PyTorch residual below confirms it to machine precision.
Interactive Mode Decomposition
The next playground makes the formula visible. The left panel is the phase plane with the two eigenvector axes (red and blue dashes). The right panel draws the two modes as tip-to-tail arrows and sums them into the purple . The bottom strip is the time series of the two components.
Four things to discover
- Load the Saddle preset and press play. Watch the red mode (unstable) explode while the blue mode (stable) shrinks to nothing. By the purple arrow is essentially on the red eigenvector line — that is the unstable manifold taking over.
- On the saddle preset, drag the white initial point exactly onto the blue eigenvector line (you should see in the readout). Press play: the trajectory now actually approaches the origin — that is the stable manifold. Bump the IC off this line by even a hair: the unstable mode wakes up and the trajectory eventually shoots away.
- Load Stable node. Both eigenvalues are negative; every trajectory comes in. As grows the trajectory aligns with the eigenvector for the less-negative eigenvalue — the slow direction wins, the fast direction dies first. Compare the time-series slopes: the red mode (more negative) decays steeper.
- Slide the angle between and down toward . The eigenvectors become nearly parallel, and the matrix becomes nearly singular. Notice how blow up — small angles between eigenvectors are the numerical pain point of this method.
Phase Portrait Playground
For a broader sandbox, here is the general phase-portrait explorer you also met in section 23.03. Drag the four matrix entries directly; click anywhere to drop a new trajectory. Whenever the matrix has real distinct eigenvalues the two dashed eigenvector lines appear, and the info card reads off the classification.
Things to play with
- Start with the loaded matrix — the same saddle as the worked example. Notice the trajectories initially curve from anywhere in the plane, then all asymptote along the same eigenvector line.
- Hit the Stable node preset (a diagonal matrix). The eigenvectors line up with the axes; trajectories are just decaying exponentials in each coordinate.
- Slide from 0 up past . Watch the determinant cross zero — the moment becomes positive (and trace stays positive), the classification card flips from Saddle to Unstable node. That is a bifurcation in the trace-determinant plane.
Computation in Python
We turn the five-step recipe into a self-contained NumPy function. It eigendecomposes , projects the initial condition into the eigenbasis, propagates each mode by its own scalar exponential, and reassembles . No time-stepping, no integration error — purely linear algebra.
Eigenvalue method, vectorized over the time grid
Why this beats a generic ODE solver here
For a linear system with constant coefficients, a black-box integrator (RK4, Dormand-Prince, …) must take many small time steps and accumulates discretization error. The eigenvalue method gives the exact closed form. The savings become enormous when is large (stiff systems) — the "stiffness penalty" only shows up for time-stepping methods.
PyTorch View: Autograd Residual Check
Hand-derived ODE solutions are easy to get wrong. The cheapest possible test: take your candidate , autodifferentiate it to get , and check that the residual is machine-zero on every grid point.
Bridge to physics-informed neural networks (PINNs)
The residual you just built is the exact loss that PINNs minimise: they parametrise as a neural network and train so that is small at sampled collocation points. For linear systems we already have the analytic answer — this section's closed form is the gold standard against which every learned solver is measured.
Common Pitfalls
Applying the IC to one mode only
The initial condition pins both constants at once. Solve the full 2×2 system ; do not set and unless your eigenvectors happen to be the standard basis (i.e. unless is already diagonal).
Forgetting that eigenvectors are determined only up to scale
Any nonzero scalar multiple of an eigenvector is again an eigenvector. Different textbooks, different software libraries, and different students will land on different normalizations. The general solution is the same — but the numerical values of change inversely. Always pair your with the specific you used.
Confusing “node” with “saddle”
A node has both eigenvalues of the same sign (stable if negative, unstable if positive). A saddle has eigenvalues of opposite signs. The single quickest test: look at . is negative exactly for saddles.
Ignoring near-parallel eigenvectors
If the angle between and is small, the change-of-basis matrix is ill-conditioned and can be huge with massive opposite-sign cancellation in the formula. This is the same numerical issue you saw on the mode-explorer when you shrank the angle slider — the trajectory is still correct mathematically, but small floating-point perturbations move it a lot. In production, prefer over forming explicitly.
Trying this method when the eigenvalues are repeated
If , the matrix may have only one independent eigenvector — you do not get two linearly independent solutions of the form . The missing solution has the form with a generalized eigenvector. That is section 23.06.
Summary
For a 2×2 linear system whose matrix has two real distinct eigenvalues:
- Every solution is a sum of two independent modes: .
- The eigenvectors are the natural axes: in their basis the equations decouple into two scalar exponentials.
- The constants are pinned by solving the single 2×2 system .
- The qualitative picture is determined by the signs of the eigenvalues: both negative ⇒ stable node; both positive ⇒ unstable node; opposite signs ⇒ saddle.
- For long-time behavior the eigenvalue with the largest real part wins. In nodes, that "slow" direction is what trajectories asymptote to; in saddles, the positive eigenvalue's direction is the unstable manifold that swallows almost every trajectory.
Cheat sheet
| Quantity | Formula | Geometric meaning |
|---|---|---|
| Characteristic polynomial | λ² − (tr A) λ + det A | Roots = eigenvalues. |
| Discriminant | (tr A)² − 4 det A | Positive ⇒ real distinct eigenvalues (this section). |
| Eigenvector for λₖ | (A − λₖ I) vₖ = 0 | Direction in which A acts by scaling, not rotating. |
| General solution | x(t) = c₁ e^(λ₁t) v₁ + c₂ e^(λ₂t) v₂ | Superposition of two pure exponential modes. |
| Constants | V c = x₀ with V = [v₁ | v₂] | Project initial condition into the eigenbasis. |
| Saddle test | det A < 0 | Eigenvalues have opposite signs. |
| Stable-node test | det A > 0, tr A < 0, (tr A)² > 4 det A | Both eigenvalues real and negative. |
| Unstable-node test | det A > 0, tr A > 0, (tr A)² > 4 det A | Both eigenvalues real and positive. |
Coming next: Section 23.05 tackles complex eigenvalues. When the discriminant goes negative the exponentials become spirals — the closed form is the same superposition, but read through Euler's identity it turns into damped (or growing) oscillation.