DIFFERENTIAL EQUATIONS • SYSTEMS OF DIFFERENTIAL EQUATIONS

Systems in Matrix Form — Writing Systems in Matrix Form

Learn to compress multiple linked differential equations into a single, elegant matrix equation.

Historical Context & Motivation

Scientists and mathematicians have long encountered situations where several quantities change simultaneously and depend on one another. Think of a predator-prey ecosystem: the wolf population affects the deer population, and the deer population affects the wolves right back. Each species' rate of change is described by its own differential equation, but these equations are tangled together. Writing them out one by one becomes messy and hard to manage, especially when you have three, four, or even dozens of interacting quantities.

The idea of organizing numbers into rectangular arrays — matrices — developed over centuries. By the mid-1800s, mathematicians realized matrices could do much more than store data; they could represent entire systems of equations in compact form. This breakthrough transformed how we solve coupled differential equations, turning pages of algebra into a single, clean expression.

1750s
Early Coupled Systems
Leonhard Euler and others studied problems in celestial mechanics where the motions of multiple planets were governed by linked differential equations. These were solved case by case with no unifying notation.
1858
Cayley Formalizes Matrices
Arthur Cayley published A Memoir on the Theory of Matrices, establishing rules for matrix multiplication and addition — the algebraic backbone of our modern approach.
1880s
Eigenvalue Theory Develops
Mathematicians linked eigenvalues of a coefficient matrix to the behavior of solutions, providing a systematic way to solve systems of linear differential equations.
1950s–60s
State-Space Methods
Engineers adopted matrix notation for control systems and aerospace design, making the matrix form of differential equations a standard tool in applied science.

The central question this lesson answers is straightforward: given a system of differential equations where multiple unknowns depend on each other, how do we rewrite it as a single matrix equation? Mastering this translation step is the gateway to every technique you will learn for solving systems of differential equations.

Core Principles & Definitions

Before you can write a system in matrix form, you need a few foundational ideas. A system of differential equations is a collection of equations in which two or more unknown functions (like x(t) and y(t)) and their derivatives appear together. When every equation is linear — meaning no unknown is squared, cubed, or multiplied by another unknown — the system can be expressed using matrices.

1

State Vector x(t)

A column vector that collects all unknown functions into one object. For two unknowns, x(t) = [x₁(t), x₂(t)]ᵀ. This is the thing you are solving for.
2

Coefficient Matrix A

A square matrix whose entries are the coefficients from the original system. Each row corresponds to one equation, and each column corresponds to one unknown function.
3

Derivative Vector x′(t)

A column vector of the derivatives: x′(t) = [x₁′(t), x₂′(t)]ᵀ. It represents how every unknown is changing at each moment in time.
4

Matrix Equation x′ = Ax

The compact form that replaces the entire system. Multiplying A by x produces the right-hand sides of all the original equations simultaneously.
KEY TAKEAWAY
Think of the matrix form like a zip file for equations. Instead of writing out each equation separately — with all its terms and plus signs — you compress everything into one compact expression: x′ = Ax. The coefficient matrix A is the instruction set, and the state vector x is the data. When you 'unzip' by performing the matrix multiplication, you get back every original equation.

Visual Explanation — From Equations to Matrix

The diagram below shows the translation process for a 2×2 system. On the left you see two separate differential equations. In the center, the coefficients are extracted and placed into the matrix A, while the unknowns are stacked into the vector x. On the right, the compact matrix equation emerges.

The diagram traces the journey from two separate equations (left, purple box) through the extraction of the coefficient matrix A and the state vector x (center, cyan box) to the final compact matrix equation x′ = Ax (right, green box).

Notice how the first row of A (the numbers 3 and 2) comes directly from the right-hand side of the first equation, and the second row (−1 and 4) comes from the second equation. The order of the unknowns in the state vector x must match the order of the columns in A. If you multiply the matrix A by the vector x by hand, you recover exactly the two original equations — nothing is lost in the translation.

Mathematical Framework

Let's formalize the translation. Suppose you have n unknown functions x₁(t), x₂(t), …, xₙ(t), each satisfying a first-order linear differential equation. The general form of such a system is shown below.

GENERAL LINEAR SYSTEM (SCALAR FORM)
x₁′ = a₁₁ x₁ + a₁₂ x₂ + ⋯ + a₁ₙ xₙ x₂′ = a₂₁ x₁ + a₂₂ x₂ + ⋯ + a₂ₙ xₙ ⋮ xₙ′ = aₙ₁ x₁ + aₙ₂ x₂ + ⋯ + aₙₙ xₙ
Each aᵢⱼ is a constant coefficient. The subscript i identifies the equation (row) and j identifies which unknown it multiplies (column).
MATRIX FORM
x′(t) = A · x(t)
Here x(t) is the n × 1 state vector [x₁, x₂, …, xₙ]ᵀ, x′(t) is the derivative vector [x₁′, x₂′, …, xₙ′]ᵀ, and A is the n × n coefficient matrix whose (i, j) entry is aᵢⱼ.
NON-HOMOGENEOUS FORM
x′(t) = A · x(t) + g(t)
When external forcing functions are present, they are collected into a vector g(t) = [g₁(t), g₂(t), …, gₙ(t)]ᵀ. If every gᵢ(t) = 0, the system is called homogeneous.

The key skill is reading each equation, identifying which coefficient belongs to which unknown, and slotting it into the correct row and column of A. When there is no term for a particular unknown in a given equation, the corresponding matrix entry is simply 0.

⚠️ Watch Your Signs!
A very common mistake is forgetting the negative sign when transferring coefficients. If an equation says x₂′ = −5x₁ + x₂, then a₂₁ = −5, not 5. Always carry the sign with the coefficient into the matrix.

Step-by-Step Translation Process

Here is a reliable four-step recipe you can follow every time you need to convert a system of first-order linear differential equations into matrix form.

  1. Step 1 — List the unknowns. Identify every unknown function in the system and assign them a consistent order: x₁, x₂, …, xₙ. This order defines the columns of A and the entries of x.
  2. Step 2 — Isolate each derivative. Rewrite each equation so that the derivative stands alone on the left side, with only unknown-function terms (and possibly forcing terms) on the right.
  3. Step 3 — Read off the coefficients. For each equation (row i), read the coefficient of each unknown xⱼ. If xⱼ does not appear, write 0.
  4. Step 4 — Assemble the matrix equation. Build x′, A, x, and (if needed) g(t), then write x′ = Ax or x′ = Ax + g(t).
Follow these four steps in order every time. The dashed verification step at the bottom is optional but strongly recommended — multiply A × x and check that each row reproduces the corresponding original equation.

The verification step is worth the extra 30 seconds. If you perform the matrix-vector multiplication Ax and each row matches the right-hand side of the original equation, you know your matrix is correct. If even one entry disagrees, recheck that row and column.

Worked Example

Let's work through a complete 3 × 3 system to see every step in action.

Convert a 3 × 3 System to Matrix Form
1
Step 1 — State the SystemWe are given the following system of first-order linear differential equations: x₁′ = 2x₁ − x₂ + 3x₃ x₂′ = x₁ − x₃ x₃′ = −4x₁ + 2x₂ Our goal is to express this system in the form x′ = Ax.
2
Step 2 — List the Unknowns in OrderThe three unknown functions are x₁(t), x₂(t), and x₃(t). We keep them in this natural order.
State vector: x = [x₁, x₂, x₃]ᵀ
3
Step 3 — Verify Derivatives Are IsolatedEach equation already has the derivative alone on the left. The right-hand sides contain only first-power terms in the unknowns with constant coefficients. No rearranging needed.
4
Step 4 — Read Off Coefficients Row by RowEquation 1 (x₁′): coefficient of x₁ is 2, coefficient of x₂ is −1, coefficient of x₃ is 3. So row 1 of A is [2, −1, 3]. Equation 2 (x₂′): coefficient of x₁ is 1, x₂ does not appear so its coefficient is 0, coefficient of x₃ is −1. Row 2 is [1, 0, −1]. Equation 3 (x₃′): coefficient of x₁ is −4, coefficient of x₂ is 2, x₃ does not appear so its coefficient is 0. Row 3 is [−4, 2, 0].
5
Step 5 — Assemble the Matrix EquationPutting it all together:
x′ = Ax where A = [ 2 −1 3 ] [ 1 0 −1 ] [−4 2 0 ]
6
Step 6 — Verify by Multiplying AxRow 1 of Ax: 2·x₁ + (−1)·x₂ + 3·x₃ = 2x₁ − x₂ + 3x₃ ✓ Row 2 of Ax: 1·x₁ + 0·x₂ + (−1)·x₃ = x₁ − x₃ ✓ Row 3 of Ax: (−4)·x₁ + 2·x₂ + 0·x₃ = −4x₁ + 2x₂ ✓ Every row matches the original equation. The matrix form is correct.
Verified! The matrix equation faithfully represents the original system.

Advantages & Common Pitfalls

Writing systems in matrix form is not just cosmetic — it unlocks powerful solution methods and helps you spot structure. But there are also traps that trip up beginners. The table below summarizes both sides.

Advantages vs. Common Pitfalls of the Matrix Form
AdvantagesCommon Pitfalls
Compactness — n equations become one expression x′ = Ax, making systems easier to read and communicate.Sign errors — forgetting to carry a negative sign from the equation into the matrix entry.
Eigenvalue methods — you can directly compute eigenvalues of A to find general solutions without guessing.Column order mismatch — the columns of A must follow the same ordering as the entries of x.
Computer-friendly — software like MATLAB and Python can solve x′ = Ax in a single command.Missing zero entries — when a variable doesn't appear in an equation, you must still put 0 in the matrix.
Generalization — the same framework works for 2, 3, or 100 equations.Non-isolated derivatives — if x₁′ + 2x₁ = x₂ isn't rearranged first, you'll read the wrong coefficients.
KEY TAKEAWAY
Matrix form is like switching from writing out a recipe ingredient by ingredient ('2 cups flour, 1 cup sugar, 3 eggs …') to using a table with columns for ingredient and amount. The information is identical, but the organized format is faster to read, harder to mess up, and easy to feed into a calculator. The matrix equation x′ = Ax is that organized table for differential equations.

Connection to Advanced Theory

Writing a system in matrix form is the first step in a larger toolkit. Once you have x′ = Ax, you can apply eigenvalue and eigenvector techniques to find the general solution. The table below previews how this concept connects to topics you'll encounter next.

How Writing Systems in Matrix Form Leads to Solution Techniques
This LessonNext Steps
Identify the coefficient matrix A from a system of equations.Compute eigenvalues by solving det(A − λI) = 0.
Write x′ = Ax for a homogeneous system.Use eigenvalues and eigenvectors to build the general solution x(t) = c₁v₁eᵏ¹ᵗ + c₂v₂eᵏ²ᵗ + …
Recognize a non-homogeneous system x′ = Ax + g(t).Apply variation of parameters or undetermined coefficients in matrix form.
Handle constant coefficient matrices.Explore the matrix exponential eᴬᵗ as the most general solution operator.

Every one of these advanced methods relies on having the system correctly written in matrix form. If A is wrong by even one entry, your eigenvalues will be off and your entire solution collapses. That is why mastering the conversion process now pays dividends throughout the course.

Practice Problems

PROBLEM 1CONCEPTUAL
In the matrix equation x′ = Ax, what does the entry in row 2, column 3 of A represent? Explain in your own words.
PROBLEM 2BASIC CALCULATION
Write the following 2 × 2 system in matrix form x′ = Ax: x₁′ = 5x₁ − 3x₂ x₂′ = 2x₁ + x₂
PROBLEM 3INTERMEDIATE
Write the following 3 × 3 system in matrix form. Be careful — some variables are missing from some equations. x₁′ = −x₁ + 6x₃ x₂′ = 3x₁ − 2x₂ + x₃ x₃′ = 7x₂
PROBLEM 4APPLIED
A predator-prey model gives the populations R(t) (rabbits) and F(t) (foxes) with: R′ = 0.4R − 0.1F F′ = 0.02R − 0.3F Write this system in matrix form using the state vector x = [R, F]ᵀ. Then identify what a₁₂ = −0.1 means ecologically.
PROBLEM 5CRITICAL THINKING
A student is given the system: 2x₁′ + x₂′ = x₁ − x₂ x₁′ − x₂′ = 3x₁ + 2x₂ The student tries to write A = [[1, −1], [3, 2]]. Explain why this is incorrect. What must the student do first before constructing A, and what additional challenge does this system present compared to standard problems?

Summary — Writing Systems in Matrix Form

A system of first-order linear differential equations can always be rewritten as the compact matrix equation x′ = Ax. The coefficient matrix A is built row by row: row i contains the coefficients from the i-th equation, with each column corresponding to one unknown function in the state vector x. Missing variables produce zero entries. When external forcing is present, the system becomes x′ = Ax + g(t).

The four-step process — list unknowns, isolate derivatives, read off coefficients, and assemble the matrix equation — works for systems of any size. Always verify by multiplying Ax to confirm each row reproduces the original equation. This matrix form is the essential starting point for eigenvalue-based solution methods, matrix exponentials, and computational approaches used throughout differential equations and engineering.

Varsity Tutors • Differential Equations • Systems in Matrix Form — Writing Systems in Matrix Form