## The following exercise is about solving a second order differential equation using Laplace transform. This corresponds to a non homogeneous linear differential equation where the right hand side function is a sinusoid.

Consider the following differential equation:

y''-2y'+y=\sin(t)

with y(0)=y'(0)=0.

- Find the solution y(t) with the provided initial conditions

Let’s follow the steps described in this lesson.

## 1. Apply the Laplace transform

then, when \mathscr{L} is applied, we get

\begin{aligned} & \mathscr{L}\{y''-2y'+y\}=\mathscr{L}\{sin(t)\} \\ & \mathscr{L}\{y''\}-2\mathscr{L}\{y'\}+\mathscr{L}\{y\}=\mathscr{L}\{\sin(t)\} \end{aligned}

If \mathscr{L}\{y(t)\}=Y(s) and since b=1 in \sin(t) (check the table of common Laplace transforms), the differential equation above becomes

\begin{aligned} & s^{2}Y(s)-sy(0)-y'(0)-2(Y(s)-y(0))+Y(s)=\frac{1}{s^{2}+1^{2}} \\ & s^{2}Y(s)-s\cdot0-0-2(sY(s)-0)+Y(s)=\frac{1}{s^{2}+1} \\ & (s^{2}-2s+1)Y(s)=\frac{1}{s^{2}+1} \\ & (s-1)^{2}Y(s)=\frac{1}{s^{2}+1} \end{aligned}

and so

\displaystyle Y(s)=\frac{1}{s^{2}+1}\cdot\frac{1}{(s-1)^{2}}

## 2. Simplify and apply inverse Laplace transform

Note that Y(s) is written as a product of two expressions which we know their Laplace inverse transforms (check convolution lesson). In fact

\displaystyle\mathscr{L}^{-1}\left\{\frac{1}{s^{2}+1}\right\}=\sin(t)

and

\displaystyle\mathscr{L}^{-1}\left\{\frac{1}{(s-1)^{2}}\right\}=te^{t}

Hence, from Laplace transform of the convolution product

y(t)=\mathscr{L}^{-1}\{Y(s)\}=(\sin(t))\ast(te^{t})

Therefore

\displaystyle y(t)=\int_{0}^{t}\sin(t-\tau)\tau e^{\tau}d\tau

When we evaluate the integral above, we may conclude that

\displaystyle y(t)=\frac{1}{2}(-e^{t}+te^{t}+\cos(t))

We reached the end of this illustrative example, if you liked it, please share it with your friends!