# The Laplace Transform: Solving Differential Equations

In this note we study how the Laplace transform can be used to solve differential equations. For now we only consider linear differential equations with constant coefficients. But later on we will see that the Laplace transform is also a powerful tool to solve linear differential equations with variable coefficients.

Example. Find the general solution of the differential equation
$$\ddot{X}(t)+k^2X(t)=0$$

Solution. Using the linearity transform the differential equation.

\label{eq:laplace10}
\mathcal{L}\{\ddot{X}(t)\}+k^2\mathcal{L}\{X(t)\}=0

By the transform of derivative formula
$$\mathcal{L}\{\ddot{X}(t)\}=s^2\mathcal{L}\{X(t)\}-sX(0)-\dot{X}(0)$$
Let $X(0)=A$ and $\dot{X}(0)=B$. Then \eqref{eq:laplace10} becomes an algebraic equation of $\mathcal{L}\{X(t)\}$
$$(s^2+k^2)\mathcal{L}\{X(t)\}-As-B=0$$
Thus
\begin{align*}
\mathcal{L}\{X(t)\}&=\frac{As+B}{s^2+k^2}\\
&=A\frac{s}{s^2+k^2}+\frac{B}{k}\frac{k}{s^2+k^2}
\end{align*}
Hence,
$$X(t)=A\cos kt+B’\sin kt$$
where $B’=\frac{B}{k}$.

Example. Find the solution of the initial value problem
$$\ddot{X}(t)-\dot{X}(t)-6X(t)=2$$
with $X(0)=1$ and $\dot{X}(0)=0$.

Solution. The transform of the differential equation, with the aid of the transform of derivative formula, is
$$[s^2\mathcal{L}\{X(t)\}-sX(0)-\dot{X}(0)]-[s\mathcal{L}\{X(t)\}-X(0)]-6\mathcal{L}\{X(t)\}=\frac{2}{s}$$
This simplifies to
\begin{align*}
(s^2-s-6)\mathcal{L}\{X(t)\}&=\frac{2}{s}+s-1\\
&=\frac{s^2-s+2}{s}
\end{align*}
So
\begin{align*}
\mathcal{L}\{X(t)\}&=\frac{s^2-s+2}{s(s^2-s-6)}\\
&=\frac{s^2-s+2}{s(s-3)(s+2)}\\
&=\frac{A}{s}+\frac{B}{s-3}+\frac{C}{s+2}
\end{align*}
This results in the equation
$$A(s-3)(s+2)+Bs(s+2)+Cs(s-3)=s^2-s+2$$
For $s=0$, we obtain $-6A=2$ i.e $A=-\frac{1}{3}$. For $s=3$, we obtain $15B=8$ i.e. $B=\frac{15}{8}$. For $s=-2$, we obtain $10C=8$ i.e $C=\frac{4}{5}$.
Hence,
$$\mathcal{L}\{X(t)\}=-\frac{1}{3}\frac{1}{s}+\frac{15}{8}\frac{1}{s-3}+\frac{4}{5}\frac{1}{s+2}$$
and therefore
$$X(t)=-\frac{1}{3}+\frac{15}{8}e^{3t}+\frac{4}{5}e^{-2t}$$

Example. Solve the problem
$$\dddot{X}(t)-2\ddot{X}(t)+5\dot{X}(t)=0$$
with $X(0)=0$, $\dot{X}(0)=1$, and $X\left(\frac{\pi}{8}\right)=1$.

Solution. The transformed equation, with the aid ofthe transform of derivative formula, is
\begin{align*}
[s^3\mathcal{L}\{X(t)\}-s^2X(0)-s\dot{X}(0)-\ddot{X}(0)]&-2[s^2\mathcal{L}\{X(t)\}-sX(0)-\dot{X}(0)]\\&
+5[s\mathcal{L}\{X(t)\}-X(0)]=0
\end{align*}
This simplifies, with the initial conditions $X(0)=0$ and $\dot{X}(0)=1$, to the equation
$$(s^3-2s^2+5s)\mathcal{L}\{X(t)\}-s+2-\ddot{X}(0)=0$$
Let $\ddot{X}(0)=C$. Then
\begin{align*}
\mathcal{L}\{X(t)\}&=\frac{C-2+s}{s^3-2s^2+5s}\\
&=\frac{C-2+s}{s(s^2-2s^+5)}\\
&=\frac{C-2+s}{s[(s-1)^2+4]}\\
&=\frac{C-2}{5}\left[\frac{1}{s}-\frac{s-1}{(s-1)^2+4}\right]+\frac{C+3}{10}\frac{2}{(s-1)^2+4}
\end{align*}
Hence
$$X(t)=\frac{C-2}{5}+e^t\left(\frac{C+3}{10}\sin 2t-\frac{C-2}{5}\cos 2t\right)$$
The condition $X\left(\frac{\pi}{8}\right)=1$ results in the equation
$$1=\frac{C-2}{5}+\frac{e^{\frac{\pi}{8}}}{10\sqrt{2}}(-C+7)$$ whose solution is $C=7$. Therefore,
$$X(t)=1+e^t(\sin 2t-\cos 2t)$$