01 / 21

Systems in
Matrix Form

Learn how to rewrite systems of differential equations as a single compact matrix equation \(\mathbf{x}' = A\mathbf{x}\), unlocking powerful techniques for analysis and solution.

Differential Equations

What Is a System of Differential Equations?

A system of differential equations involves two or more unknown functions and their derivatives, all linked together. For example, the rates of change of two quantities \(x_1\) and \(x_2\) might each depend on both quantities simultaneously.

Systems like these arise naturally when modeling coupled phenomena: interacting populations, electrical circuits with multiple loops, or chemical reactions with several species.

Why Write Systems in Matrix Form?

Compact Notation
Replace \(n\) equations with one: \(\mathbf{x}' = A\mathbf{x}\). Easier to read, write, and communicate.
Eigenvalue Methods
Matrix form unlocks eigenvalue and eigenvector techniques: the most powerful tools for solving linear systems.
Geometric Insight
Phase portraits and stability analysis rely on understanding the matrix \(A\) and its properties.

The Key Ingredients

State Vector \(\mathbf{x}\)
A column vector collecting all unknown functions: \(\mathbf{x} = \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix}\)
Coefficient Matrix \(A\)
An \(n \times n\) matrix of constants from the right-hand sides of each equation.
Derivative Vector \(\mathbf{x}'\)
The column vector of derivatives: \(\mathbf{x}' = \begin{pmatrix} x_1' \\ x_2' \\ \vdots \\ x_n' \end{pmatrix}\)

Together these produce the elegant equation \(\mathbf{x}' = A\mathbf{x}\), which encodes the entire system in one line.

The Matrix Equation: Formal Statement

\(x_1'\)
\(x_2'\)
\(x_3'\)
=
\(a_{11}\)
\(a_{12}\)
\(a_{13}\)
\(a_{21}\)
\(a_{22}\)
\(a_{23}\)
\(a_{31}\)
\(a_{32}\)
\(a_{33}\)
\(x_1\)
\(x_2\)
\(x_3\)
\(\mathbf{x}'\)
\(A\)
\(\mathbf{x}\)

Adding a Forcing Term

When external forces or inputs act on the system, we add a vector-valued function \(\mathbf{g}(t)\) to get the non-homogeneous form:

Homogeneous
\(\mathbf{x}' = A\mathbf{x}\)
No external input. All terms involve the unknowns.
Non-Homogeneous
\(\mathbf{x}' = A\mathbf{x} + \mathbf{g}(t)\)
External forcing terms present on the right side.

Scalar vs. Matrix Form

Scalar Form Matrix Form
Notation \(x_1' = \ldots,\; x_2' = \ldots\) \(\mathbf{x}' = A\mathbf{x}\)
Number of equations \(n\) separate equations 1 matrix equation
Coefficients stored Scattered across equations Organized in matrix \(A\)
Solution method Substitution / elimination Eigenvalues & eigenvectors
Scales to large \(n\) Unwieldy Elegant

How to Convert: Step by Step

1
Identify the unknowns. List all dependent variables: \(x_1, x_2, \ldots, x_n\).
2
Write the derivatives on the left. Isolate \(x_i'\) on the left-hand side of each equation.
3
Read off the coefficients. For equation \(i\), the coefficient of \(x_j\) on the right becomes entry \(a_{ij}\) in row \(i\), column \(j\).
4
Assemble the matrix \(A\). Fill in all \(n^2\) entries. Missing variables get coefficient \(0\).
5
Write the equation. Combine into \(\mathbf{x}' = A\mathbf{x}\) (add \(\mathbf{g}(t)\) if non-homogeneous).

Example 1: A \(2 \times 2\) System

1
State vector: \(\mathbf{x} = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix}\)
2
Read coefficients: Row 1: \(4\) and \(-3\). Row 2: \(2\) and \(1\).
3
Matrix form: \(\displaystyle \begin{pmatrix} x_1' \\ x_2' \end{pmatrix} = \begin{pmatrix} 4 & -3 \\ 2 & 1 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \end{pmatrix}\)

Example 2: A \(3 \times 3\) System

Key observation: Missing variables contribute a coefficient of \(0\). Equation 1 has no \(x_2\) term, and equation 3 has no \(x_1\) or \(x_3\) term.

Example 3: Non-Homogeneous System

1
Separate homogeneous and forcing parts. The terms involving \(x_1, x_2\) form \(A\mathbf{x}\); the rest form \(\mathbf{g}(t)\).
2
Coefficient matrix: \(A = \begin{pmatrix} 2 & -1 \\ 1 & 3 \end{pmatrix}\)
3
Forcing vector: \(\mathbf{g}(t) = \begin{pmatrix} e^t \\ -\sin t \end{pmatrix}\)

Higher-Order to First-Order Systems

A single higher-order ODE can be rewritten as a system of first-order ODEs by introducing new variables. This lets us apply matrix methods to equations like \(y'' + 3y' - 2y = 0\).

Notice row 1 is always \((0, 1, 0, \ldots)\) because \(x_1' = x_2\) by definition. The coefficients from the original ODE appear in the last row.

The Conversion Pattern

SCALAR SYSTEM
\(x_1' = \ldots, x_2' = \ldots\)
Identify coefficients BUILD MATRIX A
Row \(i\), Col \(j\) = coeff of \(x_j\) in eq. \(i\)
Assemble vectors
\(\mathbf{x}' = A\mathbf{x}\)
HIGHER-ORDER ODE
\(y'' + ay' + by = 0\)
Let \(x_1=y, x_2=y'\)
FIRST-ORDER SYSTEM
\(x_1' = x_2, x_2' = \ldots\)

Both pathways converge at the same result: the compact matrix equation \(\mathbf{x}' = A\mathbf{x}\).

The Companion Matrix

When converting an \(n\)-th order ODE to a first-order system, the resulting matrix has a special structure called a companion matrix.

The last row holds the negatives of the original ODE coefficients. All other rows have a single \(1\) on the superdiagonal and \(0\)s everywhere else.

Common Mistakes

✕ Wrong Row/Column
Placing the coefficient of \(x_j\) in row \(j\) instead of the row corresponding to the equation it came from.
✕ Forgetting Zeros
If \(x_k\) does not appear in equation \(i\), you must enter \(a_{ik} = 0\), not leave it blank or skip it.
✕ Sign Errors
Writing \(+3\) instead of \(-3\) when the original equation has \(-3x_2\). The sign is part of the coefficient.
✕ Mixing Up \(\mathbf{g}(t)\)
Putting forcing terms like \(e^t\) into the matrix \(A\) instead of the separate vector \(\mathbf{g}(t)\).
✕ Wrong Variable Substitution
When converting higher-order ODEs, defining \(x_2 = y''\) instead of \(x_2 = y'\) breaks the chain of substitution.

Summary of Matrix Forms

Scenario Matrix Form Key Feature
Homogeneous system \(\mathbf{x}' = A\mathbf{x}\) No forcing term
Non-homogeneous system \(\mathbf{x}' = A\mathbf{x} + \mathbf{g}(t)\) External input \(\mathbf{g}(t)\)
2nd order ODE \(\begin{pmatrix}0&1\\-b&-a\end{pmatrix}\) Companion matrix
\(n\)-th order ODE \(n \times n\) companion matrix Last row: negated coefficients
Initial value problem \(\mathbf{x}' = A\mathbf{x},\;\mathbf{x}(0) = \mathbf{x}_0\) Unique solution guaranteed

Question 1 of 5

Write the system \(x_1' = 5x_1 + 2x_2\), \(x_2' = -x_1 + 3x_2\) in matrix form \(\mathbf{x}' = A\mathbf{x}\). What is \(A\)?

Question 2 of 5

Given the system \(x_1' = 3x_2\), \(x_2' = -7x_1\), what is entry \(a_{12}\) (row 1, column 2) of the coefficient matrix?

Question 3 of 5

Convert the ODE \(y'' - 6y' + 8y = 0\) to a first-order system. Using \(x_1 = y\), \(x_2 = y'\), what is the coefficient matrix?

Question 4 of 5

For the system \(x_1' = x_1 - 2x_2 + \cos t\), \(x_2' = 4x_1 + t^2\), what is the forcing vector \(\mathbf{g}(t)\)?

Question 5 of 5

The companion matrix for the third-order ODE \(y''' + 2y'' - 5y' + 3y = 0\) has its original ODE coefficients in which location?