1 / 28
Chapter 4 · Systems of DEs

Higher-Order ODEs as Systems

One second-order equation, three eigenvalue cases, solved end to end
Dr. Mohamed Mabrok · Qatar University

Why Turn a Good Equation Into a System?

You can already solve $y'' + 5y' + 6y = 0$ with the characteristic equation. So why rewrite it as two equations and bring in eigenvalues?
Because the world is coupled
Two tanks, two masses, an RLC network. Those are systems from the start, and there is no single scalar equation to write.
Because computers need it
Every numerical solver you will ever call — Runge–Kutta, MATLAB's ode45, SciPy — takes first-order systems only. This conversion is what you do before you type.
Because it shows you the picture
The eigenvalues tell you the behaviour before you solve: settles, oscillates, blows up. The scalar method hides that.
Today
One recipe, then the same second-order equation solved three times — once for each thing the eigenvalues can do. Same initial conditions every time, so only the case changes.

The Conversion Recipe

The rule is always the same: name every derivative below the highest one.
1 Set $x_1 = y$, $x_2 = y'$  (for order $n$, go up to $x_n = y^{(n-1)}$)
2 Differentiate each one. Every $x_k'$ is simply the next $x$.
3 For the last one, use the original equation to replace $y''$.
$$x_1 = y, \quad x_2 = y' \;\;\Longrightarrow\;\; \begin{cases} x_1' = x_2 \\ x_2' = y'' = -q\,x_1 - p\,x_2 \end{cases}$$
Read the first equation again
$x_1' = x_2$ is not a modelling assumption. It is just the sentence "the derivative of $y$ is $y'$", written down. Half of this conversion is bookkeeping.

The Companion Matrix

Write $\;y'' + p\,y' + q\,y = 0\;$ in matrix form and you always get the same shape:
$$\mathbf{x}' = A\mathbf{x}, \qquad A = \begin{pmatrix} 0 & 1 \\ -q & -p \end{pmatrix}$$
Two facts you can read straight off
$\operatorname{tr}A = -p$ and $\det A = q$.
So the characteristic equation is
$$\lambda^2 + p\lambda + q = 0$$
This is the whole point
That is exactly the characteristic equation you would have written in Chapter 2. Converting to a system does not change the mathematics at all — it changes what you can see. Your eigenvalues are your old roots $r$, wearing a different hat.

A Shortcut You Should Know

For a companion matrix you never have to solve for the eigenvector. It is always the same.
$$\mathbf{v} = \begin{pmatrix} 1 \\ \lambda \end{pmatrix}$$
Check it, in one line:
$$\begin{pmatrix} 0 & 1 \\ -q & -p \end{pmatrix} \begin{pmatrix} 1 \\ \lambda \end{pmatrix} = \begin{pmatrix} \lambda \\ -q - p\lambda \end{pmatrix} = \begin{pmatrix} \lambda \\ \lambda^2 \end{pmatrix} = \lambda \begin{pmatrix} 1 \\ \lambda \end{pmatrix}$$
The middle step is where the characteristic equation earns its keep: $\lambda^2 = -q - p\lambda$ is exactly $\lambda^2 + p\lambda + q = 0$ rearranged.
And it makes sense
The eigenvector is $(y, y')$ for the solution $y = e^{\lambda t}$. Of course the second entry is $\lambda$ times the first — differentiating $e^{\lambda t}$ multiplies it by $\lambda$.

Three Cases, and Only Three

A real quadratic has a discriminant. That is all that stands between you and the answer.
$p^2 - 4q \gt 0$
Distinct real
Two eigenvalues, two eigenvectors. The easy one.
$p^2 - 4q = 0$
Repeated
One eigenvalue, and — the whole difficulty — often only one eigenvector.
$p^2 - 4q \lt 0$
Complex pair
$\lambda = \alpha \pm i\beta$. Real answers hiding inside complex arithmetic.
The three problems today
$y'' + 5y' + 6y = 0$, then $y'' + 4y' + 4y = 0$, then $y'' + 2y' + 5y = 0$ — all with $y(0) = 1$, $y'(0) = 0$. Identical data. Only the discriminant changes.

Problem 1 — Distinct Real Eigenvalues

$$y'' + 5y' + 6y = 0, \qquad y(0) = 1, \quad y'(0) = 0$$
Step 1 — convert. Set $x_1 = y$, $x_2 = y'$.
$$\begin{cases} x_1' = x_2 \\ x_2' = -6x_1 - 5x_2 \end{cases}$$
$$\mathbf{x}' = \begin{pmatrix} 0 & 1 \\ -6 & -5 \end{pmatrix}\mathbf{x}, \quad \mathbf{x}(0) = \begin{pmatrix} 1 \\ 0 \end{pmatrix}$$
Where the second row came from
The original equation says $y'' = -6y - 5y'$. In the new names, that is $x_2' = -6x_1 - 5x_2$. Nothing was solved — it was rearranged.

Problem 1 — Eigenvalues

Step 2 — find where $\det(A - \lambda I) = 0$.
$$\det\begin{pmatrix} -\lambda & 1 \\ -6 & -5-\lambda \end{pmatrix} = (-\lambda)(-5-\lambda) - (1)(-6) = \lambda^2 + 5\lambda + 6$$
$$\lambda^2 + 5\lambda + 6 = (\lambda + 2)(\lambda + 3) = 0 \;\;\Longrightarrow\;\; \lambda_1 = -2, \;\; \lambda_2 = -3$$
Discriminant check
$p^2 - 4q = 25 - 24 = 1 \gt 0$. Two distinct real roots, exactly as promised — and both negative, so we already know the answer decays before we have written it down.

Problem 1 — Eigenvectors

Step 3. Use the shortcut $\mathbf{v} = (1, \lambda)^T$ — but let us do one the long way first, to see it work.
For $\lambda_1 = -2$:   $(A + 2I)\mathbf{v} = \begin{pmatrix} 2 & 1 \\ -6 & -3 \end{pmatrix}\mathbf{v} = \mathbf{0}$
Row one says $2v_1 + v_2 = 0$, so $v_2 = -2v_1$. Take $v_1 = 1$.
Row two says $-6v_1 - 3v_2 = 0$ — the same equation. It must be: that is what $\det = 0$ bought us.
$$\lambda_1 = -2: \;\; \mathbf{v}_1 = \begin{pmatrix} 1 \\ -2 \end{pmatrix}$$
$$\lambda_2 = -3: \;\; \mathbf{v}_2 = \begin{pmatrix} 1 \\ -3 \end{pmatrix}$$
Both are $(1, \lambda)^T$, as advertised. From here on I will just write them down.

Problem 1 — General Solution

Step 4. Each eigenpair contributes $e^{\lambda t}\mathbf{v}$, and the general solution is their combination.
$$\mathbf{x}(t) = c_1 e^{-2t}\begin{pmatrix} 1 \\ -2 \end{pmatrix} + c_2 e^{-3t}\begin{pmatrix} 1 \\ -3 \end{pmatrix}$$
Look at the first component
$y = x_1 = c_1 e^{-2t} + c_2 e^{-3t}$. That is precisely what Chapter 2 would have given you. The system did not find a different answer — it found the same answer, with the velocity carried along underneath.

Problem 1 — Initial Conditions

Step 5. Put $t = 0$ and match $\mathbf{x}(0) = (1, 0)^T$.
$$c_1\begin{pmatrix} 1 \\ -2 \end{pmatrix} + c_2\begin{pmatrix} 1 \\ -3 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \;\;\Longrightarrow\;\; \begin{cases} c_1 + c_2 = 1 \\ -2c_1 - 3c_2 = 0 \end{cases}$$
From the first: $c_1 = 1 - c_2$.
Substitute: $-2(1 - c_2) - 3c_2 = 0 \;\Rightarrow\; -2 - c_2 = 0 \;\Rightarrow\; c_2 = -2$.
So $c_1 = 3$.
$$y(t) = 3e^{-2t} - 2e^{-3t}$$

Problem 1 — Check, and the Picture

$y(0) = 3 - 2 = 1$ ✓
$y'(t) = -6e^{-2t} + 6e^{-3t} = 6e^{-3t}(1 - e^{t})$, so $y'(0) = 0$ and $y' \lt 0$ after that ✓
Substituting into $y'' + 5y' + 6y$ gives zero ✓
t y no overshoot, no ringing
Stable node
Two negative real eigenvalues. Every trajectory walks into the origin without ever turning around. The $e^{-3t}$ piece dies first; the long-run behaviour belongs to $\lambda = -2$, the slower eigenvalue.

Problem 2 — A Repeated Eigenvalue

$$y'' + 4y' + 4y = 0, \qquad y(0) = 1, \quad y'(0) = 0$$
$$\mathbf{x}' = \begin{pmatrix} 0 & 1 \\ -4 & -4 \end{pmatrix}\mathbf{x}$$
$$\lambda^2 + 4\lambda + 4 = (\lambda+2)^2 = 0$$
Discriminant
$p^2 - 4q = 16 - 16 = 0$. One eigenvalue, $\lambda = -2$, repeated twice. We need two independent solutions and we have been handed one eigenvalue. This is the interesting case.

Problem 2 — Only One Eigenvector

The shortcut still gives an eigenvector:
$$\mathbf{v} = \begin{pmatrix} 1 \\ -2 \end{pmatrix}, \qquad (A + 2I) = \begin{pmatrix} 2 & 1 \\ -4 & -2 \end{pmatrix}$$
But look for a second one. $(A+2I)\mathbf{v} = \mathbf{0}$ means $2v_1 + v_2 = 0$ — a single line through the origin. Every solution is a multiple of $(1,-2)^T$.
The matrix is defective
Algebraic multiplicity 2, geometric multiplicity 1. We are one solution short, and no amount of staring at $(A+2I)\mathbf{v}=\mathbf{0}$ will produce it. Guessing a second $e^{-2t}\mathbf{w}$ fails too: it would have to be a multiple of the first.

Problem 2 — The Generalized Eigenvector

So we stop asking for zero, and ask for $\mathbf{v}$ instead:
$$(A - \lambda I)\,\mathbf{w} = \mathbf{v}$$
$$\begin{pmatrix} 2 & 1 \\ -4 & -2 \end{pmatrix} \begin{pmatrix} w_1 \\ w_2 \end{pmatrix} = \begin{pmatrix} 1 \\ -2 \end{pmatrix}$$
Row one: $2w_1 + w_2 = 1$. One equation, two unknowns — so we may choose.
Take $w_1 = 0$, giving $w_2 = 1$.
Row two: $-4(0) - 2(1) = -2$ ✓ — consistent, as it must be.
$$\mathbf{w} = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$$
A different choice is fine
Any $\mathbf{w}$ on that line works; the difference is a multiple of $\mathbf{v}$, which the $c_1$ term already covers.

Problem 2 — Where the $t$ Comes From

The second solution is not $e^{\lambda t}\mathbf{w}$. It is:
$$\mathbf{x}_2(t) = e^{\lambda t}\big(t\,\mathbf{v} + \mathbf{w}\big)$$
Substitute it and watch the pieces cancel:
$\mathbf{x}_2' = \lambda e^{\lambda t}(t\mathbf{v} + \mathbf{w}) + e^{\lambda t}\mathbf{v}$
$A\mathbf{x}_2 = e^{\lambda t}\big(tA\mathbf{v} + A\mathbf{w}\big) = e^{\lambda t}\big(t\lambda\mathbf{v} + \lambda\mathbf{w} + \mathbf{v}\big)$
The two agree — and they agree only because $A\mathbf{w} = \lambda\mathbf{w} + \mathbf{v}$.
So that is the answer to "why the extra $t$"
In Chapter 2 you were told to multiply by $t$ when roots repeat. Here you can see what the $t$ is: it is the trace of a missing eigenvector, and $\mathbf{w}$ is what stands in for it.

Problem 2 — Finish It

$$\mathbf{x}(t) = c_1 e^{-2t}\begin{pmatrix} 1 \\ -2 \end{pmatrix} + c_2 e^{-2t}\left[ t\begin{pmatrix} 1 \\ -2 \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} \right]$$
At $t = 0$ the bracket is just $\mathbf{w}$, so:
$$c_1\begin{pmatrix} 1 \\ -2 \end{pmatrix} + c_2\begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \;\Longrightarrow\; c_1 = 1, \;\; -2 + c_2 = 0, \;\; c_2 = 2$$
$$y(t) = (1 + 2t)\,e^{-2t}$$
$y(0) = 1$ ✓   and   $y'(t) = -4t\,e^{-2t}$, so $y'(0) = 0$ ✓
Chapter 2 would write $y = (A + Bt)e^{-2t}$ and get $A = 1$, $B = 2$. Same answer ✓

Problem 2 — The Picture

t y Problem 2 Problem 1, for comparison
No overshoot — check the derivative
$y' = -4t\,e^{-2t}$, which is negative for every $t \gt 0$. The $t$ does not make it rise. With this starting data the solution falls from 1 and never turns.
What the $t$ does instead: it slows the fall
At $t = 0.5$, Problem 1 is at $0.657$ while Problem 2 is still at $0.736$. At $t = 1$: $0.306$ against $0.406$. The repeated root is the exact borderline — the slowest decay you can have without the system starting to oscillate. In Chapter 2's language, these three problems are overdamped, critically damped and underdamped.

Problem 3 — A Complex Pair

$$y'' + 2y' + 5y = 0, \qquad y(0) = 1, \quad y'(0) = 0$$
$$\mathbf{x}' = \begin{pmatrix} 0 & 1 \\ -5 & -2 \end{pmatrix}\mathbf{x}$$
$$\lambda^2 + 2\lambda + 5 = 0$$
$p^2 - 4q = 4 - 20 = -16 \lt 0$ — complex pair.
$\lambda = \dfrac{-2 \pm \sqrt{-16}}{2} = -1 \pm 2i$
Read it before solving
Real part $-1$: decay at rate $e^{-t}$. Imaginary part $2$: oscillation at frequency 2. You already know the answer looks like a fading wobble — the algebra only fills in the amplitudes.

Problem 3 — The Complex Eigenvector

Take just one of the pair — $\lambda = -1 + 2i$. The conjugate gives nothing new.
$$\mathbf{v} = \begin{pmatrix} 1 \\ \lambda \end{pmatrix} = \begin{pmatrix} 1 \\ -1 + 2i \end{pmatrix}$$
So one (complex) solution of the system is:
$$\mathbf{z}(t) = e^{(-1+2i)t}\begin{pmatrix} 1 \\ -1+2i \end{pmatrix}$$
The fact that rescues us
$A$ has real entries. So if $\mathbf{z}$ solves $\mathbf{x}' = A\mathbf{x}$, then its real part and its imaginary part each solve it separately. Two real solutions, out of one complex one.

Problem 3 — Splitting With Euler

Expand, using $e^{(-1+2i)t} = e^{-t}(\cos 2t + i\sin 2t)$:
$$\mathbf{z} = e^{-t}(\cos 2t + i\sin 2t)\begin{pmatrix} 1 \\ -1+2i \end{pmatrix}$$
The second entry needs care — multiply it out:
$$(\cos 2t + i\sin 2t)(-1 + 2i) = \underbrace{(-\cos 2t - 2\sin 2t)}_{\text{real}} + i\underbrace{(2\cos 2t - \sin 2t)}_{\text{imaginary}}$$
Remember $i^2 = -1$: the $2i \cdot i\sin 2t$ term became $-2\sin 2t$ and moved to the real part.
$$\mathbf{x}_1 = e^{-t}\begin{pmatrix} \cos 2t \\ -\cos 2t - 2\sin 2t \end{pmatrix}$$
$$\mathbf{x}_2 = e^{-t}\begin{pmatrix} \sin 2t \\ 2\cos 2t - \sin 2t \end{pmatrix}$$

Problem 3 — Initial Conditions

$$\mathbf{x}(t) = c_1\mathbf{x}_1(t) + c_2\mathbf{x}_2(t)$$
At $t = 0$: $\;\cos 0 = 1$, $\sin 0 = 0$, $e^0 = 1$, so
$$c_1\begin{pmatrix} 1 \\ -1 \end{pmatrix} + c_2\begin{pmatrix} 0 \\ 2 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \;\Longrightarrow\; c_1 = 1, \;\; -1 + 2c_2 = 0, \;\; c_2 = \tfrac{1}{2}$$
$$y(t) = e^{-t}\left(\cos 2t + \tfrac{1}{2}\sin 2t\right)$$
$y(0) = 1 \cdot (1 + 0) = 1$ ✓
$y'(t) = -\tfrac{5}{2}e^{-t}\sin 2t$, so $y'(0) = 0$ ✓  (the cosine terms cancel exactly)

Problem 3 — The Picture

t envelope $e^{-t}$
Spiral sink
It crosses zero again and again — the oscillation — but each swing is smaller than the last, because the whole thing sits inside a decaying envelope.
The division of labour
The real part of $\lambda$ decides whether it settles. The imaginary part decides how much it wobbles on the way. Two numbers, the whole behaviour.

Three Problems, Side by Side

$\lambda = -2, -3$
$y = 3e^{-2t} - 2e^{-3t}$
Distinct real · stable node · overdamped
$\lambda = -2$ (twice)
$y = (1 + 2t)e^{-2t}$
Repeated · degenerate node · critically damped
$\lambda = -1 \pm 2i$
$y = e^{-t}(\cos 2t + \tfrac12 \sin 2t)$
Complex · spiral sink · underdamped
Same equation shape, same initial conditions, three different lives
Every one of them decays, because every eigenvalue has negative real part. And the first two never turn back at all — only the complex pair crosses zero. These are the three damping regimes from Chapter 2, now readable straight off the eigenvalues.

The Method, in Six Lines

1 Name the lower derivatives: $x_1 = y$, $x_2 = y'$.
2 Write $\mathbf{x}' = A\mathbf{x}$ with the companion matrix.
3 Solve $\det(A - \lambda I) = 0$ — your old characteristic equation.
4 Eigenvectors are $(1, \lambda)^T$. If a root repeats, solve $(A-\lambda I)\mathbf{w} = \mathbf{v}$ for the missing direction.
5 Build $\mathbf{x}$: $e^{\lambda t}\mathbf{v}$ for each root, $e^{\lambda t}(t\mathbf{v}+\mathbf{w})$ for a repeat, real and imaginary parts for a complex pair.
6 Fit the constants at $t = 0$, then read $y = x_1$.

Four Ways This Goes Wrong

Sign slip in the bottom row
$y'' + 5y' + 6y = 0$ gives $y'' = -6y - 5y'$. The entries are $-q$ and $-p$, both negative here. Moving the terms across is where marks disappear.
Using $e^{\lambda t}\mathbf{w}$ for the repeated case
The second solution is $e^{\lambda t}(t\mathbf{v} + \mathbf{w})$. Drop the $t\mathbf{v}$ and it simply is not a solution — substitute it and the $\mathbf{v}$ term has nothing to cancel against.
Using both complex conjugates
$\lambda$ and $\bar\lambda$ give the same two real solutions. Take one, split it into real and imaginary parts, and stop.
Forgetting that $y$ is only the first component
You solved for $\mathbf{x} = (y, y')^T$. The answer to the original question is $x_1$. The second component is a free bonus: the velocity.

Why This Was Worth the Trouble

It scales
A fourth-order equation becomes a $4\times4$ system by exactly the same recipe. Two coupled second-order equations become a $4\times4$ system too — and there is no scalar method for those at all.
It is what the computer wants
Hand $\mathbf{x}' = A\mathbf{x}$ and $\mathbf{x}(0)$ to any solver and it runs. That is why this conversion is the first thing done in every simulation you will ever write.
And it tells you the answer before you have one
Eigenvalues negative and real: it settles quietly. Negative with an imaginary part: it rings, then settles. Any eigenvalue with a positive real part: it runs away, and no choice of initial condition will save it. You can say all of that from $\det(A - \lambda I) = 0$, before solving anything.

What To Take Away

The conversion is bookkeeping
Name the lower derivatives. The first row writes itself; the last row is the original equation rearranged.
Nothing is lost
The companion matrix has the same characteristic equation. Eigenvalues are your old roots. The first component is your old answer.
The repeat is the only hard case
One eigenvector short, so you chase it with $(A-\lambda I)\mathbf{w} = \mathbf{v}$. That is where the $t$ in Chapter 2 came from.
Complex means rotation
Take one eigenvalue, expand with Euler, keep the real and imaginary parts. Real part decays, imaginary part spins.
Convert. Find the eigenvalues. Build. Fit. Read off $x_1$.
🔊 Voice
1×