2 Notation and basic concepts

2.1 Ordinary differential equations (ODEs)

We only consider coupled first order equations: autonomous(time-independent) equations \begin{equation*}\label{ode1} \dot{x} = f(x), \qquad x \in \mathbb{R}^n,\ f:\mathbb{R}^n\mapsto \mathbb{R}^n, \end{equation*} or occasionally non-autonomous (time-dependent) ones \begin{equation*} \dot{x} = f(x,t), \qquad x \in \mathbb{R}^n,\ f:\mathbb{R}^n\times\mathbb{R}\mapsto \mathbb{R}^n. \end{equation*} Here the \(n\)-dimensional Euclidean space \(\mathbb{R}^n\) is called the phase space of the system.

Remark (Conventions about notations)
  1. In the rest of the course, we use variables like \(x\) for both vector and scalar, and there is usually no confusion. For instance, \(x\) in the system \(\displaystyle \dot{x}= \begin{pmatrix}1 & -1 \cr -1 & 1\end{pmatrix}x\) is a column vector of length two, but \(x\) in the system \[ \dot{x} = x-y, \quad \dot{y} = -x+y \] is a scalar.
  2. Explicit time dependence is also omitted, that is, we write \(x\) instead of \(x(t)\), and similarly \(\dot{x}, \ddot{x}\) for the time derivatives \( \frac{\mathrm{d}}{\mathrm{d} t}x(t)\) and \(\frac{\mathrm{d}^2}{\mathrm{d} t^2}x(t)\).
  3. The solution to the system \(\dot{x} = f(x)\) is usually written as \(x\) or \(x(t)\), and sometime \(x(x_0,t)\) or \(\varphi_t(x_0)\), if the dependence on the initial condition \(x_0\) is emphasized.

There is no need to consider higher order equations, because they can always be converted into first order systems by introducing new variables for the derivatives, as in the following example.

Example 2.1 (Coupled first order equations) Take the simple harmonic oscillator, \begin{equation}\label{eq:harmonic} \ddot{x} + \omega^2 x = 0. \end{equation} This is a second order equation, and can be recast in the form of a system of equations by setting \({y}=\dot{x}\) (hence \(\dot{y}=\mathrm{d}ot{x}=- \omega^2 x\)). That is, we get the coupled first order equations \begin{equation*} \dot{x} = y, \qquad \dot{y} = - \omega^2 x \qquad \mbox{ or} \qquad \frac{\mathrm{d}~}{\mathrm{d} t} \begin{pmatrix} x \cr y \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ -\omega^2 & 0 \end{pmatrix} \begin{pmatrix} x \cr y \end{pmatrix}. \end{equation*} Note that this is an example of a linear system of differential equations, the general form of which is \begin{equation*} \dot{v} = A v.\qquad v\in\mathbb{R}^n \end{equation*} where \(A\) is a \(n \times n\) matrix (possibly time dependent).
Exercise. Change the fourth order equation \(\frac{\mathrm{d}^4}{\mathrm{d} t^4}x - \omega^4x=0\) describing the vibration of a beam into a system of first order equations, by introducing \(y=\dot{x}, z=\ddot{x}, w=\dddot{x}\). What does the coefficient matrix look like? How about the equivalent first order system for the \(n\)-th order autonomous ODE \[ x^{(n)} = F\big(x, x', \cdots , x^{(n-1)}\big), \] by introducing the variables \(x_k = x^{(k)}\), \(k=0, 1,2,\cdots,n-1\) for the \(k\)-th order derivatives.

We can always consider autonomous equations (with no explicit dependence on ``time''), because non-autonomous system like \(\dot{x} = f(x,t)\) can be converted into autonomous system by introducing a new independent variable \(\tau\) as "time", while taking \(t\) as dependent variable. That is, \(\dot{x}=f(x,t)\) is equivalent to \[ \frac{\mathrm{d}}{\mathrm{d}\tau} x = f(x,t),\quad \frac{\mathrm{d}}{\mathrm{d} \tau} t = 1, \] which is an autonomous system for \(\tilde{x} = (x,t)\) that depends on \(\tau\).

Example 2.2 (The simplest scalar linear equation) The differential equation \(\dot x=ax\) for \(x \in \mathbb{R}\) and with initial condition \( x(0) =x_0\) is simple but illustrates features of stability and instability to which we will return. If \(x_0=0\) then \(\dot x=0\) and so \(x(t)=0\) for all time (it is a stationary point). If \(x_0\ne 0\), it can be solved using separation of variables, that is, \begin{equation*} \int_{x_0}^x \frac{\mathrm{d} x}{x} = \int_0^t a \mathrm{d} t, \end{equation*} which gives \(x = x_0 e^{at}\). Alternatively, we can use the integrating factor \(e^{-at}\). Taking the derivative of \(e^{-at}x\), we get \[ \frac{\mathrm{d}}{\mathrm{d} t} (e^{-at} x) = -ae^{-at}x + e^{-at}\dot{x} =e^{-at}(\dot{x}-ax)=0. \] Therefore, \(e^{-at}x\) is a constant and equal its value at \(t=0\). That is \(e^{-at}x = x_0\), or \(x = e^{at}x_0\). The behaviour of solutions depends on the sign of \(a\) (the real part of \(a\) if it is complex): \begin{equation*} {\rm if}~a < 0 \mbox{ then }~|x(t) | \to 0;\qquad {\rm if}~ a > 0 \mbox{ then }~ |x(t) | \to \infty. \end{equation*}

A radioactive material contains unstable nuclei whose atomic nucleus loses energy and decays into another nuclide. Let \(N_A\) be the number~\footnote{This number is so large in practice that it can be treated as a continuous quantity to be differentiated.} of atoms in a sample, then \(N_A\) is usually governed by the ODE \[ \frac{\mathrm{d}}{\mathrm{d} t}N_A = -\lambda_A N_A \] where \(\lambda_A\) is the decay constant. The solution is \(N_A(t) = N_A(0)e^{-\lambda_A t}\). The time \(T_{1/2} = \frac{\ln 2}{\lambda_A}\) is called half-life, is the time taken for the radioactive substance to decay to half of the initial value, i.e., \(N_A(T_{1/2}) = N_A(0)/2\).

Example 2.3 (Chain of two radioactive decays) If one nuclide \(A\) decays into \(B\) by one process, and then \(B\) decays into \(C\) by a second process, then the amounts of \(A\) and \(B\) are governed by \[ \frac{\mathrm{d}}{\mathrm{d} t}N_A = -\lambda_A N_A,\qquad \frac{\mathrm{d}}{\mathrm{d} t}N_B = -\lambda_B N_B + \lambda_A N_A, \] with the initial condition \(N_B(0) = 0\) (no \(B\) at the very beginning). From the solution \(N_A(t) = N_A(0)e^{-\lambda_A t}\), the second equation becomes \[ \frac{\mathrm{d}}{\mathrm{d} t}N_B(t) = -\lambda_B N_B(t) + \lambda_A N_{A}(0)e^{-\lambda_A t}. \] If \(\lambda_B \neq \lambda_A\), then this ODE can be integrated with the integrating factor \(e^{\lambda_B t}\) to give \[ \lambda_B(t) = \frac{N_{A}(0)\lambda_A}{\lambda_B-\lambda_A} \big(e^{-\lambda_A t} - e^{-\lambda_B t}\big). \]
Exercise. Consider the same conditions as in the previous example. (1) Find the time \(T\) when \(N_B(t)\) reaches its maximum; (2) Find the solution when \(\lambda_B = \lambda_A\).
Example 2.4 (Linear matrix equations) The previous system can be written as \begin{equation}\label{eq:mateq} \dot{x} = Ax \end{equation} with \(x \in \mathbb{R}^n\), and where \(A\) is an \(n \times n\) constant matrix. Solutions can be written as \begin{equation}\label{linsol} x(t) = e^{tA} \; x_0 \end{equation} where the exponential matrix is defined by (exactly the same as in the scalar case) \begin{align*} e^B \; &= \; I + B + \frac{1}{2!} {B}^2 + \frac{1}{3!} {B}^3 + \dots = \sum_{n=0}^\infty \frac{1}{n!} {B}^n, \end{align*} where \(I\) is the identity matrix. With this definition of matrix exponential, the expression (3) is a solution to the linear matrix equation (2) can be proved by differentiating term by term. In practice, the matrix exponential \(e^B\) is not calculated from above series expansion, but by transforming $B$ into Jordan blocks, using eigenvectors of \(B\). If \(B = S\Lambda S^{-1}\), where the columns of \(S\) are the (generalised) eigenvalues of \(B\), and \(\Lambda\) consists of Jordan blocks: \[ \Lambda = \begin{pmatrix} \Lambda_1 & & &\cr & \Lambda_2 & & \cr & &\ddots & \cr & & & \Lambda_m \end{pmatrix},\qquad \Lambda_k = \begin{pmatrix} \lambda_k & 1 & & \cr & \lambda_k & 1 & \cr & & \ddots & \cr & & & \lambda_k \end{pmatrix}. \] Then \(e^B = Se^{\Lambda}S^{-1}\), while \(e^{\Lambda}\) can be computed easily. In general to find \(e^B\), it is easier to find the eigenvectors and eigenvalues (or equivalently the decomposition \(B=S\Lambda S^{-1}\)) than to calculate the series with powers \(B^n\) (but there are exceptions as in the following example).
Example 2.5 If \( A = \begin{pmatrix} 0 & -1 \cr 1& 0 \end{pmatrix}\), using the fact that \( A^{4n}=I, A^{4n+1} = A, A^{4n+2}=-I, A^{4n+3}=-A\) (\(n\) is an integer) and the above definition for matrix exponential, we get \[ \exp(tA) = \begin{pmatrix} \cos t & -\sin t \cr \sin t & \cos t \end{pmatrix}. \]
Exercise. What is \(\exp(tA)\) for \(A = \begin{pmatrix} 0 & 1 \cr 1 & 0 \end{pmatrix}\)?    
\( \exp(tA) = \begin{pmatrix} \cosh(t) & \sinh(t) \cr \sinh(t) & \cosh(t) \end{pmatrix} \)
Exercise. Let \( A = \begin{pmatrix} a & b \cr c & -a \end{pmatrix}\). (1) Show the matrix identity \( A^2 + \mbox{det}(A) I_2 = 0\), where \(I_2\) is the \(2\times2\) identity matrix; (2) Use this matrix identity to find \(\exp(tA)\), with \( \mbox{det}A = -a^2-bc <0\).    
\( \exp(tA) = \begin{pmatrix} \cosh(\lambda t)+ \frac{a\sinh(\lambda t)}{\lambda} & b\sinh(\lambda t)/\lambda \cr c\sinh(\lambda t)/\lambda & \cosh(\lambda t)-\frac{a\sinh(\lambda t)}{\lambda} \end{pmatrix},\qquad \lambda = \sqrt{a^2+bc} =\sqrt{-\mbox{det}(A)}\).

Review on different ways to solve differential equations:

  1. Linear ODEs with constant coefficients: \[ \frac{\mathrm{d}^n}{\mathrm{d} t^n}x(t)+a_{n-1} \frac{\mathrm{d}^{n-1}}{\mathrm{d} t^{n-1}}x(t)+\cdots + a_1\frac{\mathrm{d}}{\mathrm{d} t}x(t) + a_0x(t)=0. \] Looking for solution of the form \(x(t) = e^{\omega t}\), where \(\omega\) are the roots of the \(n\)-th degree polynomial \[ \omega^n + a_{n-1} \omega^{n-1}+a_1\omega+a_0=0. \]
  2. Linear first order scalar equation \(\dot{x} = a(t)x+b(t)\): Multiply both sides by the integrating factor \(\exp\left(-\int^t a(\tau)d\tau\right)\) to get \[ \frac{\mathrm{d}}{\mathrm{d} t} \left[ x\exp\left(-\int^t a(\tau)d\tau\right) \right] =\left[\dot{x} -a(t)x\right] \exp\left(-\int^t a(\tau)\mathrm{d}\tau\right) = b(t) \exp\left(-\int^t a(\tau)\mathrm{d}\tau\right). \] followed by integrating on both sides, \[ x(t)\exp\left(-\int^t a(\tau)\mathrm{d}\tau \right) = C + \int b(t)\exp\left(-\int^t a(\tau)\mathrm{d}\tau\right)\mathrm{d} t. \]
  3. Separable first order equation \(\dot{x} = f(x)g(t)\): Integrate \(\frac{\mathrm{d} x}{f(x)}=g(t)\mathrm{d} t\) to get \[ \int^{x} \frac{\mathrm{d} x}{f(x)} = \int^t g(t)\mathrm{d} t, \] where the integration constant is determined by the initial condition (if it is given).
  4. First order homogeneous ODEs \(\dot{x}=f(t,x)\), where \(f(\lambda x,\lambda t) = f(x,t)\) for any \(\lambda\): The trick is to introduce \(z=x/t\). Since \[ \frac{\mathrm{d} }{\mathrm{d} t} x = \frac{\mathrm{d} }{\mathrm{d} t} (zt) = z + t\frac{\mathrm{d} z}{\mathrm{d} t} \] and \(f(x,t)=f(zt,t)=f(z,1)\), the original ODE becomes \(z+t\dot{z} = f(z,1)\), which is separable, and the solution is given by \[ \int \frac{\mathrm{d} t}{t} = \int \frac{\mathrm{d} z}{f(z,1)-z}. \]

System of equations, especially nonlinear ones, are much more difficult to solve analytically, if not impossible. Nevertheless, we can still have a good understanding of the qualitative properties, using different techniques that will be developed in the rest of the course.