Learning Objectives
By the end of this section you will be able to:
- Recognize when a 2×2 linear system has complex eigenvalues directly from the discriminant of its characteristic polynomial.
- Convert a complex solution into two independent real solutions using Euler's formula.
- Read off the geometry of the phase portrait — stable spiral, unstable spiral, or center — from the sign of alone.
- Compute the period of the rotation directly from the imaginary part.
- Solve the canonical example from scratch and verify it three ways: by hand, by RK4 in plain Python, and by in PyTorch.
- Interpret the same machinery as the mathematics of mechanical vibration, RLC circuits, and any other system that oscillates while decaying.
The Big Picture: Oscillation Hidden in Algebra
In section 23.04 we saw what happens when a 2×2 matrix has two real, distinct eigenvalues. The eigenvectors point along two real lines, and every trajectory is a mixture of two pure exponentials and . Phase portraits look like saddles, nodes, or stars.
But many physical systems don't flow along straight lines — they rotate. A pendulum swings back and forth. A capacitor and inductor swap energy. A planet circles its star. Algebraically, the only way for a system of the form to rotate is for its eigenvalues to have a nonzero imaginary part. That is the signal that the algebra is hiding a sine and a cosine.
The motivating problem
Consider . The characteristic equation has solutions — pure imaginary, no real part at all.
If we plug in mechanically, we get a complex trajectory. But the matrix is real, and any physical we measure has to be real. How do we get a real answer out of complex algebra?
The answer is Euler's formula. Once we extract the real and imaginary parts of the complex solution, we get exactly two independent real solutions: one that looks like times one vector minus times another, and one that does the same with the roles of sine and cosine swapped. The geometric picture is a rotation in the plane, optionally scaled by to make it spiral.
When Do Complex Eigenvalues Appear?
For a 2×2 real matrix the characteristic polynomial is
The quadratic formula gives
The eigenvalues are complex precisely when the discriminant is negative. In that case
The trace–determinant test in one line
Complex eigenvalues ⇔ . Furthermore and , so the determinant must be positive whenever the eigenvalues are complex. This is the strict subset of the trace–determinant plane that sits above the parabola .
Two real numbers and appear naturally: controls growth or decay, and controls how fast the trajectory rotates. They are the two knobs the rest of the section will turn.
The Complex Solution and Why It's a Problem
The eigenvector method works mechanically even when the eigenvalues are complex. If and , then a formal solution of is
Two pieces of trouble lurk here.
- is a complex vector. We cannot point at it on a real plane.
- is a complex number for every . So has imaginary components, but a physical state vector (like position and velocity) must be real.
We are saved by two facts that fit together perfectly:
- Real-matrix shortcut. Because is real, eigenvalues come in conjugate pairs — if is one, then is the other. Their eigenvectors are also conjugates: .
- Real-linear closure. If is a complex solution of a real linear ODE, then and are each a real solution of that same ODE.
Why real-linear closure holds
A linear operator with real coefficients satisfies and likewise for the imaginary part. So if , both and . Splitting a complex solution into its real and imaginary parts gives two real solutions for free.
The Euler Bridge: From Complex to Real
Write the complex eigenvector as with — its real and imaginary parts. Then by Euler's formula ,
Multiply out the second factor carefully:
So the real and imaginary parts of are
These are two real vector-valued functions, and they are linearly independent (a sine wave and a cosine wave with the same frequency can never be proportional). They form a fundamental set of real solutions for our system.
Two Real Solutions from One Complex Pair
The general real solution is therefore
with two real constants pinned by the initial condition.
A useful reorganization
Group by basis vector instead of by trig function:
The coefficient of oscillates 90° out of phase with the coefficient of . That phase lag is the algebraic source of the rotation we'll see geometrically next.
Pinning the constants is straightforward. At :
So are the coordinates of the initial state in the basis . One 2×2 linear solve and we're done.
Geometric Meaning: Rotation + Scaling
Put the formula in its cleanest form. Choose the basis as your axes in the plane. Then the solution looks like
Inside the bracket sits a standard rotation matrix by angle . In front sits a scalar that uniformly stretches or shrinks the plane. That is the entire geometric content of complex eigenvalues:
Complex eigenvalues = rotation + uniform scaling. is the angular frequency of the rotation; is the exponential rate at which the radius grows () or shrinks () or stays constant ().
For the canonical matrix — the one the interactive explorer below uses — this geometric picture is exact in the standard axes, with and . For a general with complex eigenvalues, the picture is the same up to a linear change of coordinates into the basis .
The Three Regimes: Spirals and Centers
The sign of selects one of three qualitatively distinct phase portraits.
| Sign of α | Name | Geometry | As t → ∞ | Energy interpretation |
|---|---|---|---|---|
| α < 0 | Stable spiral (sink) | Trajectories spiral INTO the origin | ‖x‖ → 0 | Energy is being dissipated (damping) |
| α = 0 | Center | Trajectories trace CLOSED orbits (ellipses) | ‖x‖ stays bounded — pure rotation | Energy is conserved exactly |
| α > 0 | Unstable spiral (source) | Trajectories spiral AWAY from the origin | ‖x‖ → ∞ | Energy is being injected (driving) |
Notice that direction of rotation (clockwise vs counterclockwise) is independent of all this — it depends only on the sign of the off-diagonal entry in the general matrix (positive → counterclockwise). The growth/decay regime and the rotation direction are independent knobs.
The trace–determinant map
On the plane, complex eigenvalues live above the parabola . Within that region:
- → unstable spirals,
- → centers (the positive axis),
- → stable spirals.
Section 23.03 builds the full map. Complex eigenvalues are the "upper half" of it.
Worked Example:
Solve with initial condition .
Click to expand the full hand calculation
. Determinant , so and .
So (growth rate) and (angular frequency). Already we know: unstable spiral, period .
Pick . Solve :
The first row gives , so . Choose to obtain
Quick check on the second row: ✓.
With , , , :
At : . Match to : , .
This describes a point starting at , rotating counterclockwise with angular frequency 2, while its distance from the origin grows like . After one period it has returned to angle 0 but at radius .
✓ (first row of ).
✓ (second row).
, , .
So and . The Python and PyTorch computations below should reproduce these numbers to many decimal places.
Interactive Phase-Portrait Explorer
The explorer below fixes the matrix in its canonical form so the two sliders are exactly the real and imaginary parts of the eigenvalues. (gold arrow) and (purple arrow) are the real/imaginary parts of the eigenvector. Click anywhere in the plane to drop a new initial condition; its trajectory is integrated forward (color) and backward (gray) by RK4.
Experiments to run
- Push all the way to . Every orbit becomes a perfect circle of radius equal to its initial distance from the origin — the center regime. Now nudge slightly negative — the circles tilt into inward spirals (stable). Slightly positive — outward spirals (unstable). The qualitative picture flips at the SIGN of , not its size.
- With , change and watch the animated dot speed up. Halving exactly doubles the period — match it to the displayed .
- Set , . The trajectories make many rotations before noticeably shrinking — typical of a lightly damped oscillator. Pendulums and tuning forks live here.
- Set , . The decay dominates the rotation — trajectories barely curl before reaching the origin. This is heavy damping.
The Time-Series View
The phase portrait shows the trajectory as a curve in the plane. The time-series view shows each component and separately, as oscillating functions of time. Both views describe the same motion — but the time-series view is what an oscilloscope would record, and it makes the role of (envelope) versus (frequency) crystal clear.
Two views, one motion
The phase portrait suppresses time; the time-series view suppresses geometry. The two views together are the complete picture. The envelope in the time view is the same thing as the radial growth in the phase portrait. The phase lag between and is the same thing as the rotation. Trade fluency between them.
Computing the Solution in Python
Two complementary computations. First the closed-form path: extract the complex eigenvalue, split into , assemble the formula, pin the constants. Then the numerical path: integrate the ODE directly with RK4 and verify both branches agree to many digits. The two paths are independent — if they meet in the middle, both are right.
Path 1: closed-form via the eigendecomposition
Path 2: pure numerical integration with RK4
Why teach both paths
The closed-form path is the structural answer — it tells you what kind of trajectory you have and exposes the two knobs . The numerical path is the universal answer — it doesn't care whether the system is linear or whether the eigenvalues even exist. When you move to nonlinear systems in section 23.07 the closed-form path disappears, but the RK4 path still works.
PyTorch View: Eigendecomposition and Matrix Exponential
PyTorch gives us a third independent route to the same answer: , the matrix exponential. This is the most elegant closed form possible — one formula, no special cases, valid whether the eigenvalues are real, complex, or even repeated. We then use autograd to verify that the closed-form trajectory satisfies the ODE pointwise.
Why the matrix exponential is the "right" answer
For a linear system the operator propagates ANY initial condition to the state at time . It packages the eigenvalue analysis (real, complex, repeated) into a single object. When has complex eigenvalues , the matrix contains entries built from and — exactly the building blocks we derived by hand. Chapter 24 (Laplace transforms) gives you a third way to compute it.
Physical Meaning: Where This Appears in Nature
| System | Equations | α and β | Regime |
|---|---|---|---|
| Mass on a spring with damping | m ẍ + c ẋ + k x = 0 | α = −c / 2m, β = √(k/m − α²) | Stable spiral (under-damped) |
| Pendulum (small angle, no friction) | θ̈ + (g/L) θ = 0 | α = 0, β = √(g/L) | Center |
| RLC circuit (series) | L Q̈ + R Q̇ + Q/C = 0 | α = −R / 2L, β = √(1/LC − α²) | Stable spiral |
| Predator-prey near coexistence | linearization of Lotka–Volterra | α = 0 (at the fixed point), β = √(r·s) | Center (locally) |
| Coupled neurons (simple model) | v̇ = … ẇ = … | depends on synaptic strengths | Stable or unstable spiral |
Every one of these is a 2D linear (or linearized) system whose matrix has complex eigenvalues. Whenever you see damped oscillation in the physical world, the underlying algebra is a spiral in some phase plane, and the math you just learned is the complete description of it.
The under-damped oscillator in one line
For with (under-damped), let be the undamped frequency and the damping ratio. Then and . The decay envelope is and the oscillation has period . Every formula in this section specializes to this one engineering recipe.
Common Pitfalls
Confusing v with p and q
is the complex eigenvector. Individually, neither nor is an eigenvector of . They are real vectors that span the real 2D plane on which the rotation happens. Don't try to verify — you'll find it doesn't hold.
Forgetting the minus sign in cos(βt) p − sin(βt) q
The real part of is , with a minus. It comes from . Forgetting the minus gives a solution that satisfies a related but different ODE — the verification step in Step 7 of the worked example will catch it.
Mistaking a center for a spiral on a finite-time plot
On a numerical phase portrait integrated for only a few periods, a weak spiral (small ) and a true center look almost identical. To distinguish, run the simulation for many periods or — better — compute the eigenvalues symbolically. Numerical drift in an RK4 simulation can even make a mathematical center look like a slow spiral; that's a discretization artifact, not physics.
Picking the "wrong" eigenvalue of the pair
If you happen to pick with eigenvector instead, you get the same two real solutions back — just with negated and a sign flip in the formula. The general real solution is the same set. The conjugate eigenpair carries no new information.
Numerical eigenvectors are normalised in the COMPLEX inner product
When you call np.linalg.eig the returned eigenvectors satisfy using the conjugate transpose. So but neither nor is individually unit length. That is fine — the overall scaling is absorbed when you fit the constants to the initial condition.
Summary
Complex eigenvalues are not an exotic edge case — they are the algebra of every oscillating linear system. The recipe is short:
- Compute eigenvalues of .
- Find one complex eigenvector .
- Form the real general solution .
- Pin by solving the 2×2 system .
Master picture
Geometrically, the flow is a rotation by angle combined with a uniform radial scaling by . The sign of alone selects:
- : stable spiral — orbits decay into the origin.
- : center — orbits are closed ellipses.
- : unstable spiral — orbits grow without bound.
Coming next: Section 23.06 handles the last linear case — repeated eigenvalues, where the eigenvector method gives only one solution and we have to build the second from a generalized eigenvector. After that, section 23.07 enters the nonlinear world, where eigenvalues of the linearization tell us the local geometry near every fixed point.