Laplace Transforms

<<Calculus`LaplaceTransform`

Calculating Laplace Transforms and Inverse Laplace Transforms

Find the Laplace transforms of the functions
    a)  E^(2t)*Sin[Pi t]
    b)  t^2*Cos[3t]
by integrating and by using LaplaceTransform[f[t],t,s].
Find the inverse Laplace transform of the functions
    c)  s^2/(s^3 + s^2 + s + 1)
    d)  (2s-3)/(s^2 - 4)
by using partial fraction decompositions (use Apart[])  if necessary and the tables on p.286 of the textbook, and by using InverseLaplaceTransform[Y[s],s,t].

Solution

a)

Integrate[E^(-s*t)E^(2t)*Sin[Pi t],t]

Integrate[E^(-s*t)E^(2t)*Sin[Pi t],{t,0,Infinity}]

LaplaceTransform[E^(2t)*Sin[Pi t],t,s]

b)

Integrate[E^(-s*t)*t^2*Cos[3t],t]

Integrate[E^(-s*t)*t^2*Cos[3t],{t,0,Infinity}]

LaplaceTransform[t^2*Cos[3t],t,s]

Together[%]

c)

Apart[s^2/(s^3 + s^2 + s + 1)]

The inverse Laplace transforms of 1/(s+1), 1/(s^2+1), and s/(s^2+1) are E^(-t), Sin[t], and Cos[t], respectively, so the inverse Laplace transform of the above is
 (1/2) E^(-t) - (1/2) Sin[t] + (1/2) Cos[t].

InverseLaplaceTransform[s^2/(s^3 + s^2 + s + 1),s,t]

d)

Apart[(2s-3)/(s^2 - 4)]

The inverse Laplace transforms of 1/(s-2) and 1/(s+2) are E^(2t) and E^(-2t),  respectivley, so the inverse Laplace transform of the above is
 (1/4) E^(2t) + (7/4) E^(-2t).

InverseLaplaceTransform[(2s-3)/(s^2 - 4),s,t]

Solving Initial Value Problems Using Laplace Transforms

Solve the initial value problems using the Laplace transform. Compare the answers with the results given by DSolve[] and  and plot the solutions:
a) y''[t]+3y'[t]+2y[t] == 0, y[0] == 1, y'[0] == 0
b) y''[t]+2y'[t]+5y[t] == 0, y[0] == 2, y'[0] ==-1
c) y''[t]-2y'[t]+2y[t] == E^(-t), y[0]==0, y'[0]==1

Solution

Clear[t,y]

Y[s_] := LaplaceTransform[y[t],t,s]

a)

eqn = LaplaceTransform[y''[t]+3y'[t]+2y[t] == 0,t,s]

We can delay plugging the constants...

tran = Solve[eqn,Y[s]]

soln = InverseLaplaceTransform[Y[s]/.First[tran],s,t]

soln = soln /. {y[0]->1, y'[0]->0}

or plug the constants in before we solve:

tran = Solve[eqn/.{y[0]->1, y'[0]->0},Y[s]]

soln = InverseLaplaceTransform[Y[s]/.First[tran],s,t]

Plot[soln, {t,0,4}, PlotRange->{0,1}]

b)

eqn = LaplaceTransform[y''[t]+2y'[t]+5y[t] == 0,t,s]

tran = Solve[eqn/.{y[0]->2, y'[0]->-1},Y[s]]

soln = InverseLaplaceTransform[Y[s]/.First[tran],s,t]

Plot[soln, {t,0,2Pi}, PlotRange->{-2,2}]

c)

eqn = LaplaceTransform[y''[t]-2y'[t]+2y[t] == E^(-t),t,s]

tran = Solve[eqn/.{y[0]->0, y'[0]->1},Y[s]]

soln = InverseLaplaceTransform[Y[s]/.First[tran],s,t]

Plot[soln, {t,0,2Pi}]

Equations Involving Unit Step Functions

Solve the initial value problems using the Laplace transform and plot the solutions:
a) y''[t] + 9y[t] == UnitStep[t-Pi/2](1-Cos[t-Pi/2]),
  y[0] == 0, y'[0] == 0
b) y'''[t] - 8y'[t] == UnitStep[t] - UnitStep[t-1],
  y[0] == 0, y'[0] == 0, y''[0] == 0

Solution

a)

Plot[UnitStep[t-Pi/2](1-Cos[t-Pi/2]), {t,0,4Pi}]

eqn = LaplaceTransform[
y''[t]+9y[t] == UnitStep[t-Pi/2](1-Cos[t-Pi/2]),t,s]

tran = Solve[eqn/.{y[0]->0, y'[0]->0},Y[s]]

soln = InverseLaplaceTransform[Y[s]/.First[tran],s,t]

Plot[soln, {t,0,4Pi}]

b)

Plot[UnitStep[t] - UnitStep[t-1], {t,0,2}]

eqn = LaplaceTransform[
y'''[t] - 8y'[t] == UnitStep[t] - UnitStep[t-1],t,s]

tran = Solve[eqn/.{y[0]->0, y'[0]->0, y''[0]->0},Y[s]]

soln = InverseLaplaceTransform[Y[s]/.First[tran],s,t]

Plot[soln, {t,0,2}]

Equations Involving the Dirac Delta Function

Solve the initial value problems using the Laplace transform and plot the solutions:
a) y''[t] + 16y[t] == DiracDelta[t-Pi/2],
  y[0] == 0, y'[0] == 0
b) y'''[t] - 8y'[t] == DiracDelta[t] - 8DiracDelta[t-1/2],
  y[0] == 0, y'[0] == 0, y''[0] == 0

Solution

a)

eqn = LaplaceTransform[
y''[t] + 16y[t] == DiracDelta[t-Pi/2],t,s]

tran = Solve[eqn/.{y[0]->0, y'[0]->0},Y[s]]

soln = InverseLaplaceTransform[Y[s]/.First[tran],s,t]

Plot[soln, {t,0,2Pi}]

b)

eqn = LaplaceTransform[
y'''[t] - 8y'[t] == DiracDelta[t] - 8 DiracDelta[t-1/2],t,s]

tran = Solve[eqn/.{y[0]->0, y'[0]->0, y''[0]->0},Y[s]]

soln = InverseLaplaceTransform[Y[s]/.First[tran],s,t]

Plot[soln, {t,0,1}]

Convolution

a) Express the inverse Laplace transform of the function
    H[s_] := 1/((s-2)^4(s^2-1))
in terms of an integral. Evaluate this integral with Integrate[] and compare the result with InverseLaplaceTransform[F[s],s,t].
b) Express the solution of the initial value problem
  y''[t] + 9y[t] == g[t],
  y[0]==1, y'[0]==0
in terms of a convolution integral.

Solution

a)  H[s] is a product of F[s_] = 1/(s-2)^4 and G[s_] = 1/(s^2-1). Let f[t] and g[t] be the inverse Laplace transforms of F[s] and G[s], respectively.

f[t_] = InverseLaplaceTransform[1/(s-2)^4,s,t]

g[t_] = InverseLaplaceTransform[1/(s^2-1),s,t]

By the Convolution  Theorem, the inverse Laplace transform h[t] of H[s] is the convolution of f[t] and g[t]:

Integrate[f[t-u]g[u],{u,0,t}]

InverseLaplaceTransform[1/((s-2)^4(s^2-1)),s,t]

b)

Clear[t,y,g]

Y[s_] := LaplaceTransform[y[t],t,s];
G[s_] := LaplaceTransform[g[t],t,s]

eqn = LaplaceTransform[
      y''[t] + 9y[t] == g[t],t,s]

tran = Solve[eqn/.{y[0]->1, y'[0]->0},Y[s]]

The inverse Laplace transform of the first term is straightforward:

InverseLaplaceTransform[s/(s^2+9),s,t]

The second term is a product of F[s_] = 1/(s^2+9) and G[s]. By the Convolution Theorem, the inverse Laplace transform of F[s] G[s] is the convolution integral of g[t]and

f[t_] = InverseLaplaceTransform[1/(s^2+9),s,t]

Integrate[g[t-u]f[u],{u,0,t}]

In one step:

InverseLaplaceTransform[Y[s]/.First[tran],s,t]