# Topic 6 Laplace Transform Methods

## 6.1 Laplace Transforms and Inverse Transforms

In Maple, in order to calculate Laplace transforms and inverse transforms, the package `inttrans`

need to be loaded first. The command for Laplace transform is `laplace(function, input variable, output variable)`

. The command for inverse Laplace transform is `invlaplace(function, input variable, output variable)`

.

**Example 6.1 **Find the Laplace transform of the function \(f(t)=e^{at}(A\cos(bt)+B\sin(bt))\)

*Solution*. We first load the package `inttrans`

`with(inttrans);`

Now letâ€™s define the function \(f\):

`f(t):=exp(a*t)*(A*cos(b*t)+B*sin(b*t));`

The Laplace transform of the function \(f\) can be calculated by the following command

`Lf:=laplace(f(t), t, s);`

The output is \[{\color{blue}{\frac{-A a +A s +B b}{\left(s -a \right)^{2}+b^{2}}}}\]

**Example 6.2 **Find the inverse transform of the function \(F(s)=\frac{2}{s^2+4}-\frac{1}{(s-3)^2}\).

*Solution*. Load the `inttrans`

package if it was not loaded. Otherwise, this step may be skipped.

`with(inttrans):`

Define the function

`F(s):=2/(s^2+4)-1/((s-3)^2);`

Use `invlaplace`

to calculate the inverse transform.

`invlaplace(F(s), s, t)`

The inverse transform is

\[{\color{blue}{\sin \left(2 t \right)-t e^{3 t}}}\]

**Exercise 6.1 **Find the Laplace transform of the function \(f(t)=At\cos(a t)+Bt\sin(b t)\)

**Exercise 6.2 **Find the inverse Laplace transform of the function \(F(s)=\frac{s}{s^2+2s+2}\).

## 6.2 Transforms of Initial Value Problems

Given an initial value problem
\[ay''+by'+c=f(x), \quad y(0)=y_0,\quad y'(0)=y_1,\]
applying the Laplace transform to the equation translates the equation into an algebraic equation of the Laplace transform \(\mathcal{L}(y)\). In Maple, the command `laplace`

can take an equation as the first argument.

**Example 6.3 **Find the laplace transform \(\mathcal{L}(y)\), where \(y\) is the solution of the initial value problem
\[y''-y'y=te^2t, \quad y(0)=0, \quad y'(0)=0.\]

*Solution*. Load the package `inttrans`

if it was not loaded:

`with(inttrans):`

Define the equation:

`ode51:=diff(y(t), t$2)+2*diff(y(t), t)+2*y(t)=t*exp(2*t);`

Apply the Laplace transform to the equation:

`Lode51:=laplace(ode51, t, s);`

Solve for \(\mathcal{L}(y)\) (`laplace(y(t), t, s)`

):

`Ly:=eval(solve(Lode51, laplace(y(t), t, s)), y(0)=0, D(y)(0)=0);`

The output shows \[\mathcal{L}(y)={\color{blue}{\frac{1}{\left(s -1\right)^{2} \left(s^{2}+2 s +2\right)}}}\]

So \(y\) is the inverse transform of this function. It can be calculated using `invlaplace`

.

`y:=invlaplace(Ly, s, t);`

The output shows that the solution is \[{\color{blue}{\frac{{\mathrm e}^{t} \left(5 t -4\right)}{25}+\frac{{\mathrm e}^{-t} \left(4 \cos \left(t \right)+3 \sin \left(t \right)\right)}{25}}}.\]

**Exercise 6.3 **Convert the initial value problems
\[3y''+6y'+24y=\cos(2t), \quad y(0)=1, \quad y'(0)=-1.\]
into an algebraic equation of the inverse transform \(\mathcal{L}(y)\) and solve for \(\mathcal{L}(y)\).

## 6.3 Partial Fractional Decomposition Method

When using Laplace transform to solve linear second order differential equations with constant coefficients, the Laplace transform \(\mathcal{L}(y)\) is usually a rational function. By the fundamental theorem of algebra, a rational function can be written as the sum of fractions whose denominators are powers of linear or quadratic functions and whose numerators are constants or linear functions respectively. This sum is called the partial fractional decomposition. In Maple, the command `convert(rational function, parfrac, independent variable)`

can be used to find the partial fractional decomposition of a rational function.

**Example 6.4 **Find the partial fractional decomposition of the rational function
\[F(s)=\frac{1}{(s-1)^2(s^2+2s+2)}\]
and find the inverse transform of the decomposition.

*Solution*. Define the function:

`F(s):=1/((s-1)^2*(s^2+2*s+2));`

Convert the function into a partial fractional decomposition:

`pF:=convert(F(s), parfrac, s);`

The output shows the partial fractional decomposition is \[{\color{blue}{\frac{1}{5 \left(s -1\right)^{2}}+\frac{4 s +7}{25 s^{2}+50 s +50}-\frac{4}{25 \left(s -1\right)}}}\]

Apply `invlaplace`

`invF:=invlaplace(pF, s, t);`

The answer is \[{\color{blue}{\frac{{\mathrm e}^{t} \left(5 t -4\right)}{25}+\frac{{\mathrm e}^{-t} \left(4 \cos \left(t \right)+3 \sin \left(t \right)\right)}{25}}}.\]

**Exercise 6.4 **Find the partial fractional decomposition of the rational function
\[F(s)=\frac{3 s^{3}+3 s^{2}+13 s +12}{3 \left(s^{2}+4\right) \left(s^{2}+2 s +8\right)}\]
and find the inverse transform of the decomposition.