Laplace transform

### 12.4.2 Laplace transform

Denoting by L the Laplace transform, you get the following:

L(y)(x) |
= | ∫ |
+∞
0
| e−x uy(u)du
L−1(g)(x) |
= |
1
2iπ
| ∫ |
C
| ez xg(z) dz

where C is a closed contour enclosing the poles of g.

The laplace command finds the Laplace transform of a function.

- laplace takes one mandatory argument and two optional arguments:
  - expr, an expression involving a variable.
  - Optionally, x, the variable name (by default x).
  - Optionally, s, a variable for the output (by default x).
- laplace(expr ⟨,x ⟩) returns the Laplace transform of expr.

The ilaplace or invlaplace command finds the inverse Laplace transform of a function.

- ilaplace takes one mandatory argument and two optional arguments:
  - expr, an expression involving a variable.
  - Optionally, x, the variable name (by default x).
  - Optionally, s, a variable for the output (by default x).
- ilaplace(expr ⟨,x ⟩) returns the inverse Laplace transform of expr.

You also can use the addtable command Laplacians of unspecified functions (see Section 19.4.3). The Laplace transform has the following properties:

L(y′)(x) | =−y(0)+xL(y)(x) |  |  |  |  |  |  |  |  |
L(y′′)(x) | =−y′(0)+xL(y′)(x) |  |  |  |  |  |  |  |  |
| =−y′(0)−xy(0)+x2L(y)(x) |  |  |  |  |  |  |  |  |

These properties make the Laplace transform and inverse Laplace transform useful for solving linear differential equations with constant coefficients. For example, suppose you have

| y′′ +p y′ +q y=f(x) |  |  |  |  |  |  |  |  |
| y(0)=a, y′(0)=b |  |  |  |  |  |  |  |  |

then

L(f)(x) | =L(y′′+py′+qy)(x) |  |  |  |  |  |  |  |  |
| =−y′(0)−x y(0)+x2 L(y)(x)−p y(0)+p x L(y)(x))+q L(y)(x) |  |  |  |  |  |  |  |  |
| =(x2+p x+q) L(y)(x)−y′(0)−(x+p) y(0) |  |  |  |  |  |  |  |  |

Therefore, if a=y(0) and b=y′(0), you get

L(f)(x)=(x2+p x+q)L(y)(x)−(x+p) a−b

and the solution of the differential equation is:

y(x)=L−1 | ⎛ ⎜ ⎜ ⎝ |
L(f)(x)+(x+p) a +b
x2+p x+q
| ⎞ ⎟ ⎟ ⎠ | .

#### Examples

laplace(sin(x))

1
x2+1

With t as the original variable:

laplace(sin(t),t)

1
t2+1

With t as the original variable and s as the transform variable:

L:=laplace(sin(t),t,s)

1
s2+1

Apply the inverse transform to obtain the original function:

ilaplace(L,s,t)

sint |  |  |  |  |  |  |  |  |  |

Solve y′′ −6 y′+9 y=x e3 x, y(0)=c0, y′(0)=c1. Here, p=−6 and q=9.

laplace(x*exp(3*x))

1
x2−6 x+9

ilaplace((1/(x^2-6*x+9)+(x-6)*c_0+c_1)/(x^2-6*x+9))

1
6
|  | ⎛ ⎝ | x3−18 x c0+6 x c1+6 c0 | ⎞ ⎠ | e3 x

Note that this equation could be solved directly.

desolve(y''-6*y'+9*y=x*exp(3*x),y)

e3 x | ⎛ ⎝ | c0 x+c1 | ⎞ ⎠ | + |
1
6
| x3 e3 x