ODE system

We can express a linear system of differential equations of the form

x˙1=a1,1x1+a1,2x2++a1,nxnx˙2=a2,1x1+a2,2x2++a2,nxn  x˙n=an,1x1+an,2x2++an,nxn \begin{align*} \dot x_1 &= a_{1,1} x_1 + a_{1,2} x_2 + \cdots + a_{1,n} x_n \\ \dot x_2 &= a_{2,1} x_1 + a_{2,2} x_2 + \cdots + a_{2,n} x_n \\ & ~~\vdots \\ \dot x_n &= a_{n,1} x_1 + a_{n,2} x_2 + \cdots + a_{n,n} x_n \end{align*}

using a matrix such that x˙=Ax\dot{\mathbf x} = A \mathbf x:

ddt(x1x2xn)=(a1,1a1,2a1,na2,1a2,2a2,nan,1an,2an,n)(x1x2xn). \begin{align*} \frac{\mathrm d}{\mathrm dt} \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix} &= \begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n,1} & a_{n,2} & \cdots & a_{n,n} \\ \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix}. \end{align*}

To solve an ODE system of this form we guess the solution x=Ceλt\mathbf x = \mathbf C e^{\lambda t} where C\mathbf C is a constant vector.

x˙=λeλtCλC=AC. \begin{align*} \dot{\mathbf x} &= \lambda e^{\lambda t} \mathbf C \\ \lambda \mathbf C &= A \mathbf C. \end{align*}

We see that λ\lambda must be an eigenvalue of AA, and C\mathbf C its corresponding eigenvector. The general solution is then

x(t)=c1C1eλ1t+c2C2eλ2t++cnCneλnt \mathbf x(t) = c_1 \mathbf C_1 e^{\lambda_1 t} + c_2 \mathbf C_2 e^{\lambda_2 t} + \cdots + c_n \mathbf C_n e^{\lambda_n t}

where cic_i is determined by initial conditions.