2×2 Linear System ODE Solver

Published on: December 14, 2025

This 2×2 Linear System ODE Solver helps you solve a system of two first-order differential equations and shows each step clearly. It works with constant-coefficient homogeneous systems, rewrites the system in matrix form, computes eigenvalue information, uses the matrix exponential, and applies optional initial conditions to find a particular solution.

Step-by-step method

  1. Write the two first-order ODEs clearly.
  2. Isolate x′ and y′ so each equation gives one derivative.
  3. Rewrite the system in vector form X′ = A X.
  4. Find the characteristic equation det(A − λI) = 0.
  5. Find the eigenvalues and eigenvectors when useful.
  6. Use the matrix exponential formula X(t) = e^{At}C, or X(t)=e^{A(t−t0)}X0 when initial conditions are given.
  7. Write the final component functions x(t) and y(t).

Formula bank:

Matrix form: X′ = A X
det(A − λI) = 0
X(t) = eAtC
With X(t0) = X0: X(t) = eA(t−t0)X0
For simple eigenpairs: X(t)=C1v1eλ1t+C2v2eλ2t

Example 1: dx/dt = 2x + y; dy/dt = x + 2y, t, x, y, x(0)=1, y(0)=0

Step 1 - Write the system.

In this problem: Start with the two first-order equations.

dx
dt
= 2x + y
dy
dt
= 2y + x

Step 2 - Isolate the derivatives.

In this problem: Each equation gives one derivative.

x′ = 2x + y
y′ = 2y + x

Step 3 - Define X and X′.

In this problem: Collect the two dependent variables into a column vector.

X = [
x
y
]
X′ = [
x′
y′
]

Step 4 - Build the coefficient matrix.

In this problem: Read the coefficients of x and y from the derivative equations.

A = [
21
12
]
X′ = A X

Step 5 - Find the characteristic equation.

In this problem: Compute det(A − λI) = 0.

det(A − λI) = 0
(−1 + λ)(−3 + λ) = 0

Step 6 - List the eigenvalues.

In this problem: These control growth, decay, oscillation, and stability.

λ1 = 3 (multiplicity 1)
λ2 = 1 (multiplicity 1)

Step 7 - Find eigenvectors when useful.

In this problem: Eigenvectors give solution directions. If they are not convenient, the matrix exponential method still works.

λ = 1 has algebraic multiplicity 1
v1 = [
-1
1
]
λ = 3 has algebraic multiplicity 1
v2 = [
1
1
]

Step 8 - Use the matrix exponential solution formula.

In this problem: For every constant-coefficient homogeneous system, the general solution is X(t)=e^{At}C.

X(t) = eAt C
C = [
C1
C2
]

Step 9 - Compute e^{At}.

In this problem: This matrix sends the constant vector or initial vector forward in time.

eAt = [
1
2
et +
1
2
e3t
1
2
e3t
1
2
et
1
2
e3t
1
2
et
1
2
et +
1
2
e3t
]

Step 10 - Multiply e^{At} by C.

In this problem: This gives the general solution before applying initial conditions.

x(t) =
1
2
(C1(1 + e2t) − C2(1 − e2t))et
y(t) =
1
2
(C2(1 + e2t) − C1(1 − e2t))et

Step 11 - Write the initial vector.

In this problem: Collect x(t0) and y(t0) into X0.

t0 = 0
X0 = [
1
0
]

Step 12 - Use the IVP formula.

In this problem: Instead of solving constants manually, use X(t)=e^{A(t−t0)}X0.

X(t) = eA(t−t₀)X0
eA(t−t₀) = [
1
2
et +
1
2
e3t
1
2
e3t
1
2
et
1
2
e3t
1
2
et
1
2
et +
1
2
e3t
]

Step 13 - Multiply by the initial vector.

In this problem: This gives the particular solution satisfying both initial conditions.

x(t) =
1
2
(1 + e2t)et
y(t) =
1
2
(−1 + e2t)et

Step 14 - Classify the equilibrium.

In this problem: Use the real parts of the eigenvalues.

Type: Unstable node / source

Step 15 - Final answer.

In this problem: Write the two component functions.

x(t) =
1
2
(1 + e2t)et
y(t) =
1
2
(−1 + e2t)et

Final answer: See final step

Example 2: x' = y; y' = -x, t, x, y, x(0)=1, y(0)=0

Step 1 - Write the system.

In this problem: Start with the two first-order equations.

dx
dt
= y
dy
dt
= −x

Step 2 - Isolate the derivatives.

In this problem: Each equation gives one derivative.

x′ = y
y′ = −x

Step 3 - Define X and X′.

In this problem: Collect the two dependent variables into a column vector.

X = [
x
y
]
X′ = [
x′
y′
]

Step 4 - Build the coefficient matrix.

In this problem: Read the coefficients of x and y from the derivative equations.

A = [
01
-10
]
X′ = A X

Step 5 - Find the characteristic equation.

In this problem: Compute det(A − λI) = 0.

det(A − λI) = 0
1 + λ2 = 0

Step 6 - List the eigenvalues.

In this problem: These control growth, decay, oscillation, and stability.

λ1 = −i (multiplicity 1)
λ2 = i (multiplicity 1)

Step 7 - Find eigenvectors when useful.

In this problem: Eigenvectors give solution directions. If they are not convenient, the matrix exponential method still works.

λ = −i has algebraic multiplicity 1
v1 = [
i
1
]
λ = i has algebraic multiplicity 1
v2 = [
−i
1
]

Step 8 - Use the matrix exponential solution formula.

In this problem: For every constant-coefficient homogeneous system, the general solution is X(t)=e^{At}C.

X(t) = eAt C
C = [
C1
C2
]

Step 9 - Compute e^{At}.

In this problem: This matrix sends the constant vector or initial vector forward in time.

eAt = [
1
2
eit +
1
2
e−it
1
2
ie−it
1
2
ieit
1
2
ieit
1
2
ie−it
1
2
eit +
1
2
e−it
]

Step 10 - Multiply e^{At} by C.

In this problem: This gives the general solution before applying initial conditions.

x(t) =
1
2
(C1(1 + e2it) + iC2(1 − e2it))e−it
y(t) =
1
2
(C2(1 + e2it) − iC1(1 − e2it))e−it

Step 11 - Write the initial vector.

In this problem: Collect x(t0) and y(t0) into X0.

t0 = 0
X0 = [
1
0
]

Step 12 - Use the IVP formula.

In this problem: Instead of solving constants manually, use X(t)=e^{A(t−t0)}X0.

X(t) = eA(t−t₀)X0
eA(t−t₀) = [
1
2
eit +
1
2
e−it
1
2
ie−it
1
2
ieit
1
2
ieit
1
2
ie−it
1
2
eit +
1
2
e−it
]

Step 13 - Multiply by the initial vector.

In this problem: This gives the particular solution satisfying both initial conditions.

x(t) = cos(t)
y(t) = −sin(t)

Step 14 - Classify the equilibrium.

In this problem: Use the real parts of the eigenvalues.

Type: Center / marginal / degenerate

Step 15 - Final answer.

In this problem: Write the two component functions.

x(t) = cos(t)
y(t) = −sin(t)

Final answer: See final step