Introduction to ODEs

Examples of ODEs

The first examples of ODEs one typically encounters is exponential decay (e.g. radioactivity, Newton’s law of cooling): $$ \dot x = - a x \,. $$ This is easily solved, and one can see $x(t) = x_0 e^{-a t}$ is a solution, which corresponds to the expected physical behavior of the system.

A nonlinear version of this is often encountered in population growth models is the logistic equation: $$ \dot P = r P \paren[\Big]{1 - \frac{P}{K}} \,. $$ Here $P(t)$ is the population at time $t$, and $r, K > 0$ are constants representing the reproduction rate, and the carrying capacity respectively. This can also be explicitly solved $$ P(t)=\dfrac{P_0Ke^{rt}}{(K−P_0)+P_0e^{rt}} $$ When $t$ is small, $P_0 \ll K$, the solution grows like $P_0 e^{rt}$. When $t$ is large the $(K - P_0)$ term in the denominator is negligible and the solution converges to $K$ as $t \to \infty$. This again captures the expected behavior.

More interesting behavior is observed from systems of equations. The Lotka, Volterra are often used to model predator prey systems. \begin{aligned} \dot x &=\alpha x-\beta xy,\\ \dot y &=-\gamma y+\delta xy, \end{aligned} Here $x(t)$, $y(t)$ are population densities of two species (e.g. $x$ is rabbits, $y$ is foxes) where one species feeds on the other. The parameters $\alpha, \beta$, $\gamma$, $\delta$ are rate constants. The system can be explicitly solved; but the solution is not simple expression.

One can verify that the solutions typically exhibit a time periodic behavior, which is expected both from the system and for biological reasons. An interesting point worth mentioning is the paradox of pesticides: Note the equilibrium solution is at $x = \gamma / \delta$ and $y = \alpha / \beta$. If you, say, make the environment worse for the predator by increasing $\gamma$ (e.g. add a pesticide, or go hunting). This doesn’t change the equilibrium density of the predator; but increases that of the prey. One often cited example is the increase of the population of sharks during World War 2 due to reduced fishing.

Autonomous Linear Equations

Consider the system $$ \dot x = Ax\,, $$ where $x \colon [0, \infty) \to \R^d$ is differentiable, and $A$ is a $d \times d$ (time independent) matrix. Clearly $$\label{e:A}\tag{A} x(t) = \exp(A t) x_0 $$ is a solution with initial data $x(0) = x_0$. Though computing the matrix exponential requires some work.

First set $y = U x$, and compute $$ \dot y = (U A U^{-1}) y\,. $$ If $A$ is diagonalizable, choose $U$ so that $U A U^{-1} = D$, and note $$ y(t) = \exp(t D) y_0 \quad\implies\quad x(t) = U^{-1} \exp(t D) U x_0 \,. $$

Remark 1. We will soon show that this is the unique solution of \eqref{e:A} with initial data $x_0$.

For diagonal matrices, $\exp(tD)$ can be computed by just exponentiating the entries. The negative eigenvalues correspond to stable directions, and the components along these eigenbasis vectors will vanish exponentially fast. The positive eigenvalues correspond to unstable directions and the components along these eigenbasis vectors will grow exponentially fast.

In general one uses the Jordan decomposition of $A$ to compute the exponential. The Jordan decomposition guarantees the existence of sub-spaces $\{E_j\}$ such that every subspace corresponds to either a real eigenvalue $\lambda_j = a_j$, or a pair of complex eigenvalues $\lambda_j = a_j + i b_j$ and $\bar \lambda_j = a_j - i b_j$. On each subspace there exists a basis $B_j$ such that one of the following hold:

  1. For subspaces corresponding to the real eigenvalues $\lambda_j = a_j + 0 i$, $$ (A)_{B_j} = \begin{pmatrix} a_j & 1 & & & \\ & a_j & 1 & & \\ & & \ddots & \ddots & \\ & & & a_j & 1 \\ & & & & a_j \end{pmatrix} \quad\text{and}\quad (e^{t A})_{B_j} = e^{a_j t} % \sum_{k=0}^{m_j - 1} \frac{t^k}{k!} ( (A)_{B_j} - \lambda_j I)^k \begin{pmatrix} 1 & t & \frac{t^2}{2} & \cdots & \frac{t^{m_j - 1}}{(m_j - 1)!} \\ & 1 & t & \cdots & \frac{t^{m_j - 2}}{(m_j - 2)!}\\ & & 1 & \ddots & \vdots \\ & & & \ddots & t\\ & & & & 1 \end{pmatrix} \,, $$ where $m_j = \dim(E_j)$.

  2. On every subspace corresponding to the conjugate eigenvalue pair $a_j + i b_j$ and $a_j - i b_j$, $$ (A)_{B_j} = \begin{pmatrix} C_j & I_2 & & & \\ & C_j & I_2 & & \\ & & \ddots & \ddots & \\ & & & C_j & I_2 \\ & & & & C_j \end{pmatrix} \quad\text{and}\quad (e^{t A})_{B_j} = e^{a_j t} \begin{pmatrix} R_j & t R_j & \frac{t^2}{2} R_j & \cdots & \frac{t^{m_j - 1}}{(m_j - 1)!} R_j \\ & R_j & t R_j & \cdots & \frac{t^{m_j - 2}}{(m_j - 2)!} R_j \\ & & R_j & \ddots & \vdots \\ & & & \ddots & t R_j \\ & & & & R_j \end{pmatrix} $$ where $$ m_j = \frac{\dim(E_j)}{2} \,,\quad I_2 = \begin{pmatrix}1 & 0 \\ 0 & 1 \end{pmatrix} \,,\quad C_j \defeq \begin{pmatrix} a_j & b_j \\ -b_j & a_j \end{pmatrix} \,,\quad R_j = \begin{pmatrix} \cos(b_j t) & \sin(b_j t) \\ -\sin(b_j t) & \cos (b_j t) \end{pmatrix} \,. $$

Problem 2. If a matrix $M = (A)_{B_j}$ is a Jordan block form above, (either corresponding to real or complex conjugate pair eigenvalues) then show that its exponential $e^{t M}$ is given by the corresponding formula above.

Proposition 3. Let $E^{\pm} = \oplus_{j \in J^{\pm}} E_j$, $E^{0} = \oplus_{j \in J^{0}} E_j$, where $J^{+} = \set{j \st a_j > 0}$, $J^{0} = \set{j \st a_j = 0}$, $J^{-} = \set{j \st a_j < 0}$.

  1. If $x_0 \in E^{-}$, then $x(t) \to 0$ as $t \to \infty$.
  2. If $x_0 \in E^{+}$, then $x(t) \to 0$ as $t \to -\infty$ (but diverges as $t \to \infty$).
  3. If $x_0 \in E^{0}$, and $m_j = 1$ for all $j \in J_0$ then the trajectory stays bounded as $t \to \pm \infty$.

Problem 4. Suppose $A$ is a $2 \times 2$ real matrix. Show that any non-zero trajectory $x(t)$ of the solution to $\dot x = Ax$ is geometrically one of the following. (In each case determine what spectral property of $A$ guarantees that case.)

  1. Equilibrium Point: Constant in time ($x(t) = x_0$).
  2. Straight Ray: A straight line ray moving toward $0$, or toward $\infty$ as $t \to \infty$.
  3. Parallel Line: A straight line moving toward or away from a line of equilibrium points.
  4. Hyperbola: A hyperbolic curve with an asymptote, which is unbounded both as $t \to \infty$, and $t \to -\infty$.
  5. Node/Degenerate Curve: A curve converging to $0$ (or diverging to $\infty$) along a single tangent direction.
  6. Spiral: A logarithmic spiral winding toward $0$ or toward $\infty$ as $t \to \infty$.
  7. Ellipse: A closed concentric ellipse (or circle) centered at the origin.

Problem 5. Consider the $n$-th order linear ODE $$ x^{(n)} + c_{n-1} x^{(n-1)} + \cdots + c_1 \dot x + c_0 x = 0 \,. $$

  1. Define $y \colon \mathbb{R} \to \mathbb{R}^n$ by $y_k(t) \defeq x^{(k-1)}(t)$ for $k = 1, \dots, n$. Find a matrix $A$ so that $\dot y = A y$.
  2. Show that all eigenvalues of $A$ have geometric multiplicity $1$.
  3. Let $\{\lambda_j\}_{1 \leq j \leq J}$ be the distinct complex eigenvalues of $A$ with algebraic multiplicities $\{m_j\}_{1 \leq j \leq J}$. Assuming the uniqueness statement in Remark 1, show that a basis for the complex solution space is given by $\{x_{j, k} \mid 1 \leq j \leq J, 0 \leq k < m_j\}$, where $$ x_{j, k}(t) \defeq t^k e^{\lambda_j t} \,. $$

Theorem 6 (Duhamel’s principle). Let $N \colon R^{d+1} \to \R^d$ be some (possibly nonlinear) function of $t$ and $y$. Given $y_0 \in \R^d$, the function $y$ defined by $$\label{e:D}\tag{D} y(t) \defeq e^{A t} y_0 + \int_0^t e^{(t - s) A} N(s, y(s)) \, ds $$ is a solution of the ODE $$\label{e:N}\tag{N} \dot y = Ay + N(t, y)\,. $$

Remark 7. If you know that the initial value problem for \eqref{e:N} is unique, then \eqref{e:D} gives the unique solution.

Time inhomogeneous linear equations

We now consider the equation $$\label{e:I}\tag{I} \dot x = A(t) x \,, $$ where $A(t)$ is some time dependent $d \times d$ matrix. (For now we’re assuming all functions are differentiable; we will revisit regularity in detail later.)

Proposition 8. Fix $t_0 < T \in \R$. If for all $t_1, t_2 \in [t_0, T]$, $[A(t_1), A(t_2)] = 0$, then for every $t \in [t_0, T]$ the function $$ x(t) = \exp\paren[\Big]{\int_{t_0}^t A(s) \, ds} x(t_0) $$ is a solution to \eqref{e:I} with initial data $x(t_0)$ at time $t_0$.

Remark 9. Here $[A, B] = AB - BA$ is the commutator of matrices. Note for $d = 1$, the commutator condition is automatically satisfied, and so the above always gives you a solution to the time inhomogeneous problem in one dimension. In higher dimension the commutator will generically fail.

Proof of Proposition 8. Define $$ B(t) \defeq \int_{t_0}^t A(s) \, ds \,. $$ The derivative of $B$ is given by the Wilcox formula: $$\label{e:W}\tag{W} \partial_t e^{B(t)} = \int_0^1 e^{\alpha B(t)} A(t) e^{(1-\alpha)B(t)} \, d\alpha $$

To prove \eqref{e:W}, define $g(\alpha, t) = e^{-\alpha B(t)} \partial_t e^{\alpha B(t)}$ and compute $$ \partial_\alpha g = B(t) e^{-\alpha B(t)} \partial_t e^{\alpha B(t)} + e^{-\alpha B(t)} \partial_t (B(t) e^{\alpha B(t)}) = e^{-\alpha B(t)} A(t) e^{\alpha B(t)} \,. $$ Now use $e^{-B(t)} \partial_t e^{B(t)} = g(1, t) - g(0, t) = \int_0^1 g(\alpha, t) \, d\alpha$.

We will prove existence and uniqueness for \eqref{e:I} shortly. Assuming them momentarily allows us to find general solutions to \eqref{e:I} by the superposition principle: A linear combination of solutions to \eqref{e:I} is still a solution. By expressing the initial data $x_0$ as a linear combination of basis vectors, we can express the solution at time $t$ as the corresponding linear combination of solutions. It’s convenient to do this in matrix form.

Definition 10. The principal matrix solution of \eqref{e:I} is the solution to the matrix equation $$ \partial_t \Pi(t_0, t) = A(t) \Pi(t_0, t) \quad\text{with}\quad \Pi(t_0, t_0) = I \,. $$

Proposition 11. For any $x_0 \in \R^d$, $t_0 \in \R$ the solution to \eqref{e:I} with initial data $x(t_0) = x_0$ is $$ x(t) = \Pi(t_0, t) x_0 \,. $$

Proposition 12. For any $r, s, t \in \R$, $$ \Pi(s, t) \Pi(r, s) = \Pi(r, t) \,. $$

Proposition 13 (Liouville’s formula). The Wronskian defined by $W(t) = \det(\Pi(t_0, t))$ satisfies the equation $$ \partial_t W(t) = \trace(A(t)) W(t) \quad\text{and hence}\quad W(t) = \exp\int_{t_0}^t \trace A(s) \, ds \,. $$

Proof sketch. First prove the Jacobi formula: For any differentiable $d \times d$ matrix valued function: $$ \partial_t \det(M(t)) = \det(M(t)) \, \trace\paren[\big]{ M(t)^{-1} \, \partial_t M(t) } \,. $$

Proposition 14 (Duhamel’s principle). Let $N \colon \R^{d+1} \to \R^d$ be some (possibly nonlinear) function of $t$ and $y$. Given $y_0 \in \R^d$, the function $y$ defined by $$\label{e:D2}\tag{D} y(t) \defeq \Pi(t_0, t) y_0 + \int_{t_0}^t \Pi(s, t) N(s, y(s)) \, ds $$ is a solution of the ODE $$\label{e:N2}\tag{N} \dot y = A(t) y + N(t, y)\,. $$