# Laplace transform

## Solving differential equation by the Laplace transform

We are going to solve differential equation in the form

\begin{align} \color{red}{y'' + a_1y' + a_0y} &\color{red}{= g(t)} \nonumber \\ \color{red}{y(0)} &\color{red}{= y_0},\hskip2em \nonumber \\ \color{red}{y'(0)} &\color{red}{= y'_0}. \label{ref:lapl_DE2} \nonumber \end{align}

First, some important observations of above:

• The Laplace transform is intended for solving linear DE: linear DE are transformed into algebraic ones. If the given problem is nonlinear, it has to be converted into linear. Or other method have to be used instead (e.g. numerical method).
• The Laplace solves DE from time $t=0$ to infinity. I.e. initial values at $t=0$, where the problem starts, are part of the problem and have to be given. If there are no initial values, we have to work with generic constants/symbols ($y_0,\ y'_0$).
• The strength of the method is that function $\boldsymbol g(x)$ on the right side can be piecewise defined, periodic or impulsive.

### How the method works

We are looking for $y(t)$ as a solution of differential equation. Because of convention used, such function is $Y(s)$ when transformed by Laplace.

1. Laplace transform
This step is relatively easy.
2. Algebraic equation in $Y(s)$
That means equation is being solved in the domain of $Y(s)$, where it is easy to solve. Result is $Y(s)=p(s)/q(s)$ where $p(s),\ q(s)$ are polynomials. $Y(s)$ is the Laplace transform of solution.
3. Inverse transform
Inverse Laplace transform is the hardest part.

If we want to apply the Laplace method, we have to be able to transform each member of DE. That means, we have to know also how to deal with $y',\ y''$.

$$$${\scr L}\left[f'(t)\right] = \int_0^{\infty} e^{-st}f'(t)\ dt \label{ref:lapl_mainDE}$$$$

So let us integrate. There are two functions multiplied, therefore we have to integrate by parts (use the product rule backwards). When using product rule, we want $f'(t)$ to integrate (there would be no outcome if we choose $f'(t)$ to differentiate, you can try yourself), so $e^{-st}$ has to be differentiated.

\begin{align} (uv)' &= u'v + uv' \implies u'v = (uv)' - uv' \implies \nonumber \\ \int u'v &= uv - \int uv'\label{ref:lapl_subst1} \\ v' &= f'(t), \hskip2em u = e^{-st} \nonumber \end{align}

Product rule has been reviewed and $u,\ v$ have been identified. Now we can enter $u,\ v'$ into $(\ref{ref:lapl_subst1})$ in order to resolve $(\ref{ref:lapl_mainDE})$:

\begin{align} {\scr L}\left[f'(t)\right] &= \left. e^{-st}f(t) \right|_{t=0}^{\infty} - \int_{t=0}^{\infty}-se^{-st}f(t)\ dt = (0 - f(0)) + sF(s) \implies \nonumber \\ \implies {{\scr L}\left[f'(t)\right]} &= {sF(s) - f(0)} \label{ref:laplac_der1} \end{align}

The Riemann integral has been evaluated with boundaries for $t$, so the variable $t$ has served to find Laplace transform $F(s)$ of $f'(t)$.

Since we are going to solve 2nd order DE, it is essential to find also Laplace transform of $f''(t)$. The equation $(\ref{ref:laplac_der1})$ can be written as ${{\scr L}\left[f'(t)\right]} = {s\color{blue}{{\scr L}[f(t)]} - f(0)}$. And then what works for $f'(t)$ works also for $f''(t)$:

\begin{align} {\scr L} \left[f''(t)\right] &= s {\scr L}[f'(t)] - f'(0) = s\left[sF(s)-f(0)\right] - f'(0)\implies \nonumber \\ \implies {{\scr L} \left[f''(t)\right]} &= { s^2F(s)-sf(0) -f'(0)} \label{ref:laplac_der2} \end{align}

These important equations $(\ref{ref:laplac_der1})$ and $(\ref{ref:laplac_der2})$ can be sumarized into:

$$\begin{array}{lll} \color{red}{ {\scr L}\left[y\right] } &{}\color{red}{=}{}&\color{red}{ Y} \\ \color{red}{{\scr L}\left[y'\right] } &{}\color{red}{=}{}&\color{red}{ sY - y(0) } \\ \color{red}{{\scr L}\left[y''\right]} &{}\color{red}{=}{}&\color{red}{ s^2Y - sy(0) -y'(0) }\\ \end{array}$$

#### Example

Show the Laplace transform of DE $y'' -y = e^{-t},\ y(0)=1,\ y'(0)=0$.

$$s^2 Y -s - Y = \frac{1}{s+1}$$

Note: $Y= Y(s)$ is Laplace transform of $y(t)$.

## Shifting theorems

There are two shifting theorems to deal with.

1. The first shifting theorem ($f(t)$ is multiplied by $e^{at}$)
If $f(t)$ is multiplied by $e^{at}$, then ${\scr L}[f(t)e^{at}] = F(s-a)$.
2. The second shifting theorem talks about shifting the $t$ axis.
1. We want to shift the function to $t=a$. If $F(s) = {\scr L}[f(t)]$ then $$u_a(t)\ f(t-a) = e^{-as}F(s).$$
2. We want to erase part of the function. Then $$u_a(t)\ f(t) = e^{-as}{\scr L}[f(t+a)].$$
The function $u_a(t)$ above is a unit step function at $t=a$ and the shifting theorem is useful when working with piecewise continuous functions.

### The first shifting theorem

Sometimes the given function $f(t)$ might be multiplied by $e^{at}$. If $F(s)$ is known, then we can evaluate ${\scr L}[e^{et}f(t)]$ without integrating, which is very helpful. See also the example from the previous chapter.

$${\scr L}[e^{at}\cdot f(t)] = F(s-a) \hskip2em \text{if} \hskip2em {\scr L}[f(t)] = F(s).$$

Example: ${\scr L}[1] = 1 /s \implies {\scr L}[e^{at}] = 1/ {(s-a)}$.

Example: ${\scr L}[\cos kt] = s /(s^2 + k^2) \implies {\scr L}[\cos kt \cdot e^{at}] = ((s-a)/ {(s-a)^2 + k^2})$.

### Piecewise continuous functions

One of the important property of Laplace transform is that we can wipe out the value of a function outside an interval $ab$.

For that reason we define unit step function and unit box function.

Unit step function $u(t),\ u(t-a)$ and unit box function $u_{ab}$. Please realize, that if we place unit step function $u_a$ into $a$ and add other unit step function $-1\cdot u_b$ into $b$ then the sum of these graphs will be depicted as a box function $u_{ab}$.

Unit step function $u(t)$ in its basic form is defined as either 0 or 1 (hence unit):

u(t) = \left\{ \begin{aligned} &0 \hskip2em t \lt 0 \\ &1 \hskip2em 0\lt t \lt \infty \\ \end{aligned} \right. \label{ref:lapl_unit_step}

So the value of that function is either zero or one, depends whether we look to the left or the right from the vertical axis. Any function $f(t)$ can be multiplied by $u(t)$. Then the left branch of the graph will be wiped out while the right branch is left untouched.

Things usually go more complicated and one might need the step not in zero. Then unit step function is $u(t-a)$ (or $u_a$). Again, we usually need such function to multiply other function $f(t)$.

Unit box function is a combination of two unit step functions. Let us say first we have positive jump in $a$ and then a negative jump in $b$.

$$u_{ab} = u_a(t) - u_b(t) = u(t-a) - u(t-b)$$

#### The second shifting theorem

Now arrives the need to operate with unit step functions. These unit functions are somehow non-standard so we need some rules for handling them properly. If we want to shift the $t$ axis of a function, then we move the function to $a$. Then instead of $t$ we have $(t-a)$ (what was at zero, now is at $a$). We have also to multiply such function by $u(t-a)$ to erase whatever would be considered before $t=0$. Remember that Laplace starts at time is zero and the past can not be recovered, so it has to be set to zero. Then

$$$$\color{red}{{\scr L}[u_a(t)f(t-a)] = e^{-as}F(s)}. \label{ref:lapl_3} \\$$$$

To erase branch of the given function until $\boldsymbol{t=a}$: we multiply the function by unit step function $u_a(t)$ and evaluate its transform by the rule

$$$$\color{red}{{\scr L}[u_a(t)f(t)] = e^{-as}{\scr L}[f(t+a)]} \label{ref:lapl_4}.$$$$

The member $e^{-as}$ "remembers" the shift of $t$ axis. The rules $(\ref{ref:lapl_3})$ and $(\ref{ref:lapl_4})$ can be derived from the integral–definition of Laplace transform.

#### Example

Show the Laplace transform of unit box $u_{ab}$

$$u_{ab} = u(t-a) - u(t-b) \\ {\scr L}\left[u(t-a)\right] = e^{-as}\frac 1 s \\ {\scr L}\left[u(t-b)\right] = e^{-bs}\frac 1 s\\ \underline{\underline{{\scr L}\left[u_{ab}\right] = \frac{e^{-as}}{s} - \frac{e^{-bs}}{s}}}\\$$

#### Example

Show the Laplace transform of $t^2$ when the function until $t=1$ is required to be erased to zero.

We have to erase whatever would be before $t=1$, i.e. the function $f(t)$ have to be multiplied by unit step function with the jump from 0 to 1 at $a=1$: $u_a(t) = u(t-1)$. In order to multiply we have to employ the rule $(\ref{ref:lapl_4})$ for multiplication of the function with function of the type unit step.

$${\scr L}\left[u(t-1)\ t^2\right] = e^{-as}{\scr L}\left[(t+1)^2\right] = e^{-as}{\scr L}\left[t^2 + 2t + 1\right] = \underline{\underline{e^{-s}\left(\frac {2}{s^3} + \frac{2}{s^2} + \frac{1}{s}\right) }}$$

#### Example

Describe function depicted on graph by unit step functions and find its Laplace transform.

1. At $t=0$ the function looks like the very basic unit step function $(\ref{ref:lapl_unit_step})$. But unit function knows only about $0$ and $1$, here we have $f(t)=2$. That means we have to use $2u(t)$.
2. Then in time $t=2$ its value changes from $2$ to $-1$ (i.e. $3$ down at $t=2$) which means we have to add $-3u(t-2)$.
3. Finally the value at $t=3$ jumps $1$ higher, which brings member $u(t-3)$.
$$f(t) = 2u(t) - 3u(t-2) + u(t-3)$$

So far we collected unit step functions to express function from the graph. Now we have to use the rule $(\ref{ref:lapl_3})$ to evaluate their Laplace transform.

\begin{align} {\scr L}\left[f(t)\right] &= {\scr L}\left[2u(t)\right] - {\scr L}\left[3u(t-2)\right] + {\scr L}\left[u(t-3)\right] = \nonumber \\ &= \underline{\underline{\frac 2 s -3e^{-2s}\frac 1 s +e^{-3s}\frac 1 s}} \nonumber \end{align}

#### Example

Find $f(t)$ if $F(s) = e^{-2s}/(s^2+1)$.

We are given result in the domain $s$ and we have to use inverse Laplace transform. Since member $\boldsymbol{e^{-2s}}$ is present, it is known that either a shift or intervals are involved. In this case it can be identified that the shift was made to $a=2$. The other member $1/(s^2 + 1)$ is—according to the table of transforms—the product of $\sin kt$ when $k=1$.

So we have

$$\underline{\underline{f(t) = u(t-2) \sin(t-2)}} \hskip2em \text{or} \hskip2em \underline{\underline{f(t)=u_2(t) \sin(t-2)}}.$$

It is $\sin()$ moved on $t$ axis from zero to $1$ and in such case the unit step function has to be involved to erase whatever was before the beginning.

#### Example

Find $f(t)$ if

$$F(s) = \frac{1+e^{-\pi s}}{s^2+1}$$

We are given result in the domain $s$ and we have to use inverse Laplace transform. Since member $\boldsymbol{e^{-\pi s}}$ is present, it is known that either a shift or interval is involved. In this case it can be identified that the shift was made to $a=\pi$. Now let us split the fraction into two and solve them separately.

$$F(s) = \frac{1}{s^2+1} + \frac{e^{-\pi s}}{s^2+1}$$

It comes from observation and from the table of transform that the first fraction is a product of $\sin kt$ when $k=1$.

The second fraction involves shift to $a=\pi$ and $\sin()$ as well. You will find that the second fraction corresponds to $f(t) = u(t-\pi)\sin(t-\pi)$.

So we have piecewise function, let us combine both members together.

$$f(t) = \sin t + u_{\pi}(t)\sin(t-\pi)$$

What we see is that the first part $(\sin t)$ is valid for the whole interval, while the second part is erased by $u_{\pi}$ for $t \lt \pi$ and for $t\geq \pi:\ \sin(t-\pi)$ comes into life.

We have enough information to transform $f(t)$ into the case form:

f(t) = \left\{ \begin{aligned} \sin t &\hskip2em 0\leq t\lt \pi \\ \sin t + 1\cdot \sin(t-\pi) &\hskip2em t \geq \pi \end{aligned} \right.

The second case deserves a note: it starts with $\sin t$ because this member is valid from $t\gt 0$. The number $1$ is value of $u_{\pi}(t)$ when $t\geq \pi$, because that is the purpose of the unit step function (to be one or zero). Finally $\sin(t-\pi)$ is taken.

Now you can read from graph of $\sin()$ that $\sin(t) = -\sin(t-\pi)$. The consequence is that in the second case both sines cancel each other:

f(t) = \left\{ \begin{aligned} \sin t &\hskip2em 0\leq t\lt \pi \\ 0 &\hskip2em t \geq \pi \end{aligned} \right.

And that is the final answer.

#### Example

Solve DE $y''+y =t$ with initial values $y(\pi) = 0,\ y'(\pi) = 0$

There is an inconvenience that the inital values are described at $t=\pi$ but we expect them at $t=0$. We will convert DE into other DE which has origin at $\pi$:

$$$$w'' + w = t+ \pi,\hskip2em w(0) = 0,\ w'(0) = 0 \label{ref:lapla_ex_move}$$$$

We have moved with the origin of $t$ axis to $\pi$, so the nonhomogenous term of new DE $(\ref{ref:lapla_ex_move})$ has to have value of $t+\pi$. You can check that now at $t=0$ within $w$ everything behaves like at $t=\pi$ within $y$. We used substitution $\boldsymbol{w(t) = y(t+\pi)}$. Now the DE is ready to be transformed and solved:

\begin{align} (s^2 W - s\cdot 0 - 0) + (s\cdot 0 - 0) + W &= \frac{1}{s^2} + \frac{\pi}{s} \nonumber \\ W(s^2 + 1) &= \frac{1}{s^2} + \frac{\pi}{s} \nonumber \\ W &= \left(\frac{1}{s^2} + \frac{\pi}{s}\right) \frac{1}{s^2+1} \nonumber \\ W &= \frac{1+\pi s}{s^2(s^2+1)} \nonumber \end{align}

We have Laplace transform of solution $w(t)$. The inverse transform of $W(s)$ is made in example solved before.

\begin{align} w(t) &= \pi + t - \pi \cos t - \sin t \nonumber \\ \underline{\underline{y(t)}} &= \pi + (t-\pi) -\pi \cos(t-\pi) - \sin(t-\pi) = \underline{\underline{t + \pi \cos t+ \sin t}} \nonumber \end{align}

#### Example

Solve DE $\color{red}{y''}\color{blue}{-5y'}+\color{green}{6y} = e^t(2t-3)$ with initial values $y(0) = 1,\ y'(0) = -1$

We have to transform each term to obtain equation in domain of $Y(s)$, where it is easy to solve. We will use $(\ref{ref:laplac_der1}),\ (\ref{ref:laplac_der2})$ and table of transforms of basic functions (for the nonhomogenous members on the right side of DE).

\begin{align} \color{red}{s^2Y - s - (-1)} \color{blue}{-5(sY-1)} + \color{green}{6Y} &= 2\frac{1}{(s-1)^2} - 3\frac{1}{s-1} \nonumber \\ s^2Y -s +1 -5sY + 5 + 6Y &= 2\frac{1}{(s-1)^2} - 3\frac{1}{s-1} \nonumber \\ Y(s^2-5s+6) &= 2\frac{1}{(s-1)^2} - 3\frac{1}{s-1} - 6 + s \nonumber \\ Y &= \frac{2-3(s-1) -6(s-1)^2 + s(s-1)^2}{(s-1)^2}\cdot \frac{1}{s^2-5s+6} \nonumber \\ Y &= \frac{2-3s+3-6(s^2-2s+1) + s(s^2-2s+1)}{(s-1)^2(s-2)(s-3)} \nonumber \\ Y &= \frac{5-3s-6s^2+12s-6+s^3-2s^2+s}{(s-1)^2(s-2)(s-3)} \nonumber \\ Y &= \frac{-1+10s-8s^2+s^3}{(s-1)^2(s-2)(s-3)} \nonumber \\ \end{align}

That was basic algebra in $s$ domain. We have to continue with decomposition into partial fractions.

\begin{align} \frac{A}{s-1} + \frac{B}{(s-1)^2} + \frac{C}{s-2} + \frac{D}{s-3} &= \frac{-1+10s-8s^2+s^3}{(s-1)^2(s-2)(s-3)} \nonumber \\[2mm] A(s-1)(s-2)(s-3) + B(s-2)(s-3) + &\nonumber \\ + C(s-3)(s-1)^2 + D(s-2)(s-1)^2 &= -1 + 10s -8s^2 +s^3 \nonumber \\[2mm] A(s^3-6s^2+11s-6) + B(s^2-5s+6) + & \nonumber \\ +C(s^3-5s^2+7s-3) + D(s^3-4s^2+5s-2) &=-1 + 10s -8s^2 +s^3 \nonumber \\[2mm] s^3(A+C+D) + s^2(-6A+B-5C-4D)+ &\nonumber \\ + s(11A-5B+7C+5D) + (-6A+6B-3C-2D) &= -1 + 10s -8s^2+s^3 \nonumber \\ \end{align}

When system of 4 linear equations is solved we have three fractions, each of them represents one term of solution of DE.

\left. \begin{aligned} A+C+D &= 1 \\ -6A+B-5C-4D &= -8 \\ 11A-5B+7C+5D&=10 \\ -6A + 6B -3C-2D&=-1 \end{aligned} \right\} \hskip2em \left. \begin{aligned} A&=0 \\ B&=1 \\ C&=5\\ D&=-4 \end{aligned} \right. \\ Y(s) = \frac{1}{(s-1)^2} + \frac{5}{s-2} - \frac{4}{s-3} \\ \underline{\underline{y(t) = e^{-t}t + 5e^{-2t} -4e^{-3t}}}

#### Example

Solve DE $y''+y' = \pi$ with initial values $y(0) = \pi,\ y'(0) = 0$

We have to transform each term to obtain equation in domain of $Y(s)$, where it is easy to solve. We will use $(\ref{ref:laplac_der1}),\ (\ref{ref:laplac_der2})$ and table of transforms of basic functions (for the nonhomogenous members on the right side of DE).

\begin{align} (s^2Y -s\pi -0) +(sY-\pi) &= \pi\frac1 s \nonumber \\ s^2Y - s\pi +sY -\pi &= \frac{\pi}{s} \nonumber \\ Y(s^2+s) &= \frac{\pi}{s} + \pi +s\pi \nonumber \\ Y &= \frac{\pi+\pi s + s^2\pi}{s(s^2+s)} \nonumber \\ Y &= \frac{\pi (1+s+s^2)}{s\cdot s (s+1)} \nonumber \\ \end{align}

The fraction is too difficult for inverse transform. We have to split it into pieces by means of decomposition to partial fractions.

\begin{align} \frac{\pi(1+s+s^2)}{s\cdot s (s+1)} &= \frac{A}{s} + \frac{B}{s^2} + \frac{C}{s+1} \nonumber \\ \pi(1+s+s^2) &= A(s)(s+1) + B(s+1) + Cs^2 \nonumber \\ \pi + \pi s + \pi s^2 &= As^2 +As +Bs +B + Cs^2 \nonumber \\ \pi + \pi s + \pi s^2 &= s^2 (A+C) + s(A+B) +1(B) \implies \nonumber \\ \implies A&=0,\ B=\pi,\ C=\pi \nonumber \\ \end{align}

The solution is splitted into simple fractions:

$$Y(s) = \frac{\pi}{s^2}+\frac{\pi}{s+1}$$

The first fraction is Laplace transform of $\pi t$, the second fraction can be identified as a Laplace transform of $\pi e^{-t}$.

$$\underline{\underline{y(t) = \pi t + \pi e^{-t}}}$$

#### Example

Solve DE $y''+y' = e^t$ with initial values $y(0) = 1,\ y'(0) = 0$

We have to transform each term to obtain equation in domain of $Y(s)$, where it is easy to solve. We will use $(\ref{ref:laplac_der1}),\ (\ref{ref:laplac_der2})$ and table of transforms of basic functions (for the nonhomogenous members on the right side of DE).

\begin{align} (s^2Y -s -0) +(sY-1) &= \frac1 {s-1} \nonumber \\ s^2Y - s +sY - 1&= \frac{1}{s-1} \nonumber \\ Y(s^2+s) &= \frac{1}{s-1} + 1 + s\nonumber \\ Y &= \frac{1+(s-1)+s(s-1)}{(s-1)(s^2+s)} \nonumber \\ Y &= \frac{\color{silver}{1+s-1+}s^2\color{silver}{-s}}{(s-1)s(1+s)} \nonumber \\ \end{align}

The fraction is too difficult for inverse transform. We have to split it into pieces by means of decomposition to partial fractions.

\begin{align} \frac{s^2}{(s-1)s(1+s)} &= \frac{A}{s-1} + \frac{B}{s} + \frac{C}{s+1} \nonumber \\ s^2 &= A(s)(s+1) + B(s-1)(s+1) + C(s-1)(s)\nonumber \\ s^2 &= As^2 +As +Bs +Bs^2-B + Cs^2 -Cs\nonumber \\ s^2 &= s^2 (A+B+C) + s(A-C) -1(B) \implies \nonumber \\ \implies A&=1/2,\ B=0,\ C=1/2 \nonumber \\ \end{align}

The solution is splitted into simple fractions:

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

The first fraction is Laplace transform of $e^{-t}$, the second fraction can be identified as a Laplace transform of $e^{t}$.

$$\underline{\underline{y(t) = \frac 1 2 e^{-t} + \frac 1 2 e^{t}}}$$

#### Example

Solve DE $y''-y = \sin t$ with initial values $y(0) = -1,\ y'(0) = 0$

We have to transform each term to obtain equation in domain of $Y(s)$, where it is easy to solve. We will use $(\ref{ref:laplac_der1}),\ (\ref{ref:laplac_der2})$ and table of transforms of basic functions (for the nonhomogenous members on the right side of DE).

\begin{align} (s^2Y+s-0)-(Y) &= \frac{1}{s^2+1} \nonumber \\ s^2Y - Y &= \frac{1}{s^2+1} - s \nonumber \\ Y(s^2-1) &= \frac{1-s^3-s}{s^2+1} \nonumber \\ Y &= \frac{1-s^3-s}{(s^2+1)(s-1)(s+1)} \nonumber \\ \end{align}

Such fraction is too difficult for inverse transform. We have to split it into pieces by means of decomposition to partial fractions.

\begin{align} \frac{1-s^3 -s}{(s^2+1)(s-1)(s+1)} &= \frac{As+B}{s^2+1} + \frac{C}{s-1} + \frac{D}{s+1} \nonumber \\ \end{align}

Let us multiply both sides by $(s^2+1)(s-1)(s+1)$:

\begin{align} 1-s^3-s &= (As+B)(s-1)(s+1) + C(s^2+1)(s+1) + D(s^2+1)(s-1) \nonumber \\ 1-s^3-s &= As^3 +Bs^2-As-B+Cs^3+Cs^2+Cs + C +Ds^3 -Ds2 +Ds -D \nonumber \\ 1-s^3-s &= s^3(A+C+D) + s^2(B+C-D) + s(-A+C+D) +1(-B+C-D) \nonumber \\ \end{align}

We are employing method of undetermined coefficients to find values $A,\ B,\ C,\ D$. That means there is a system of linear equations (the first one is $-1 = A + C+ D$) which is not shown and solved in here. Once the system is solved, the results are

\begin{align} A&=0,\ B=-\frac 1 2,\ C= -\frac 1 4 ,\ D=-\frac 3 4 \implies \nonumber \\ \implies Y(s)&= -\frac 1 2 \cdot \frac 1 {s^2+1} - \frac 1 4 \cdot \frac{1}{s-1} - \frac 3 4 \frac 1 {s+1} \nonumber \\ \end{align}

We can use table of transforms of basic function to identify that the first fraction is transform of $\sin t$, the second $e^{-t}$ and the last one is $e^t$.

$$\underline{\underline{ y(t) = -\frac 1 2 \sin t - \frac 1 4 e^{-t} - \frac 3 4 e^{t} }}$$

#### Example

Solve the system of DE

\begin{align} \frac{dx}{dt} &= y \nonumber \\ \frac{dy}{dt} &=-x + 2y \nonumber \end{align}

No initial values are given, we have to provide arbitrary values $x(0) = x_0,\ y(0)=y_0$. First we transform both equations by Laplace and then we solve in domain $s$.

\begin{align} (sX - x_0) &= Y \label{ref:lapl_set1}\\ (sY-y_0) &= -X + 2Y \label{ref:lapl_set2} \end{align}

From $(\ref{ref:lapl_set1})$ we can express $X$ and substitute into $(\ref{ref:lapl_set2})$.

\begin{align} X &= (Y+x_0) / s \nonumber \\ (sY + y_0) &= -\left( \frac{Y+x_0}{s}\right) + 2Y \nonumber \\ sY - y_0 &= -\frac{Y}{s} - \frac{x_0}{s} + 2Y \nonumber \\ sY+ \frac Y s - 2Y &= y_0 - \frac{x_0}{s} \nonumber \\ Y(s+\frac 1 s -2) &= \frac{y_0s-x_0}{s} \nonumber \\ Y(s^2 + 1 -2s) &= y_0s - x_0\nonumber \\ Y &= \frac{y_0 s - x_0}{(s-1)^2} = \frac{A}{s-1} + \frac{B}{(s-1)^2} \label{ref:lapl_set3} \\ y_0s-x_0 &= A(s-1) + B \nonumber \\ y_0s-x_0 &= As -A+ B \nonumber \\ y_0s-x_0 &= s(A) + 1( -A+ B) \implies \nonumber\\ \implies A &= y_0,\ B = -x_0+y_0 \nonumber \\ Y &= \frac{y_0}{s-1} + \frac{-x_0+y_0}{(s-1)^2} \nonumber \\ \end{align}

The method of undetermined coefficients was used to find $A,\ B$. The solution $y(t)$ is inverse transform of $Y(s)$:

$$\underline{\underline{y(t) = e^ty_0 + te^t(y_0-x_0)}}.$$

There are more ways how to find $x(t)$. This time $(\ref{ref:lapl_set3})$ is substituted into $(\ref{ref:lapl_set1})$:

\begin{align} sX-x_0 &= \frac{y_0s-x_0}{(s-1)^2} \nonumber \\ sX &= \frac{y_0s-x_0}{(s-1)^2} + x_0 \frac{s^2-2s+1}{(s-1)^2} \nonumber \\ sX &= \frac{y_0s -x_0 +x_0s^2 -x_0\cdot2s + x_0}{(s-1)^2} \nonumber \\ sX &= \frac{y_0s +x_0s^2 -x_0\cdot2s}{(s-1)^2} \nonumber \\ X &= \frac{y_0 +x_0s -2x_0}{(s-1)^2} = \frac{A}{s-1} + \frac{B}{(s-1)^2}\nonumber \\ y_0+x_0s-2x_0 &= A(s-1)+B \nonumber \\ y_0+x_0s-2x_0 &= As - A+B \nonumber \\ y_0+x_0s-2x_0 &= s(A) + 1( - A+B) \nonumber \implies \\ \implies A &=x_0,\ B=y_0-x_0 \nonumber \end{align}

Again the complicated fraction was decomposited into two simpler fractions, method of undetermined coefficients was used to determine $A,\ B$.

$$\underline{\underline{x(t) = e^tx_0 +te^t (y_0-x_0)}}$$

#### Example

Derive the system of differential equations describing the motion of two masses according to the picture. Use Laplace transform to solve if $k_1 = k_2 = k_3 = 1,\ m_1 = m_2 = 1$ and initial values $y_1(0) = 0,\ y_1'(0) = -1,\ y_2(0) = 0,\ y_2'(0) =1$.

The initial conditions say that both bodies are at their equilibrium point and have initial speed.

We can borrow general description of spring motion from chapter modeling: $M\ddot{u} + C\dot{u} + Ku = f$. In this example is no dumping involved, no external force. We are used to use variable $y$ instead of $u$.

\begin{align} my'' + ky &= 0 \nonumber \hskip2em \text{(general form)}\\ m_1y_1'' +k_1y_1 + k_2(y_1-y_2) &= 0 \nonumber \\ m_2y_2'' + k_2(y_2-y_1)+k_3y_2 &= 0 \nonumber \\ \end{align}

When the masses and spring constant are substituted:

\begin{align} y_1'' + y_1 + y_1 - y_2 &= 0 \nonumber \\ y_2'' +y_2 -y_1 +y_2 &= 0 \nonumber \\[2mm] y_1'' + 2y_1 - y_2 &= 0 \nonumber \\ y_2'' +2y_2 -y_1 &= 0 \nonumber \\[2mm] \end{align}

We have a system of DE which will be solved by Laplace. Let us transform each member and solve in the domain $s$.

\begin{align} s^2Y_1 -s\cdot 0 -(-1) +2Y_1 - Y_2 &= 0 \nonumber \\ s^2Y_2 -s\cdot 0 -1 +2Y_2 - Y_1 &= 0 \nonumber \\[2mm] s^2Y_1 + 1+2Y_1 -Y_2 &= 0 \nonumber \\ s^2Y_2 -1 +2Y_2-Y_1 &= 0 \nonumber \\[2mm] Y_1(s^2+2)+1-Y_2 &= 0 \nonumber \\ Y_2(s^2+2)-1-Y_1 &= 0 \label{ref:lapl_set6}\\[2mm] Y_1 &= \frac{Y_2-1}{s^2 + 2} \label{ref:lapl_set4} \\ Y_2 &= \frac{Y_1+1}{s^2+2} \label{ref:lapl_set5}\\ \end{align}

Now $(\ref{ref:lapl_set4})$ is substituted into $(\ref{ref:lapl_set6})$.

\begin{align} Y_2(s^2+2)-1-\frac{Y_2-1}{s^2+2} &= 0 \nonumber \\ Y_2s^2 + 2Y_2 -1 -\frac{Y_2 - 1}{s^2 + 2} &= 0\nonumber \\ Y_2s^4 + 2Y_2s^2 - s^2+2Y_2s^2 + 4Y_2 - 2 -Y_2+1 &= 0 \nonumber \\ Y_2s^4 + 4Y_2s^2 +3Y_2 -s^2-1&=0 \nonumber \\ Y_2(s^4+4s^2+3) &= 1+s^2 \nonumber \\ Y_2 &= \frac{1+s^2}{(s^2+1)(s^2+3)} \nonumber \\ Y_2 &= \frac{1}{s^2+3}\nonumber \end{align}

The last line can be substituted into $(\ref{ref:lapl_set4})$:

$$Y_1 = \frac{\frac{1}{s^2+3}-1}{s^2+2} = \frac{\frac{1-s^2-3}{s^2+3}}{s^2+2} = \frac{\frac{-s^2-2}{s^2+3}}{s^2+2} = \frac{-1}{s^2+3}$$

The solution of the system of DE is done by inverse Laplace transform of $Y_1(s)$ and $Y_2(s)$.

$$\underline{\underline{y_1(t) = -\sin \sqrt3 t \cdot \frac{1}{\sqrt 3}}} \\ \underline{\underline{y_2(t) = \sin \sqrt3 t \cdot \frac{1}{\sqrt 3}}} \\$$
The response of the system

#### Example

Solve

y'' + 4y = f(t),\hskip2em y(0) = 0,\ y'(0)=0\, \hskip2em f(t)= \left\{ \begin{aligned} 0, & \hskip1em t \lt 5,\\ (t-5)/5, & \hskip1em 5\leq t \lt 10, \\ 1, & \hskip1em t \geq 10. \end{aligned} \right.
The physical meaning of $f(t)$ is known as ramp loading

The first step is to describe the given function $f(t)$ by means of unit step function, otherwise we can not make Laplace transform of $f(t)$.

\begin{align} f(t) &= u_5\left(\frac{t-5}{5}\right) - u_{10}\left(\frac{t-5}{5}\right) +u_{10}(1) = \nonumber \\ &= \frac 1 5 u_5(t-5) + u_{10}\left(-\frac{t-5}{5}+ \frac{5}{5}\right) = \nonumber \\ &= \frac{1}{5}u_5(t-5) - \frac 1 5 u_{10}(t-10) \nonumber \end{align}

The next step is usual: we have to transform each term of DE. The members of function $f(t)$, which involves unit step time functions will be transformed the using shifting theorem $(\ref{ref:lapl_4})$.

\begin{align} (s^2Y - s\cdot 0 - 0) + 4Y & = \frac 1 5 \frac 1 {s^2}e^{-5s} - \frac 1 5 \frac{1}{s^2}e^{-10s} \nonumber \\ Y(s^2 +4) &= \frac{\frac 1 5 e^{-5s} - \frac{1}{5}e^{-10s}}{s^2} \nonumber \\ Y &= \frac{\frac 1 5 e^{-5s} - \frac{1}{5}e^{-10s}}{s^2(s^2 +4)} \nonumber \\ \end{align}

Both the terms in numerator express time shift, not the functions themselves. Thus we can bring time shift outside of the fraction and bring them back later.

\begin{align} Y &= \left(\frac 1 5 e^{-5s} - \frac{1}{5} e^{-10s}\right)\frac{1}{s^2(s^2 +4)} \nonumber \\ \end{align}

We have to do partial fraction decomposition of $\frac{1}{s^2(s^2 +4)}$:

\begin{align} \frac{1}{s^2(s^2 +4)} &= \frac{A}{s} + \frac{B}{s^2} + \frac{Cs+D}{s^2+4} \nonumber \\ 1 &= A(s)(s^2 + 4) + B (s^2+4) + Cs(s^2) + D(s^2) \nonumber \\ 1 &= s^3 (A+C) + s^2(B+D) + s(4A) + 1(4B) \implies \nonumber \\ B &= \frac 1 4,\ A= 0,\ C = 0,\ D =-\frac 1 4 \nonumber \\ \end{align}

Then we have to do inverse transform of $Y(s)$:

\begin{align} Y &= \left(\frac 1 5 e^{-5s} - \frac{1}{5} e^{-10s}\right)\left(\frac 1 4\frac{1}{s^2} -\frac 1 8 \frac{2}{s^2 + 4} \right) \nonumber \\ \end{align}

The inverse terms inside the second pair of parentheses are $\frac{1}{4} t - \frac{1}{8}\sin 2t$ and the inverse transform of $Y(s)$ is

\begin{align} y(t) &= \left(\frac 1 5 u_5(t) - \frac 1 5 u_{10}(t)\right) \left( \frac 1 4t -\frac 1 8\sin 2t \right) = \nonumber \\ &= \frac 1 5 u_5(t) \left( \frac 1 4 t - \frac 1 8 \sin 2t \right) - \frac 1 5 u_{10}(t) \left( \frac 1 4 t -\frac 1 8 \sin 2t \right) \nonumber \end{align}
• Note that both $\frac{1}{4}t$ and $\frac{1}{8}\sin 2t$ are erased by unit step function: until 5 s there is a zero response.
• At time $t=5$ both members $\frac{1}{4} t$ and $\frac{1}{8}\sin 2t$ become active (we also have to shift the functions according to the shifting theorem): $y(5 \leq t \lt 10) = \frac{1}{5}\cdot\frac 1 4 (t-5) - \frac{1}{5}\cdot \frac{1}{8}\sin2(t-5)$.
• At time $t=10$ we have to subtract $\frac{1}{5}(\frac 1 4 (t-10) - \frac{1}{8}\sin2(t-10))$
y(t) = \left\{ \begin{aligned} 0, &\hskip2em t\lt5, \\ \frac 1 {20} (t-5) - \frac 1 {40} \sin 2(t-5), &\hskip2em 5 \leq t \lt 10\\ \frac 5 {20} - \frac 1 {40} \sin 2(t-5) + \frac{1}{40} \sin 2(t-10), & \hskip2em t \geq 10. \end{aligned} \right.

#### Example

Find the solution $y(t)$ if

$$Y(s) = e^{-s}\left(\frac{2}{s^3} + \frac{2}{s^2}+ \frac 1 s\right)$$

An event is happening at time $t=1$. According to the shifting theorem, it can be observed that each function is time-shifted into $t=1$. Since they are shifted, they are also erased.

$$y(t) = u_1(t)\left((t-1)^2 + 2(t-1) + 1\right) = u_1(t)(t^2 - 2t +1 +2t-2 +1) = u_1(t)\cdot t^2.$$

What seemed as a time shift is finally $t^2$ erased until $t=1$. Indeed, such example has been computed above already.

#### Example

Find the solution $y(t)$ if

$$Y(s) = \frac{2}{s-1} - \frac 1 s - \frac{2}{s}e^{-3s} - \frac{1}{s^2}e^{-3s} + \frac{3/2}{s-1}e^{-3s} + \frac{1/2}{s+1}e^{-3s}$$

We can recognize some terms which are active from $t=0$ and some other terms shifted and active from time $t=3$:

$$y(t) = 2e^t - 1 -2u_3(t) - u_3(t)\cdot (t-3) + \frac 3 2 e^{t-3} u_3(t) + \frac 1 2 e^{-(t-3)}u_3(t)$$

Such solution is correct but not convenient and it is expected we provide also the case form:

y(t) = \left\{ \begin{aligned} -1+2e^t & \hskip2em 0 \leq t \lt 3, \\ -1 + 2e^t - 2 -(t-3) + \frac 3 2 e^{t-3} + \frac 1 2 e^{-(t-3)} & \hskip2em t \geq 3, \end{aligned} \right.

which can be simplified to

y(t) = \left\{ \begin{aligned} -1+2e^t & \hskip2em 0 \leq t \lt 3, \\ 2e^t - t + \frac 3 2 e^{t-3} + \frac 1 2 e^{3-t} & \hskip2em t \geq 3. \end{aligned} \right.

#### Example

Find the solution $y(t)$ if

$$Y(s) = \frac{e^{-2s}}{s^2 + 9}$$

It can be observed that sine is involved, more precisely $\sin 3t$ which has been shifted to $t=2$.

$$y(t) = \frac 1 3 \sin 3(t-2)\cdot u_2(t)$$

So the solution is $1/3 \sin 3t$ moved to $t=2$. The case form is more convenient:

y(t) = \left\{ \begin{aligned} 0 & \hskip1em t \leq 2, \\ \frac 1 3 \sin3(t-2) &\hskip1em t \gt 2. \end{aligned} \right.

#### Example

Find the solution $y(t)$ if

$$Y(s) = \frac{1}{s^2}e^{-s} - \frac 1 {s^2} e^{-2s}$$

We can identify two functions $f(t) = t$ which were moved to time $t=1$ and $t=2$

$$f(t) = (t-1) u(t-1) - (t-2) u(t-2)$$

Such result, written with unit step function, is formally correct, but for convenience its case form is expected:

f(t) = \left\{ \begin{aligned} 0 &\hskip2em t \lt 1, \\ t - 1 & \hskip2em 1 \leq t \lt 2, \\ 1 & \hskip2em t\geq 2. \end{aligned} \right.

List of chapters