# Preface

This tutorial was made solely for the purpose of education and it was designed for students taking Applied Math 0340. It is primarily for students who have some experience using Mathematica. If you have never used Mathematica before and would like to learn more of the basics for this computer algebra system, it is strongly recommended looking at the APMA 0330 tutorial. As a friendly reminder, don't forget to clear variables in use and/or the kernel. The Mathematica commands in this tutorial are all written in bold black font, while Mathematica output is in normal font.

Finally, you can copy and paste all commands into your Mathematica notebook, change the parameters, and run them because the tutorial is under the terms of the GNU General Public License (GPL). You, as the user, are free to use the scripts for your needs to learn the Mathematica program, and have the right to distribute this tutorial and refer to this tutorial as long as this tutorial is accredited appropriately. The tutorial accompanies the textbook Applied Differential Equations. The Primary Course by Vladimir Dobrushkin, CRC Press, 2015; http://www.crcpress.com/product/isbn/9781439851043

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340
Return to Part II of the course APMA0340
Introduction to Linear Algebra with Mathematica

# Second order systems of equations

Differential equations of arbitrary order with constant coefficients can be solved in straightforward matter by converting them into system of first order ODEs. However, they also can be solved directly, as we demonstrate shortly.

Consider a second order vector differential equation

$\ddot{\bf x} + {\bf A} \, {\bf x} = {\bf 0} ,$
subject to the initial conditions
${\bf x} (0) = {\bf d} \qquad\mbox{and} \qquad \dot{\bf x} (0) = {\bf v} ,$
where A is a n × n square matrix, d and v are initial displace ments and velocities, and x(t) is a column-vector of n unknown functions to be determined. Its solution
${\bf x}(t) = {\bf \Psi}(t)\,{\bf d} + {\bf \Phi}(t)\, {\bf v},$
is expressed through two fundamental matrices
${\bf \Psi}(t) = \cos \left( \sqrt{\bf A}\, t\right) \qquad\mbox{and} \qquad {\bf \Phi}(t) = \dfrac{\sin \left( \sqrt{\bf A} \,t \right)}{\sqrt{\bf A}},$
and d and v are initial displacements and velocities, that is, $${\bf x}(0) = {\bf d}$$ and $$\dot{\bf x}(0) = {\bf v} .$$ These two fundamental matrices are solutions of the same matrix differential equation of the second order $$\ddot{\bf P}(t) + {\bf A}\,{\bf P} = {\bf 0},$$ but distinct initial conditions:
$\ddot{\bf \Psi} + {\bf A} \, {\bf \Psi} = {\bf 0} , \quad {\bf \Psi}(0) = {\bf I}, \quad \dot{\bf \Psi}(0) = {\bf 0}, \qquad \mbox{and} \qquad \ddot{\bf \Phi} + {\bf A} \, {\bf \Phi} = {\bf 0} , \quad {\bf \Phi}(0) = {\bf 0}, \quad \dot{\bf \Phi}(0) = {\bf I}.$
It can verified by direct substitution that the solution $${\bf x}(t) = {\bf \Psi}(t)\,{\bf d} + {\bf \Phi}(t)\, {\bf v}$$ of the vector second order differential equation $$\ddot{\bf x} (t) + {\bf A} \, {\bf x} = {\bf 0}$$ satisfies the initial conditions:
${\bf x}(0) = {\bf d} \qquad\mbox{and} \qquad \dot{\bf x}(0) = {\bf v} .$
The above formula can be obtained using the Laplace transform. Indeed, application of the Laplace transformation, we reduce the given initial value problem to the algebraic equation:
$\lambda^2 {\bf x}^L - \dot{\bf x} (0) - \lambda \,{\bf x}(0) + {\bf A}\,{\bf x}^L = {\bf 0} ,$
where
${\bf x}^L = {\cal L} [{\bf x} ] = \int_0^{\infty} {\bf x}(t)\,e^{\lambda t} \, {\text d}t$
is the Laplace transform of the unknown vector function x(t). Solving the above linear algebraic equation, we obtain
${\bf x}^L = \left( \lambda^2 {\bf I} + {\bf A} \right)^{-1} \left[ \dot{\bf x} (0) + \lambda \,{\bf x}(0) \right] \qquad\Longrightarrow \qquad {\bf x}^L = \frac{\bf d}{\lambda^2 {\bf I} + {\bf A}} + \frac{\lambda {\bf v}}{\lambda^2 {\bf I} + {\bf A}} .$
Using well known formulas for the inverse Laplace transformations:
${\cal L}^{-1} \left[ \frac{1}{\lambda^2 {\bf I} + {\bf A}} \right] = \frac{\sin \left( \sqrt{\bf A}\,t \right)}{\sqrt{\bf A}} , \qquad {\cal L}^{-1} \left[ \frac{\lambda}{\lambda^2 {\bf I} + {\bf A}} \right] = \cos \left( \sqrt{\bf A}\,t \right) ,$
we arrive at the general solution formula.

This problem can also be solved by converting the given second order vector differential equation to the system of first order differential equations

$\dot{\bf y} = {\bf B}\,{\bf y} ,$
where $${\bf y}(t) = \langle {\bf x}, \dot{\bf x} \rangle$$ is 2n column vector of displacements and velocities, and B is a corresponding $$2n \times 2n$$ matrix:
${\bf B} = \begin{bmatrix} {\bf 0} & {\bf I} \\ - {\bf A} & {\bf 0} \end{bmatrix} ,$
where I is the identity n×n matrix. The characteristic polynomial for matrix B becomes
$\det \left( \lambda {\bf I} - {\bf B} \right) = \det \left( \lambda^4 {\bf I} - {\bf A} \right) .$
However, this approach is not optimal and requires more efforts, as it will be shown by examples.    ■

Nonhomogeneous second order systems of differential equation with constant coefficients can be solved in straightforward matter based on the Laplace transform. Indeed, consider the initial value problem:
$\ddot{\bf x} + {\bf B} \, \dot{\bf x} + {\bf A} \, {\bf x} = {\bf f}(t) , \qquad {\bf x}(0) = {\bf d} , \quad \dot{\bf x}(0) = {\bf v} .$
Application of the Laplace transform yields
$\lambda^2 {\bf x}^L + \lambda\,{\bf B}\,{\bf x}^L + {\bf A} \, {\bf x}^L = {\bf d} + \lambda {\bf v} + {\bf B}\,{\bf x}^L + {\bf f}^L .$
Therefore, the Laplace transform of the unknown function x(t) is expressed explicitly:
${\bf x}^L = \frac{{\bf d} + \lambda {\bf v} + {\bf B}}{\lambda^2 {\bf I} + \lambda \,{\bf B} + {\bf A}} + \frac{1}{\lambda^2 {\bf I} + \lambda \,{\bf B} + {\bf A}} \, {\bf f}^L ,$
where $${\bf f}^L = \int_0^{\infty} {\bf f}(t)\, e^{-\lambda t}\,{\text d}t$$ is the Laplace transform of the input function f. This allows us to determine the solution by apllying the inverse Laplace transform:
${\bf x} (t) = {\cal L}^{-1} \left[ \frac{{\bf d} + \lambda {\bf v} + {\bf B}}{\lambda^2 {\bf I} + \lambda \,{\bf B} + {\bf A}} \right] + {\cal L}^{-1} \left[ \frac{1}{\lambda^2 {\bf I} + \lambda \,{\bf B} + {\bf A}} \, {\bf f}^L \right] .$

(which means that all its eigenvalues are positive)

Example:

Example: Consider the initial value problem for the second order vector differential equation
$\ddot{\bf x} + {\bf A}\,{\bf x} = {\bf 0} , \qquad {\bf x}(0) = \begin{bmatrix} 1 \\ 2 \end{bmatrix} , \quad \dot{\bf x}(0) = \begin{bmatrix} -1 \\ -1 \end{bmatrix} ,$
where
$\left[ \begin{array}{cc} 16& -9 \\ -12 & 13 \end{array} \right] .$
First, we find its eigenvalues and eigenvectors:
A = {{16, -9}, {-12, 13}}
Eigensystem[A]
{{25, 4}, {{-1, 1}, {3, 4}}}
So the matrix A has two positive eigenvalues 4 and 25 (such matrices are called positive). ■

Example:

Example:

## Example 2.2.3:

Consider the second order vector differential equation $$\ddot{\bf x} + {\bf A}\,{\bf x} = {\bf 0} ,$$ where

${\bf A} = \left[ \begin{array}{cc} 1& 4 & 16 \\ 18& 20 & 4 \\ -12 & -14 & -7 \end{array} \right] .$

Return to Mathematica page

Return to the main page (APMA0340)
Return to the Part 1 Matrix Algebra
Return to the Part 2 Linear Systems of Ordinary Differential Equations
Return to the Part 3 Non-linear Systems of Ordinary Differential Equations
Return to the Part 4 Numerical Methods
Return to the Part 5 Fourier Series
Return to the Part 6 Partial Differential Equations
Return to the Part 7 Special Functions