Session 23 · Unit 2

Differential Equations and exp(At)


How to solve a system of first-order, constant-coefficient linear differential equations du/dt = Au, and why it turns directly into linear algebra. The solutions are exponentials e^(lambda t) x built from the eigenvalues and eigenvectors of A, completely parallel to the powers of a matrix from last lecture. Along the way: stability from the real parts of the eigenvalues, a trace-and-determinant test for 2 by 2 matrices, and the matrix exponential e^(At) defined by its power series.

From powers of A to exponentials of A

“Lift-off on differential equations.” This lecture solves systems of first-order, constant-coefficient linear equations — and done right, “it turns directly into linear algebra.” The key idea: the solutions to constant-coefficient linear equations are exponentials. Look for an exponential, and all you have to find is what goes up in the exponent and what multiplies it — and that’s the linear algebra.

The result is completely parallel to the last lecture, which computed high powers like A100A^{100} for the difference equation uk+1=Auk\mathbf{u}_{k+1} = A\mathbf{u}_k. Now it’s not powers but exponentials, the natural thing for a differential equation:

dudt=Au\frac{d\mathbf{u}}{dt} = A\mathbf{u}

An example, mechanics first

Take two coupled equations, matrix and initial condition:

dudt=[1212]u,u(0)=[10]\frac{d\mathbf{u}}{dt} = \begin{bmatrix} -1 & 2 \\ 1 & -2 \end{bmatrix} \mathbf{u}, \qquad \mathbf{u}(0) = \begin{bmatrix} 1 \\ 0 \end{bmatrix}

At the start everything is in u1u_1. But du2/dtdu_2/dt will be positive because of that u1u_1 term, so flow moves into the u2u_2 component and out of u1u_1. We follow that movement by doing the first job for any matrix: before anything else, find the eigenvalues and eigenvectors.

Can you spot the eigenvalues? The matrix is singular — the second column is 2-2 times the first, the determinant is zero — so λ1=0\lambda_1 = 0 is an eigenvalue immediately. The trace is 1+(2)=3-1 + (-2) = -3, and the trace equals the sum of the eigenvalues, so the other one had better be λ2=3\lambda_2 = -3. As a check, the characteristic polynomial is

det(AλI)=λ2+3λ=λ(λ+3)\det(A - \lambda I) = \lambda^2 + 3\lambda = \lambda(\lambda + 3)

confirming λ1=0\lambda_1 = 0, λ2=3\lambda_2 = -3.

Already the eigenvalues are telling us the most important information about the answer. The negative eigenvalue will contribute an e3te^{-3t}, which becomes very, very small as time goes on — that part disappears. The zero eigenvalue contributes e0t=1e^{0t} = 1, a constant. So the solution will have two parts, and as tt \to \infty the second part vanishes and the first part is a steady state — it won’t move. A zero eigenvalue means a steady state.

Now the eigenvectors. For λ1=0\lambda_1 = 0, the eigenvector is the guy in the null space of AA: give the free variable the value 11 and you need a 22 on top, so x1=(2,1)\mathbf{x}_1 = (2, 1). For λ2=3\lambda_2 = -3, add 33 to the diagonal:

A+3I=[2211]A + 3I = \begin{bmatrix} 2 & 2 \\ 1 & 1 \end{bmatrix}

singular, as it should be, with x2=(1,1)\mathbf{x}_2 = (1, -1) in its null space (or (1,1)(-1, 1) — either is perfectly good).

Building the solution from pure exponentials

The general solution is a combination of two pure exponential solutions, one for each eigenvalue:

u(t)=c1eλ1tx1+c2eλ2tx2\mathbf{u}(t) = c_1 e^{\lambda_1 t}\mathbf{x}_1 + c_2 e^{\lambda_2 t}\mathbf{x}_2

Check that each piece really solves the equation. Plug eλ1tx1e^{\lambda_1 t}\mathbf{x}_1 into du/dt=Aud\mathbf{u}/dt = A\mathbf{u}: the time derivative brings down a λ1\lambda_1, the right side is Aeλ1tx1A e^{\lambda_1 t}\mathbf{x}_1, the exponential appears on both sides, and what remains is Ax1=λ1x1A\mathbf{x}_1 = \lambda_1 \mathbf{x}_1 — check.

For our matrix, eλ1t=e0t=1e^{\lambda_1 t} = e^{0t} = 1, so the solution is

u(t)=c1[21]+c2e3t[11]\mathbf{u}(t) = c_1 \begin{bmatrix} 2 \\ 1 \end{bmatrix} + c_2\, e^{-3t} \begin{bmatrix} 1 \\ -1 \end{bmatrix}

Everything so far was immediate from the eigenvalues and eigenvectors. The constants come from the initial condition. At t=0t = 0:

c1[21]+c2[11]=[10]c_1 \begin{bmatrix} 2 \\ 1 \end{bmatrix} + c_2 \begin{bmatrix} 1 \\ -1 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \end{bmatrix}

Spot the answer: if c1c_1 and c2c_2 were both 11, the sum would be (3,0)(3, 0) — so take one third of that. c1=c2=13c_1 = c_2 = \frac{1}{3}, and

u(t)=13[21]+13e3t[11]\mathbf{u}(t) = \frac{1}{3}\begin{bmatrix} 2 \\ 1 \end{bmatrix} + \frac{1}{3}\, e^{-3t} \begin{bmatrix} 1 \\ -1 \end{bmatrix}

You can see what’s actually happening with this flow. It started at (1,0)(1, 0); as time goes on, some fraction moves from the first component into the second; and in the limit the e3te^{-3t} part disappears, leaving the steady state

u()=[2/31/3]\mathbf{u}(\infty) = \begin{bmatrix} 2/3 \\ 1/3 \end{bmatrix}

That’s total insight into the behavior of the solution — what the differential equation does — read off from two eigenvalues and two eigenvectors.

One more observation about the step that found c1,c2c_1, c_2: as a matrix equation it is Sc=u(0)S\mathbf{c} = \mathbf{u}(0), where SS is the eigenvector matrix — the eigenvectors sit in its columns. You figure out how much of each pure exponential is present in u(0)\mathbf{u}(0), and then off they go, each on its own. “By getting it right at the start, it stays right forever.”

Stability: it’s the real part that matters

We won’t always have a steady state. Sometimes the solution approaches zero; sometimes it blows up. The eigenvalues tell us which.

Stabilityu(t)0\mathbf{u}(t) \to 0 for every initial condition — needs every eλte^{\lambda t} going to zero, which asks for negative eigenvalues. But eigenvalues can be complex. Suppose λ=3+6i\lambda = -3 + 6i. How big is e(3+6i)te^{(-3+6i)t}? The factor e6it=cos6t+isin6te^{6it} = \cos 6t + i\sin 6t has absolute value one — cos2+sin2=1\cos^2 + \sin^2 = 1 — it just runs around the unit circle. The magnitude is e3te^{-3t}: it’s the real part of λ\lambda that matters. The imaginary part only oscillates the solution between components.

So the three behaviors:

  • Stability: u(t)0\mathbf{u}(t) \to 0 when every eigenvalue has Reλ\operatorname{Re}\lambda negative.
  • Steady state: one eigenvalue λ1=0\lambda_1 = 0 and all other eigenvalues have negative real part — exactly our example.
  • Blow-up: if any eigenvalue has positive real part. Reverse all the signs of our matrix AA and every eigenvalue changes sign: the zero stays at zero, but the 3-3 becomes +3+3, an e3te^{3t} appears, and the solution takes off.

Uncoupling the system: u = Sv

The matrix AA couples u1u_1 and u2u_2; the whole point of eigenvectors is to uncouple — to diagonalize. Set u=Sv\mathbf{u} = S\mathbf{v}, where SS is the eigenvector matrix (a constant). Then

Sdvdt=ASvdvdt=S1ASv=ΛvS\frac{d\mathbf{v}}{dt} = AS\mathbf{v} \qquad\Longrightarrow\qquad \frac{d\mathbf{v}}{dt} = S^{-1}AS\,\mathbf{v} = \Lambda \mathbf{v}

In the eigenvector basis the system is diagonal — no coupling anymore. Each equation stands alone: dv1/dt=λ1v1dv_1/dt = \lambda_1 v_1, and so on for all nn of them. Each is trivially solved, v(t)=eΛtv(0)\mathbf{v}(t) = e^{\Lambda t}\mathbf{v}(0), and transforming back,

u(t)=SeΛtS1u(0)\mathbf{u}(t) = S e^{\Lambda t} S^{-1}\, \mathbf{u}(0)

That matrix SeΛtS1S e^{\Lambda t} S^{-1} is the exponential we’re after: it is eAte^{At}, and u(t)=eAtu(0)\mathbf{u}(t) = e^{At}\mathbf{u}(0) is the answer. But what does it mean to raise ee to a matrix?

What e^At means

Strang can’t resist the side comment: there are two beautiful Taylor series in this world. The exponential series, and the geometric series 1+x+x2+x3+=11x1 + x + x^2 + x^3 + \cdots = \frac{1}{1-x} — the nicest power series of all, with no factorials. The matrix version gives

(IAt)1=I+At+(At)2+(At)3+(I - At)^{-1} = I + At + (At)^2 + (At)^3 + \cdots

a reasonable way to approximate an inverse when tt is small: (IAt)1I+At(I - At)^{-1} \approx I + At. But without the factorials this series can fail — if AtAt has an eigenvalue larger than one in magnitude, squaring and cubing blow it up. It converges only when all eigenvalues of AtAt are below one; the exponential series is safe always.

Now connect the definition to SS and Λ\Lambda. Use the fundamental formula of this whole chapter, A=SΛS1A = S\Lambda S^{-1}, in every term. Squaring makes the inner S1SS^{-1}S cancel: A2=SΛ2S1A^2 = S\Lambda^2 S^{-1}, then A3=SΛ3S1A^3 = S\Lambda^3 S^{-1}, and so on. Write the identity as SS1SS^{-1} too, and pull SS out on the left and S1S^{-1} out on the right of the whole series:

eAt=S(I+Λt+(Λt)22+)S1e^{At} = S\left(I + \Lambda t + \frac{(\Lambda t)^2}{2} + \cdots\right)S^{-1}

And the exponential of the diagonal matrix Λ\Lambda is completely decoupled — diagonal, as the whole point demands:

eΛt=[eλ1teλnt]e^{\Lambda t} = \begin{bmatrix} e^{\lambda_1 t} & & \\ & \ddots & \\ & & e^{\lambda_n t} \end{bmatrix}

just ordinary scalar exponentials down the diagonal, zeros elsewhere. From this formula you can see the stability statement again: SS and S1S^{-1} aren’t moving, so eAt0e^{At} \to 0 exactly when every eλit0e^{\lambda_i t} \to 0 — every eigenvalue with negative real part.

Second order becomes first order

One final example: a single second-order equation,

y+by+ky=0y'' + by' + ky = 0

How do we make one second-order equation into a 2×22 \times 2 first-order system? Just the way we did for Fibonacci: let the vector unknown be u=(y,y)\mathbf{u} = (y', y) and add the trivial extra equation y=yy' = y'. Then

u=[yy]=[bk10][yy]\mathbf{u}' = \begin{bmatrix} y'' \\ y' \end{bmatrix} = \begin{bmatrix} -b & -k \\ 1 & 0 \end{bmatrix} \begin{bmatrix} y' \\ y \end{bmatrix}

The first row is the differential equation (y=bykyy'' = -by' - ky); the second row is the trivial one. In the general case — a fifth-order equation becoming a 5×55 \times 5 first-order system — the coefficients of the equation go across the top row, and four trivial equations put ones below the diagonal. The eigenvalues of this matrix come out naturally connected to the differential equation.

That’s differential equations: a parallel lecture to powers of a matrix. We can now do exponentials.

Problems

Work these before revealing the solutions — the method is exactly the one from the lecture.

Problem 23.1 Solve du/dt = Au

Solve

dudt=[2112]u,u(0)=[31]\frac{d\mathbf{u}}{dt} = \begin{bmatrix} -2 & 1 \\ 1 & -2 \end{bmatrix}\mathbf{u}, \qquad \mathbf{u}(0) = \begin{bmatrix} 3 \\ 1 \end{bmatrix}

and describe the behavior as tt \to \infty.

Show solution

Eigenvalues: trace =4= -4, determinant =41=3= 4 - 1 = 3, so λ2+4λ+3=(λ+1)(λ+3)=0\lambda^2 + 4\lambda + 3 = (\lambda + 1)(\lambda + 3) = 0: λ1=1\lambda_1 = -1, λ2=3\lambda_2 = -3.

Eigenvectors: for λ1=1\lambda_1 = -1, A+I=[1111]A + I = \begin{bmatrix} -1 & 1 \\ 1 & -1 \end{bmatrix} gives x1=(1,1)\mathbf{x}_1 = (1, 1). For λ2=3\lambda_2 = -3, A+3I=[1111]A + 3I = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix} gives x2=(1,1)\mathbf{x}_2 = (1, -1).

Constants: c1(1,1)+c2(1,1)=(3,1)c_1(1,1) + c_2(1,-1) = (3,1) means c1+c2=3c_1 + c_2 = 3 and c1c2=1c_1 - c_2 = 1, so c1=2c_1 = 2, c2=1c_2 = 1.

u(t)=2et[11]+e3t[11]\mathbf{u}(t) = 2e^{-t}\begin{bmatrix} 1 \\ 1 \end{bmatrix} + e^{-3t}\begin{bmatrix} 1 \\ -1 \end{bmatrix}

Both eigenvalues are negative, so the system is stable: u(t)0\mathbf{u}(t) \to \mathbf{0}. The e3te^{-3t} part dies faster, so for large tt the solution approaches zero along the direction (1,1)(1,1).

Problem 23.2 Trace–determinant test

Without computing any eigenvalues, decide whether each system du/dt=Aud\mathbf{u}/dt = A\mathbf{u} is stable:

A1=[1321],A2=[5211]A_1 = \begin{bmatrix} -1 & 3 \\ -2 & -1 \end{bmatrix}, \qquad A_2 = \begin{bmatrix} -5 & 2 \\ 1 & 1 \end{bmatrix}

Then verify your verdict on A1A_1 by finding its eigenvalues.

Show solution

A1A_1: trace =2= -2 (negative ✓), determinant =(1)(1)(3)(2)=1+6=7= (-1)(-1) - (3)(-2) = 1 + 6 = 7 (positive ✓). Stable.

A2A_2: trace =4= -4 (negative), but determinant =(5)(1)(2)(1)=7= (-5)(1) - (2)(1) = -7 (negative ✗). Not stable — a negative determinant means the eigenvalues are real with opposite signs, so one is positive and the solution blows up.

Check on A1A_1: λ2+2λ+7=0\lambda^2 + 2\lambda + 7 = 0 gives λ=1±i6\lambda = -1 \pm i\sqrt{6}. Complex eigenvalues — but the real part is 1-1, negative, so eλt=et0|e^{\lambda t}| = e^{-t} \to 0. Stable, as the test predicted; the imaginary part ±6i\pm\sqrt{6}\,i only makes the solution oscillate on the way to zero.

Problem 23.3 Computing a matrix exponential

Find eAte^{At} for

A=[1101]A = \begin{bmatrix} 1 & 1 \\ 0 & -1 \end{bmatrix}

using eAt=SeΛtS1e^{At} = S e^{\Lambda t} S^{-1}, and check your answer at t=0t = 0.

Show solution

AA is triangular, so the eigenvalues are on the diagonal: λ1=1\lambda_1 = 1, λ2=1\lambda_2 = -1.

Eigenvectors: for λ1=1\lambda_1 = 1, AI=[0102]A - I = \begin{bmatrix} 0 & 1 \\ 0 & -2 \end{bmatrix} gives x1=(1,0)\mathbf{x}_1 = (1, 0). For λ2=1\lambda_2 = -1, A+I=[2100]A + I = \begin{bmatrix} 2 & 1 \\ 0 & 0 \end{bmatrix} gives x2=(1,2)\mathbf{x}_2 = (1, -2).

S=[1102],S1=[112012]S = \begin{bmatrix} 1 & 1 \\ 0 & -2 \end{bmatrix}, \qquad S^{-1} = \begin{bmatrix} 1 & \tfrac{1}{2} \\ 0 & -\tfrac{1}{2} \end{bmatrix}

Then

eAt=[1102][et00et][112012]=[et12(etet)0et]e^{At} = \begin{bmatrix} 1 & 1 \\ 0 & -2 \end{bmatrix} \begin{bmatrix} e^{t} & 0 \\ 0 & e^{-t} \end{bmatrix} \begin{bmatrix} 1 & \tfrac{1}{2} \\ 0 & -\tfrac{1}{2} \end{bmatrix} = \begin{bmatrix} e^{t} & \tfrac{1}{2}(e^{t} - e^{-t}) \\ 0 & e^{-t} \end{bmatrix}

Check at t=0t = 0: e0=1e^{0} = 1 and 12(11)=0\tfrac{1}{2}(1 - 1) = 0, so eA0=Ie^{A\cdot 0} = I — exactly as the series I+At+I + At + \cdots requires.

Problem 23.4 Second order to first order

Convert the second-order equation

y+4y+3y=0y'' + 4y' + 3y = 0

into a 2×22 \times 2 first-order system u=Au\mathbf{u}' = A\mathbf{u} with u=(y,y)\mathbf{u} = (y', y). Find the eigenvalues of AA and write the general solution y(t)y(t). Is the equation stable?

Show solution

The first row of AA comes from the equation, y=4y3yy'' = -4y' - 3y; the second row is the trivial equation y=yy' = y':

A=[4310]A = \begin{bmatrix} -4 & -3 \\ 1 & 0 \end{bmatrix}

Eigenvalues: det(AλI)=λ2+4λ+3=(λ+1)(λ+3)=0\det(A - \lambda I) = \lambda^2 + 4\lambda + 3 = (\lambda + 1)(\lambda + 3) = 0, so λ=1,3\lambda = -1, -3 — the characteristic polynomial of the matrix is exactly the characteristic polynomial of the original differential equation.

General solution: each eigenvalue contributes a pure exponential, so

y(t)=c1et+c2e3ty(t) = c_1 e^{-t} + c_2 e^{-3t}

Both eigenvalues are negative (equivalently: trace 4-4 negative, determinant 33 positive), so the equation is stable — every solution decays to zero.