Systems of ODEs

Many systems have several quantities evolving together, each rate depending on the others: two chemicals reacting, two populations competing, the position and velocity of a spring. Stack the unknowns into a vector \mathbf{x}(t) and the coupling into a matrix A, and a linear system is simply

\mathbf{x}' = A\mathbf{x}, \qquad \mathbf{x} = \begin{pmatrix} x \\ y \end{pmatrix}, \quad A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}.

For the scalar equation x' = \lambda x the answer is x = e^{\lambda t}x_0. The whole game here is to find directions in which the matrix system behaves like that scalar one — and those directions are the eigenvectors of A.

Why e^{\lambda t}\mathbf{v} works

Step 1 — guess a single-mode solution. Try \mathbf{x}(t) = e^{\lambda t}\mathbf{v} for a constant scalar \lambda and a constant vector \mathbf{v}. Differentiate:

\mathbf{x}'(t) = \lambda e^{\lambda t}\mathbf{v}.

Step 2 — substitute into \mathbf{x}' = A\mathbf{x}.

\lambda e^{\lambda t}\mathbf{v} = A\,e^{\lambda t}\mathbf{v}.

Step 3 — cancel the scalar. The factor e^{\lambda t} is never zero, so divide it out:

A\mathbf{v} = \lambda \mathbf{v}.

This is precisely the eigenvalue equation: e^{\lambda t}\mathbf{v} solves the system exactly when \lambda is an eigenvalue of A and \mathbf{v} a matching eigenvector. With two independent eigenpairs the general solution is their superposition, \mathbf{x} = C_1 e^{\lambda_1 t}\mathbf{v}_1 + C_2 e^{\lambda_2 t}\mathbf{v}_2.

Worked example: solve and classify

Take A = \begin{pmatrix} 1 & 2 \\ 2 & 1 \end{pmatrix} and solve \mathbf{x}' = A\mathbf{x} step by step.

Step 1 — the characteristic equation. Eigenvalues satisfy \det(A - \lambda I) = 0:

\det\!\begin{pmatrix} 1-\lambda & 2 \\ 2 & 1-\lambda \end{pmatrix} = (1-\lambda)^2 - 4 = 0.

Step 2 — solve for \lambda. (1-\lambda)^2 = 4 gives 1 - \lambda = \pm 2, so

\lambda_1 = 3, \qquad \lambda_2 = -1.

Step 3 — eigenvector for \lambda_1 = 3. Solve (A - 3I)\mathbf{v} = 0:

\begin{pmatrix} -2 & 2 \\ 2 & -2 \end{pmatrix}\mathbf{v} = 0 \;\Rightarrow\; -2v_1 + 2v_2 = 0 \;\Rightarrow\; v_1 = v_2, \quad \mathbf{v}_1 = \begin{pmatrix} 1 \\ 1 \end{pmatrix}.

Step 4 — eigenvector for \lambda_2 = -1. Solve (A + I)\mathbf{v} = 0:

\begin{pmatrix} 2 & 2 \\ 2 & 2 \end{pmatrix}\mathbf{v} = 0 \;\Rightarrow\; v_1 + v_2 = 0 \;\Rightarrow\; \mathbf{v}_2 = \begin{pmatrix} 1 \\ -1 \end{pmatrix}.

Step 5 — assemble the general solution.

\mathbf{x}(t) = C_1 e^{3t}\begin{pmatrix} 1 \\ 1 \end{pmatrix} + C_2 e^{-t}\begin{pmatrix} 1 \\ -1 \end{pmatrix}.

Step 6 — classify the equilibrium. The eigenvalues are \lambda_1 = 3 > 0 and \lambda_2 = -1 < 0 — real, opposite signs. One direction grows, the other decays, so the origin is a saddle: unstable, with trajectories sweeping in along \mathbf{v}_2 and out along \mathbf{v}_1.

For \mathbf{x}' = A\mathbf{x} with a 2\times2 matrix A, the eigenvalues of A determine both the solution and the geometry of the origin:

Rabbits x and foxes y obey the Lotka–Volterra system

x' = x(\alpha - \beta y), \qquad y' = y(\delta x - \gamma).

It is nonlinear, so eigenvalues do not solve it outright — but linearising near the coexistence equilibrium gives a matrix with purely imaginary eigenvalues, a center. That is why predator and prey numbers cycle endlessly, the fox peak lagging the rabbit peak, tracing closed loops in the phase plane — the (x, y) picture where time is hidden and we read motion straight off the curves. The phase plane is the right place to see a node, saddle, spiral, or center, which is exactly what the figure below lets you do.

Phase portrait: tune the eigenvalues

Below is the phase plane of \mathbf{x}' = A\mathbf{x} with several trajectories. The slider switches A between four canonical cases — watch how the eigenvalue signs reshape the flow: a stable node (both negative), an unstable node (both positive), a saddle (opposite signs), and a center (imaginary, closed orbits).