# Preface

This section provides an introduction of applications of the Laplace transform for solving systems of ordinary differential equations (ODEs) with constant coefficients.

Introduction to Linear Algebra with Mathematica

# Laplace transform

The Laplace transfrom is an integral transformation that maps a function f(t) of a real variable t ∈ [0, ∞) into a number depending on parameter λ:
$$\label{EqLaplace.1} {\cal L} \left[ f(t) \right] (\lambda ) = f^L (\lambda ) = \int_0^{\infty} f(t)\, e^{-\lambda t} {\text d} t ,$$
subject that the integral converges. Since we are going to apply the Laplace transformation for solving differential equations, it will be always assumed that the unknown function and all its derivatived that appear in the differential equation possess convergent Laplace transforms. Since this topic was exployed previously in the first tutorial, we omit repeating properties of the Laplace transform and corresponding historical notes. A reader who needs to recollect more details about the Laplace transform, it recommended to return to the mentioned tutorial for the first course.

The main reason why the Laplace transform is a successful tool for solving differential equations is that it provides the spectral decomposition to the derivative operator, that is,

$$\label{EqLaplace.2} {\cal L} \left[ \texttt{D}f(t) \right] (\lambda ) = \lambda \,f^L (\lambda ) - f(+0) = \lambda\,{\cal L} \left[ f(t) \right] (\lambda ) - f(+0), \qquad \texttt{D} = \frac{\text d}{{\text d}t} ,$$
acting on the space of the smooth functions defined on the positive half-line ℝ+ = [0, ∞). Therefore, the Laplace transform works well for differential equations with constant coefficients, not neccessry written in normal form. The advantage of the Laplace transformation becomes clear when it is applied to inhomogeneous equations, especially with piecewise continuous input functions. We demonstrate its approach in numerous examples.

The reader should remember that the inverse Laplace transform is an ill-posed problem. However, in applications of the Laplace transformations to ordinary differential equations (ODEs), the inverse Laplace transform can be obtained using the residue theorem:

$$\label{EqLaplace.3} f(t) = {\cal L}^{-1} \left[ f^L (\lambda ) \right] (t ) = \sum_k \mbox{Res}_{\lambda_k} \, f^L (\lambda )\, e^{\lambda\,t} .$$
where summation is expanded over all singular points (poles) of the function fL.

Application of the Laplace transform for linear systems of first order differential equations in normal form is straight forward. Consider the initial value problem for the homogeneous equation:

$$\label{EqLaplace.4} \frac{\text d}{{\text d}t} \,{\bf x} = {\bf A}\,{\bf x}(t) , \qquad {\bf x}(0) = {\bf x}_0 ,$$
where A is a constant square matrix and x(t) is a column vector of unknown functions. Application of the Laplace transform to the IVP yields
$\lambda\,{\bf x}^L = {\bf A}\,{\bf x}^L + {\bf x}_0 \qquad \Longrightarrow \qquad {\bf x}^L = \left( \lambda\,{\bf I} - {\bf A} \right)^{-1} {\bf x}_0 = {\bf R}_{\lambda} ({\bf A})\, {\bf x}_0 ,$
where
${\bf R}_{\lambda} ({\bf A}) = \left( \lambda\,{\bf I} - {\bf A} \right)^{-1}$
is the resolvent of the matrix A. Applying the inverse Laplace transform, we obtain
${\bf x}(t) = {\cal L}^{-1} \left[ {\bf R}_{\lambda} ({\bf A}) \, {\bf x}_0 \right] = {\cal L}^{-1} \left[ \left( \lambda\,{\bf I} - {\bf A} \right)^{-1} \, {\bf x}_0 \right] = e^{{\bf A}\,t} {\bf x}_0 .$
So the resolvent of a square matrix is the Laplace transform of the exponential matrix. For further applications of the Laplace transformation, we recomemnd to visit two other sections: second order systems and spring-mass systems. The nonhomogeneous systems
$$\label{EqLaplace.5} \frac{\text d}{{\text d}t} \,{\bf x} = {\bf A}\,{\bf x}(t) + {\bf f}(t), \qquad {\bf x}(0) = {\bf x}_0 ,$$
can be solved similarly. Using the Laplace transform, we get
$\lambda\,{\bf x}^L = {\bf A}\,{\bf x}^L + {\bf x}_0 + {\bf f}^L \qquad \Longrightarrow \qquad {\bf x}^L = \left( \lambda\,{\bf I} - {\bf A} \right)^{-1} {\bf x}_0 + {\bf R}_{\lambda} ({\bf A})\, {\bf f}^L ,$
where fL is the Laplace transform of the forcing function. Again, application of the inverse Laplace transform yields the well-known formula for the required solution:
$$\label{EqLaplace.6} {\bf x} (t) = e^{{\bf A}\,t} {\bf x}_0 + \int_0^t e^{{\bf A}\,(t- \tau )} {\bf f}(\tau ) \,{\text d} \tau .$$
Example 1: Consider the planar system
$\begin{split} \dot{x} &= 3x(t) -2\,y(t) + e^{-t} \cos 3t , \\ \dot{y} &= 2\,x(t) - y(t) , \end{split} \qquad \begin{split} x(0) = -1 , \\ y(0) = \phantom{-}1 . \end{split} \tag{1.1}$
It is convenient to rewrite the given problem in vector form:
$\frac{\text d}{{\text d}t} \begin{bmatrix} x(t) \\ y(t) \end{bmatrix} = \begin{bmatrix} 3&-2 \\ 2&-1 \end{bmatrix} \begin{bmatrix} x(t) \\ y(t) \end{bmatrix} + \begin{bmatrix} e^{-t} \cos 3t \\ 0 \end{bmatrix} . \tag{1.2}$
So using the followiung notation
${\bf x} (t) = \begin{bmatrix} x(t) \\ y(t) \end{bmatrix} , \qquad {\bf A} = \begin{bmatrix} 3&-2 \\ 2&-1 \end{bmatrix} , \qquad {\bf f}(t) = \begin{bmatrix} e^{-t} \cos 3t \\ 0 \end{bmatrix} , \qquad {\bf x}_0 = \begin{bmatrix} -1 \\ \phantom{-}1 \end{bmatrix} ,$
we rewrite \Eq(1.2) in concise form:
$\dot{\bf x} (t) = {\bf A}\,{\bf x}(t) + {\bf f}(t) , \qquad {\bf x}(0) = {\bf x}_0 . \tag{1.3}$
Taking the Laplace transform of the system (1.3) gives
$\lambda \,{\bf x}^L = {\bf A}\,{\bf x}^L + {\bf x}_0 + {\bf f}^L ,$
where
${\bf x}^L = {\cal L} \left[ {\bf x}(t) \right] = \int_0^{\infty} e^{-\lambda t} {\bf x}(t) \,{\text d}t = \begin{bmatrix} x^L \\ y^L \end{bmatrix} , \qquad {\bf f}^L = \int_0^{\infty} e^{-\lambda t} {\bf f}(t) \,{\text d}t = \begin{bmatrix} \frac{1 + \lambda}{9 + (1+\lambda )^2} \\ 0 \end{bmatrix}$
LaplaceTransform[Exp[-t]*Cos[3*t], t, s]
(1 + s)/(9 + (1 + s)^2)
Since the resolvent of the matrix A is
${\bf R}_{\lambda} ({\bf A}) = \left( \lambda {\bf I} - {\bf A} \right)^{-1} = \frac{1}{(\lambda - 1)^2} \begin{bmatrix} 1 + \lambda & -2 \\ 2 & \lambda -3 \end{bmatrix} ,$
Inverse[s*IdentityMatrix[2] - {{3, -2}, {2, -1}}]
{{(1 + s)/(1 - 2 s + s^2), -(2/(1 - 2 s + s^2))}, {2/( 1 - 2 s + s^2), (-3 + s)/(1 - 2 s + s^2)}}
we get the Laplace transform of the solution to be
${\bf x}^L = \frac{1}{(\lambda - 1)^2} \begin{bmatrix} 1 + \lambda & -2 \\ 2 & \lambda -3 \end{bmatrix} \begin{bmatrix} -1 \\ \phantom{-}1 \end{bmatrix} + \frac{1}{(\lambda - 1)^2} \begin{bmatrix} 1 + \lambda & -2 \\ 2 & \lambda -3 \end{bmatrix} \frac{1}{9 + (1 + \lambda )^2} \begin{bmatrix} 1 + \lambda \\ 0 \end{bmatrix} .$
In other words,
${\bf x}^L = \frac{1}{(\lambda - 1)^2} \begin{bmatrix} -\lambda -3 \\ \lambda -5 \end{bmatrix} + \frac{1}{(\lambda - 1)^2}\cdot \frac{1}{9 + (1 + \lambda )^2} \begin{bmatrix} (\lambda + 1)^2 \\ 2(1+\lambda ) \end{bmatrix} . \tag{1.4}$
To find the solution, we just need to apply the inverse Laplace transform. First, we use Mathematica to determine components of the solution:
\begin{align*} {\cal L}^{-1} \left[ \frac{1}{(\lambda - 1)^2} \right] &= t\, e^t , \\ {\cal L}^{-1} \left[ \frac{\lambda}{(\lambda - 1)^2} \right] &= e^t \left( 1 - t \right) , \\ {\cal L}^{-1} \left[ \frac{\lambda +1}{(\lambda - 1)^2} \cdot \frac{1}{9 + (1 + \lambda )^2}\right] &= \frac{5 + 26t}{169}\,e^t - \frac{1}{169}\, e^{-t} \left[ 5\,\cos 3t + 12\,\sin 3t \right] , \\ {\cal L}^{-1} \left[ \frac{(\lambda +1)^2}{(\lambda - 1)^2} \cdot \frac{1}{9 + (1 + \lambda )^2}\right] &= \frac{4 \left( 9 - 13t \right)}{169}\, e^t + \frac{1}{169}\, e^{-t} \left[ 15\,\sin 3t - 36\,\cos 3t \right] . \end{align*}
InverseLaplaceTransform[1/(s - 1)^2, s, t]
E^t t
InverseLaplaceTransform[s/(s - 1)^2, s, t]
E^t (1 + t)
InverseLaplaceTransform[(s + 1)/(s - 1)^2/(9 + (1 + s)^2), s, t]
Simplify[ComplexExpand[%]]
1/169 E^-t (E^(2 t) (5 + 26 t) - 5 Cos[3 t] - 12 Sin[3 t])
InverseLaplaceTransform[(s + 1)^2/(s - 1)^2/(9 + (1 + s)^2), s, t]
Simplify[ComplexExpand[%]]
1/338 E^-t (8 E^(2 t) (9 + 13 t) - 72 Cos[3 t] + 30 Sin[3 t])
■
Example 2: We reconsider the previous differential equation, but now with discontinous input function:
$\begin{split} \dot{x} &= 3x(t) -2\,y(t) + \cos 3t \,H(t-\pi ), \\ \dot{y} &= 2\,x(t) - y(t) + (t-1)\left[ H(t-1) - H(t-2) \right] . \end{split}$
■
Example 3:    ■
Example 4:    ■
Example 5: Consider the initial value problem for system of differential equations
$\begin{split} \ddot{x} + 3\,x(t) - \dot{y}(t) &= \sin 2t\,H(t- \pi ) , \\ 8\dot{x} + \ddot{y} 3\,y(t) &= \left( t-2 \right) H(t-2) , \end{split} \qquad \begin{split} x(0) &= 0, \qquad \dot{x} (0) = 1 , \\ y(0) &= 0, \qquad \dot{y}(0) = -1 . \end{split} \tag{5.1}$
■

Homogeneous differential equations of arbitrary order with constant coefficients can be solved in straightforward matter by converting them into system of first order ODEs.

Example:

Example. Consider ODE of order 3:

# Second order systems of equations

$\begin{split} \ddot{x} - x(t) + 2\dot{y} &= 0 , \\ \dot{x} - x + 2\,\dot{y} + y &= 0. \end{split}$
$\begin{split} \ddot{x} - \dot{x}(t) + 2\dot{y} &= 0 , \\ -2\,\dot{x} + \ddot{y} - \dot{y} &= 0. \end{split}$
$\begin{split} \ddot{x} +2\, x(t) - \dot{y} - y &= t , \\ \ddot{y} + x + \dot{x} - x &= 1. \end{split}$