# How to solve simple systems of differential equations

Say we are given a system of differential equations

$$\left[ \begin{array}{c} x' \\ y' \end{array} \right] = A\begin{bmatrix} x \\ y \end{bmatrix}$$

Where $A$ is a $2\times 2$ matrix.

How can I in general solve the system, and secondly sketch a solution $\left(x(t), y(t) \right)$, in the $(x,y)$-plane?

For example, let's say

$$\left[ \begin{array}{c} x' \\ y' \end{array} \right] = \begin{bmatrix} 2 & -4 \\ -1 & 2 \end{bmatrix} \left[ \begin{array}{c} x \\ y \end{array} \right]$$

Secondly I would like to know how you can draw a phane plane? I can imagine something like setting $c_1 = 0$ or $c_2=0$, but I'm not sure how to proceed.

-
Please do not modify substantially the question after several answers are posted. – Did Jan 12 '13 at 19:42
? I did not, because I asked it already, but nobody noted it – Applied mathematician Jan 13 '13 at 14:10
This is not true: the whole second part of your question appeared after Wooster's answer and mine were posted. Once again: please do not do that. – Did Jan 13 '13 at 15:23

If you don't want change variables then,

there is a simple way for calculate $e^A$(all cases).

Let me explain about. Let A be a matrix and $p(\lambda)=\lambda^2-traço(A)\lambda+det(A)$ the characteristic polynomial. We have 2 cases:

$1$) $p$ has two distinct roots

$2$) $p$ has one root with multiplicity 2

The case 2 is more simple:

In this case we have $p(\lambda)=(\lambda-a)^2$. By Cayley-Hamilton follow that $p(A)=(A-aI)^2=0$. Now develop $e^x$ in taylor series around the $a$

$$e^x=e^a+e^a(x-a)+e^a\frac{(x-a)^2}{2!}+...$$

Therefore $$e^A=e^aI+e^a(A-aI)$$

Note that $(A-aI)^2=0$ $\implies$ $(A-aI)^n=0$ for all $n>2$

Case $1$:

Let A be your example. The eigenvalues are $0$ and $4$. Now we choose a polynomial $f$ of degree $\le1$ such that $e^0=f(0)$ and $e^4=f(4)$( there is only one). In other words what we want is a function $f(x)=cx+d$ such that

$$1=d$$

$$e^4=c4+d$$

Solving this system we have $c=\dfrac{e^4-1}{4}$ and $d=1$.

I say that

$$e^A=f(A)=cA+dI=\dfrac{e^4-1}{4}A+I$$

In general if $\lambda_1$ and $\lambda_2$ are the distinct eigenvalue, and $f(x)=cx+d$ satisfies $f(\lambda_1)=e^{\lambda_1}$ and $f(\lambda_2)=e^{\lambda_2}$, then

$$e^A=f(A)$$

If you are interested so I can explain more (it is not hard to see why this is true)

Now I will solve your equation using above.

What we need is $e^{tA}$

The eigenvalues of $tA$ is $0$ and $4t$.

Then $e^{tA}=\dfrac{e^{4t}-1}{4t}A+I$ for $t$ distinct of $0$

-
@JoyeuseSaintValentin If you are interested why is true case 2, I can explain more (it is not hard to see why this is true) – user52188 Jan 12 '13 at 19:39

Quite generally, $$\left[ \begin{array}{c} x(t) \\ y(t) \end{array} \right] = \mathrm e^{tA}\begin{bmatrix} x(0) \\ y(0) \end{bmatrix},$$ where, by definition, $$\mathrm e^{tA}=\sum_{n=0}^{+\infty}\frac{t^n}{n!}A^n.$$ To compute $\mathrm e^{tA}$ in the case at hand, note that $A^2=4A$, hence $$\mathrm e^{tA}=I+\sum_{n=1}^{+\infty}\frac{t^n}{n!}4^{n-1}A=I+\frac{\mathrm e^{4t}-1}4A.$$ Hence, $$x(t)=\frac{\mathrm e^{4t}+1}2x(0)+(1-\mathrm e^{4t})y(0),$$ and $$y(t)=\frac{1-\mathrm e^{4t}}4x(0)+\frac{\mathrm e^{4t}+1}2y(0).$$

-
I know the definition of $e^{tA}$ as a series. I also understand that $$\mathrm e^{tA}=I+\sum_{n=1}^{+\infty}\frac{t^n}{n!}4^{n-1}A$$ But can you explain the last equality: $$I+\sum_{n=1}^{+\infty}\frac{t^n}{n!}4^{n-1}A=I+\frac{\mathrm e^{4t}-1}4A.$$ – Applied mathematician Jan 12 '13 at 12:54
Am I mistaken or does your second comment answer the question in your first comment? – Did Jan 12 '13 at 12:55
No, I just messed it up. My question is why the last equality is true – Applied mathematician Jan 12 '13 at 12:57
Because $\sum\limits_{n=1}^{+\infty}\frac{t^n}{n!}4^{n-1}=\frac{1}{4}\sum\limits_{n=1}^{‌​+\infty}\frac{(4t)^n}{n!}$ and the second series is almost the expansion of $\mathrm e^{4t}$ (almost because the $n=0$ term is lacking). – Did Jan 12 '13 at 13:02
Eigenvalues are always in the background, one way or another. For example, here $A^2=4A$ because $\chi_A(x)=x^2-4x$ and $\chi_A(A)=0$ by Cayley-Hamilton. – Did Jan 12 '13 at 15:29

$\newcommand{\vect}[1]{\mathbb{#1}}$Try finding out about diagonalisation of matrices. (If you do not already know about this.)

The basic idea is that I can find a particular matrix P, and a diagonal matrix $\Lambda$; these combine in such a way that $A = P \Lambda P^{-1}$. (These matrices relate to the eigenvectors and eigenvalues of your matrix $A$.)

The way we use diagonalisation is as follows. Let me redefine the question slightly so that it is easier for me to explain: I shall use the differential equation $$\begin{bmatrix}x_1'\\x_2'\end{bmatrix} = A \begin{bmatrix}x_1\\x_2\end{bmatrix}.$$ Let me call the vector of functions $\vect{x}$: then I can write our equation as $$\vect{x}' = A \vect{x}.$$ Replacing $A$ with my expression $A = P\Lambda P^{-1}$, I have $$\vect{x}' = P \Lambda P^{-1} \vect{x},$$ or $$P^{-1} \vect{x}' = \Lambda P^{-1} \vect{x}.$$ But the matrix $P$ is just a constant matrix, so if I were to define $\vect{y} = P^{-1} \vect{x}$, then we would simply have $$\vect{y}' = \Lambda \vect{y}.$$

Big deal, you might think: this is just like the old equation. But remember that $\Lambda$ is a diagonal matrix. So in fact this equation looks like $$\begin{bmatrix}y_1'\\y_2'\end{bmatrix} = \begin{bmatrix}\lambda_1 & 0 \\0 & \lambda_2\end{bmatrix} \begin{bmatrix}y_1\\y_2\end{bmatrix},$$ which is far simpler to solve. I can solve the differential equations for our $y_i$ functions, and then use the equation $$\vect{x} = P \vect{y}$$ to find the solution to our original problem.

[EDIT: removed references to $P$ being orthogonal which are incorrect.]

-
Thank you, that made sense. But actually my matrix is not diagonalizable. Then some Jordan theorem applies I guess? – Applied mathematician Jan 12 '13 at 12:56
Sorry to interrupt but A is diagonalizable. – Did Jan 12 '13 at 13:03
Indeed it is. I was just trying to work it out, but it certainly looks diagonalisable. Eigenvalues 0 and 4. I did notice an error in my write-up which said you want an orthogonal matrix $P$; this is not true and I have removed it. – Wooster Jan 12 '13 at 13:11
I see, but what to do when you cannot diagonalize? – Applied mathematician Jan 12 '13 at 13:11
If diagonalisation is not possible, then I think you are correct: Jordan normal form would be a good idea. It will give you a number of simple first-order ODEs to solve and then a simple algorithm for solving the rest. – Wooster Jan 12 '13 at 13:17