Diff. EquationsSystems of Differential Equations

Systems in Matrix Form

Write x′ = Ax, and rewrite a second-order equation as a system.

Not started Jump to practice

Two tanks that exchange brine, predators and prey, two masses joined by springs: many models involve several unknown functions that change together. Writing them as one vector equation lets the tools of linear algebra, starting with the matrix equation $A\mathbf{x} = \mathbf{b}$, do the work.

Key idea

A linear system $x_1' = a_{11}x_1 + a_{12}x_2$, $x_2' = a_{21}x_1 + a_{22}x_2$ is $\mathbf{x}' = A\mathbf{x}$ with $A = \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}$. Any $n$th-order equation becomes a first-order system: for $y'' + by' + cy = 0$, set $x_1 = y$, $x_2 = y'$ to get $$\mathbf{x}' = \begin{bmatrix} 0 & 1 \\ -c & -b \end{bmatrix}\mathbf{x}.$$

Why it works

With $x_1 = y$ and $x_2 = y'$, the first equation $x_1' = x_2$ is just the definition of $x_2$, and the second comes from solving the original equation for the highest derivative: $x_2' = y'' = -cy - by'$ $= -cx_1 - bx_2$. The state $(y, y')$, position and velocity, is exactly what a second-order equation needs to know at each instant to decide what happens next. That is why every higher-order equation fits this first-order mold, and why numerical solvers and the phase plane work with systems.

Worked example: Reading a matrix

Write $x' = 3y - x$, $y' = 2x$ as $\mathbf{x}' = A\mathbf{x}$.
  1. Keep the columns in the order $x$, $y$. Row 1 (for $x'$): coefficient of $x$ is $-1$, of $y$ is 3.
  2. Row 2 (for $y'$): coefficient of $x$ is 2, of $y$ is 0.

Answer: $A = \begin{bmatrix} -1 & 3 \\ 2 & 0 \end{bmatrix}$

Worked example: A second-order equation

Write $2y'' + 6y' + 10y = 0$ as a system.
  1. Divide by 2: $y'' = -5y - 3y'$.
  2. With $x_1 = y$, $x_2 = y'$: $x_1' = x_2$ and $x_2' = -5x_1 - 3x_2$.

Answer: $A = \begin{bmatrix} 0 & 1 \\ -5 & -3 \end{bmatrix}$

Worked example: Third order

Write $y''' - 2y'' + y' - 4y = 0$ as a system.
  1. Let $x_1 = y$, $x_2 = y'$, $x_3 = y''$, so $x_1' = x_2$ and $x_2' = x_3$.
  2. $y''' = 4y - y' + 2y''$, so $x_3' = 4x_1 - x_2 + 2x_3$.

Answer: $A = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 4 & -1 & 2 \end{bmatrix}$

A vector solution can be checked like any other: if $\mathbf{x}(t) = e^{2t}\begin{bmatrix} 1 \\ k \end{bmatrix}$, then $\mathbf{x}' = 2\mathbf{x}$, so $\mathbf{x}' = A\mathbf{x}$ forces $A\begin{bmatrix} 1 \\ k \end{bmatrix} = 2\begin{bmatrix} 1 \\ k \end{bmatrix}$. That is an eigenvector equation, the key to solving systems.

Common mistake

Forgetting to divide by the leading coefficient before reading off the last row, or putting the coefficients in the wrong columns when a term is written first or missing. Every row lists the coefficient of $x_1$, then $x_2$ (then $x_3$); a missing term is a 0.
The system for $2y'' + 6y' + 10y = 0$ in the $(x_1, x_2)$ plane, that is, position against velocity. The trajectory spirals into the origin: the spring settles. The strip below shows $x_1 = y$ and $x_2 = y'$ against time.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Paul's Online Math Notes, Differential Equations: Systems of Differential Equations
  • MIT OpenCourseWare 18.03SC Differential Equations (Fall 2011), Unit IV: First-order Systems
@teddyrookbook GitHub