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.

A changing curve with sigma and variable symbols for differential equations
Inside this lesson 10 sections 5 questions 7 figures

SECTION 1

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.

SECTION 2

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.

SECTION 3

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.

From Two Equations → One Matrix EquationORIGINAL SYSTEMx₁' = 3x₁ + 2x₂x₂' = −x₁ + 4x₂Two coupled equationsextractBUILD PIECESCoefficient Matrix A: 3 2−1 4State Vector x(t):x₁x₂Derivative Vector x'(t):x₁'x₂'combineMATRIX EQUATIONx₁'x₂'= 3 2−1 4x₁x₂x' = AxOne equation replaces two!Colors: pink = coefficient matrix A, amber = state vector x, green = derivative vector x'
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.

SECTION 4

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)

x1′=a11x1+a12x2+⋯+a1nxnx2′=a21x1+a22x2+⋯+a2nxn⋮xn′=an1x1+an2x2+⋯+annxnx₁′ = 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)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)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.

SECTION 5

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).
Four-Step Translation FlowchartStep 1: List UnknownsDecide order: x₁, x₂, …, xₙStep 2: Isolate Derivativesxᵢ' alone on the left sideStep 3: Read Off CoefficientsRow i, Column j → coefficient of xⱼ in equation iMissing variable → 0Step 4: Assemble x' = Ax (+ g)Write the full matrix equation✓ VERIFY: Multiply Ax and compare to original equationsEach row of the product should match one original equationExample:x₁, x₂, x₃Example:x₁' = ... + ...
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.

SECTION 6

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. 1

    Step 1 — State the System

    We 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. 2

    Step 2 — List the Unknowns in Order

    The 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. 3

    Step 3 — Verify Derivatives Are Isolated

    Each 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. 4

    Step 4 — Read Off Coefficients Row by Row

    Equation 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. 5

    Step 5 — Assemble the Matrix Equation

    Putting it all together:
    x′ = Ax where A = [ 2 −1 3 ] [ 1 0 −1 ] [−4 2 0 ]
  6. 6

    Step 6 — Verify by Multiplying Ax

    Row 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.

SECTION 7

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.

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.

Advantages vs. Common Pitfalls of the Matrix Form

✦

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.

SECTION 8

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.

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.

How Writing Systems in Matrix Form Leads to Solution Techniques

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.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

In the matrix equation x′ = Ax, what does the entry in row 2, column 3 of A represent? Explain in your own words.
Show answer
The entry a₂₃ is the coefficient of the third unknown function x₃ in the second equation of the system. When you multiply row 2 of A by the state vector x, the a₂₃ entry gets multiplied by x₃ and contributes to x₂′. In physical terms, it measures how strongly the third variable influences the rate of change of the second variable.

Question 2: BASIC CALCULATION

Write the following 2 × 2 system in matrix form x′ = Ax: x₁′ = 5x₁ − 3x₂ x₂′ = 2x₁ + x₂
Show answer
The state vector is x = [x₁, x₂]ᵀ and the derivative vector is x′ = [x₁′, x₂′]ᵀ. From the first equation, the coefficients are 5 (for x₁) and −3 (for x₂), forming row 1 of A. From the second equation, the coefficients are 2 and 1, forming row 2. Therefore A = [[5, −3], [2, 1]], and the matrix equation is x′ = [[5, −3], [2, 1]] x. You can verify by multiplying: row 1 gives 5x₁ − 3x₂ ✓ and row 2 gives 2x₁ + x₂ ✓.

Question 3: INTERMEDIATE

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₂
Show answer
Start by reading off each row of A. Equation 1: coefficient of x₁ is −1, x₂ is absent so its coefficient is 0, and x₃ has coefficient 6 → row 1 = [−1, 0, 6]. Equation 2: coefficients are 3, −2, and 1 → row 2 = [3, −2, 1]. Equation 3: x₁ is absent (0), x₂ has coefficient 7, x₃ is absent (0) → row 3 = [0, 7, 0]. Thus A = [[−1, 0, 6], [3, −2, 1], [0, 7, 0]] and the matrix equation is x′ = Ax. Two zero entries are easy to miss — always check for missing variables.

Question 4: APPLIED

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.
Show answer
The coefficient matrix is A = [[0.4, −0.1], [0.02, −0.3]] and the matrix equation is x′ = Ax where x = [R, F]ᵀ. The entry a₁₂ = −0.1 is the coefficient of F in the equation for R′. Ecologically, it means that each additional fox decreases the rabbit growth rate by 0.1 units — foxes prey on rabbits. The negative sign makes biological sense: more predators hurt the prey population. This example shows how matrix entries encode real-world interactions between coupled quantities.

Question 5: CRITICAL 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?
Show answer
The student's matrix is wrong because the derivatives on the left side are not isolated — each equation has a mix of x₁′ and x₂′. Before building A, the student must solve the two equations algebraically for x₁′ and x₂′ individually. This requires treating x₁′ and x₂′ as unknowns in a 2 × 2 linear algebra problem. Specifically, let M = [[2, 1], [1, −1]] be the coefficient matrix of the derivatives. Then M·[x₁′, x₂′]ᵀ = [[1, −1], [3, 2]]·x. The student must invert M and write [x₁′, x₂′]ᵀ = M⁻¹ · [[1, −1], [3, 2]] · x to find the true coefficient matrix A = M⁻¹ · [[1, −1], [3, 2]]. This situation is more challenging because you need matrix inversion before you can even identify A.

SUMMARY

Summary — Writing Systems in Matrix Form

Summary

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