11.6. Laplace Transforms#
Note
In the realm of differential equations, the Laplace Transform is a crucial and powerful tool that simplifies the process of solving complex equations. This mathematical operation is named after Pierre-Simon Laplace, a French mathematician and astronomer whose work was foundational to many branches of mathematics.
The essence of the Laplace Transform lies in its ability to convert differential equations, which involve rates of change and are dependent on time, into algebraic equations, which are easier to manipulate. In this conversion process, complex patterns of time-dependent behavior are mapped into a domain where they are described as simple functions of a complex variable.
In this chapter, we will explore the fundamentals of Laplace Transforms, beginning with its definition and properties. We’ll investigate how to apply Laplace Transforms to linear ordinary differential equations, including initial and boundary value problems. We will also study the Inverse Laplace Transform, a crucial technique for reclaiming our original function after performing operations in the Laplace domain. By leveraging Laplace Transforms, we can tackle systems that would be otherwise intimidating or intractable, such as those involving discontinuous or impulsive forces. This method is extensively used in various fields, including engineering, physics, and mathematics, to solve real-world problems ranging from electric circuit analysis to modeling population growth or decay.
11.6.1. Introduction to Laplace Transforms#
Let \(f(t)\) be a function and consider the integral
If this integral is finite, then \(\mathcal{L}(f(t))\) (also denoted \(F(s)\)) is called the Laplace transform of \(f(t)\). Note that not all functions have Laplace transforms.
Example
Find the Laplace transform of \(f(t)=1\).
Notice that if \(s<0\), then the limit goes to \(\infty\) and if \(s>0\), the limit goes to \(0\). Thus \(\mathcal{L}(1) = \dfrac{1}{s}\) for \(s >0\).
Show code cell source
#We can also do this example in the Jupyter notebook.
from sympy import symbols, LaplaceTransform, Function
t, s = symbols('t s')
f = Function('f')(t)
# Define the function
f = 1
# Compute Laplace transform
F = LaplaceTransform(f, t, s).doit()
print("The Laplace transform of f(t) = 1 is:", F)
The Laplace transform of f(t) = 1 is: (1/s, 0, True)
Example
Find the Laplace transform of \(f(t)=e^{at}\).
Notice that if \(s<a\), then the limit goes to \(\infty\) and if \(s>a\), the limit goes to \(0\). Thus \(\mathcal{L}(e^{at}) = -\dfrac{1}{a-s} = \dfrac{1}{s-a}\) for \(s >a\).
Show code cell source
from sympy import symbols, LaplaceTransform, Function, exp
t, s, a = symbols('t s a')
f = Function('f')(t)
# Define the function
f = exp(a*t)
# Compute Laplace transform
F = LaplaceTransform(f, t, s).doit()
print("The Laplace transform of f(t) = e^(at) is:", F)
The Laplace transform of f(t) = e^(at) is: (1/(-a + s), a, True)
Given that a function does not always have a Laplace transform (see Exercise 4), it is worthwhile to discuss requirements for a function to have a Laplace transform. First, the function must be piecewise continuous. In other words, \(f(t)\) is continuous except at possibly finitely many points. If \(f(t)\) is discontinuous at \(t_k\), then \(\lim_{t \rightarrow t_k^-} f(t)\) and \(\lim_{t \rightarrow t_k^+} f(t)\) are both finite. Secondly, the function must have exponential order. In other words, there must be some numbers \(M,a,T\) such that \(|f(t)| \leq Me^{at}\) for \(t >T\).
Linearity of Laplace Transforms: If \(f(t)\) and \(g(t)\) are both piecewise continuous functions of exponential order, then
Summary
Initial Function |
Laplace Transform of that Function |
---|---|
\(1\) |
\(\dfrac{1}{s}\), if \(s>0\) |
\(e^{at}\) |
\(\dfrac{1}{s-a}\), if \(s>a\) |
\(\sin(bt)\) |
\(\dfrac{b}{s^2+b^2}\) |
\(\cos(bt)\) |
\(\dfrac{s}{s^2+b^2}\) |
\(af(t)+bg(t)\) |
\(aF(s)+bG(s)\) (Linearity) |
\(f'(t)\) |
\(sF(s)-f(0)\) |
\(f''(t)\) |
\(s^2F(s) - sf(0) -f'(0)\) |
11.6.2. The Inverse Laplace Transform#
Example
Consider the linear initial value problem
Find the Laplace transform of the solution \(x(t)\).
Now we want to know, what function \(x(t)\) has \(\mathcal{L}(x) = \dfrac{s+6}{(s+5)(s+4)}\)?
The function \(f(t)\) which has Laplace transform \(F(s)\) is called the inverse Laplace transform of \(F(s)\). So long as all of the functions are piecewise continuous of exponential order, this transformation is unique, except possibly at the points of discontinuity. Moreover, the inverse Laplace transform is a linear operator. That is,
Example (continued)
Find the inverse Laplace transform for \(\mathcal{L}(x) = \dfrac{s+6}{(s+5)(s+4)}\).
First, we can use partial fractions to split this into more reasonable pieces.
If \(s=-4\), then \(2 = A(0) + B(1)\), thus \(B=2\). If \(s=-5\), then \(1 = A(-1) + B(0)\), thus \(A=-1\).
So \(\mathcal{L}(x) = \dfrac{-1}{s+5} + \dfrac{2}{s+4}\). Recall that \(\mathcal{L}(e^{at}) = \dfrac{1}{s-a}\). Thus \(\mathcal{L}(x) = -\mathcal{L}(e^{-5t}) + 2 \mathcal{L}(e^{-4t})\). So \(x(t) = -e^{-5t}+2e^{-4t}\), which is the solution to the initial-value problem given in the previous example!
In order to solve differential equations with Laplace transforms, we will:
Step 1: Take the Laplace transform of both sides and set them equal.
Step 2: Enter initial conditions (if needed)
Step 3: Solve the equation algebraically for the transform \(\mathcal{L}(X)\), which we will now denote \(X(s)\), of the unknown function \(x(t)\).
Step 4: Invert \(X(s)\) to find \(x(t)\).
Example
Consider the linear initial value problem
Find the Laplace transform of the solution \(x(t)\).
Now use partial fractions
Solving for \(A\), \(B\), and \(C\), yields \(A = 2\), \(B=-2\), and \(C=0\).
Thus \(X(s) = \dfrac{-2s}{s^2+4} + \dfrac{2}{s} = -2 \left(\dfrac{s}{s^2+2^2}\right) +2 \left(\dfrac{1}{s}\right)\). Therefore, \(x(t) = -2\cos(2t)+2\).
11.6.3. More Laplace Transforms & the Heaviside Function#
Theorem
If \(f(t)\) is any piecewise continuous function of exponential order, then
Theorem
Theorem
If \(f(t)\) is any piecewise continuous function of exponential order, then
Let’s update our table to take this new information into account
Initial Function |
Laplace Transform |
---|---|
\(1\) |
\(\dfrac{1}{s}\), if \(s>0\) |
\(e^{at}\) |
\(\dfrac{1}{s-a}\), if \(s>a\) |
\(\sin(bt)\) |
\(\dfrac{b}{s^2+b^2}\) |
\(\cos(bt)\) |
\(\dfrac{s}{s^2+b^2}\) |
\(af(t)+bg(t)\) |
\(aF(s)+bG(s)\) (Linearity) |
\(f'(t)\) |
\(sF(s)-f(0)\) |
\(f''(t)\) |
\(s^2F(s) - sf(0) -f'(0)\) |
\(t\) |
\(\dfrac{1}{s^2}\) |
\(tf(t)\) |
\(-\dfrac{d}{ds}F(s)\) |
\(t^n\) |
\(\dfrac{n!}{s^{n+1}}\) |
\(te^{at}\) |
\(\dfrac{1}{(s-a)^2}\) |
\(e^{at}f(t)\) |
\(F(s-a)\) |
\(e^{at}\sin(bt)\) |
\(\dfrac{b}{(s-a)^2+b^2}\) |
\(e^{at}\cos(bt)\) |
\(\dfrac{s-a}{(s-a)^2+b^2}\) |
Now we will explore how we invert terms of the form \(\dfrac{As+B}{s^2+cs+d}\) where \(s^2+cs+d\) is an irreducible quadratic. To do this, we will complete the square, that is, we will write \(s^2+cs+d=s^2+cs+\left(\dfrac{c}{2} \right)^2 + d -\left(\dfrac{c}{2} \right)^2= \left(s+\dfrac{c}{2}\right)^2 + \left(\sqrt{d-\dfrac{c}{2}^2} \right)^2 =(s-a)^2+b^2.\) If we complete the square, then
Example
Find the inverse Laplace Transform of
Notice the denominator is an irreducible quadratic, so we need to complete the square.
Thus,
The unit step function (also called the Heaviside function) at \(t=c\) is the function
More importantly, the Laplace transform of the Heaviside function exists, and any piecewise continuous function can be expressed in terms of the Heaviside function. The Heaviside function for \(c=0\) is plotted below.
Show code cell source
import numpy as np
import matplotlib.pyplot as plt
# Define the unit step function
def unit_step(t):
return np.heaviside(t, 1)
# Generate a range of x values
t = np.linspace(-2, 2, 1000)
# Calculate the corresponding y values
y = unit_step(t)
# Create the plot
plt.figure(figsize=(6, 4))
# Plot two separate lines to remove vertical line at t=0
plt.plot(t[t<0], y[t<0], 'b')
plt.plot(t[t>=0], y[t>=0], 'b')
# Add points at (0,0) and (0,1)
plt.plot(0, 0, 'bo', fillstyle='none')
plt.plot(0, 1, 'bo', fillstyle='none')
plt.title('Heaviside Function with $c=0$')
plt.xlabel('t')
plt.ylabel('u(t)')
plt.grid(True)
plt.show()
Example
Consider the function
plotted below. Express this function in terms of the Heaviside function.
Show code cell source
import numpy as np
import matplotlib.pyplot as plt
# Define the piecewise functions
def f1(t):
return 4 - t
def f2(t):
return 4 + np.cos(t)
# Generate a range of t values for each piece
t1 = np.linspace(0, np.pi, 500)
t2 = np.linspace(np.pi, 2*np.pi, 500)
# Calculate the corresponding y values using the piecewise function
y1 = f1(t1)
y2 = f2(t2)
# Create the plot
plt.figure(figsize=(6, 4))
plt.plot(t1, y1, label=' $4 - t$ for $ 0 \leq t \leq \pi $')
plt.plot(t2, y2, label='$4 + cos(t)$ for $ t > \pi $')
# Add markers for the specific points
plt.plot(np.pi, 4 - np.pi, 'bo') # filled blue circle
plt.plot(np.pi, 3, 'ro', markerfacecolor='none') # open red circle
plt.title('Plot of f(t)')
plt.xlabel('t')
plt.ylabel('f(t)')
plt.legend()
plt.grid(True)
plt.show()
To express \(f(t)\) in terms of the Heaviside function, notice that \(f(t) = 4-t + u(t-\pi)(4+\cos(t)-(4-t))\). Now we’d like to find the Laplace transform of \(u(t-\pi)(4+\cos(t)-(4-t))\) in order to be able to solve initial-value problems. The following theorem will help us do exactly that.
Theorem
Let \(f(t)\) be a piecewise continuous function of exponential order and let \(u(t-c)\) be the unit step function for some \(c\). Then
\(\mathcal{L}(u(t-c)) = \dfrac{e^{-cs}}{s}\)
\(\mathcal{L}(u(t-c)f(t-c)) = e^{-cs}F(s)\)
\(\mathcal{L}(u(t-c)f(t)) = e^{-cs}G(s)\) where \(G(s) = \mathcal{L}(f(t+c))\)
Example (continued)
Consider the function
Find \(\mathcal{L}(f(t))\).
Since \(f(t) = 4-t + u(t-\pi)(4+\cos(t)-(4-t))\), we know
11.6.4. Exercises#
Exercises
By hand show that the Laplace transforms of \(\cos(bt)\) and \(\sin(bt)\) are the functions listed in the chart.
Show that the Laplace transform of \(f'(t)\) is \(sF(s)-f(0)\).
Show that the Laplace transform of \(f''(t)\) is \(s^2F(s)-sf(0)-sf'(0)\).
Show that the function \(g(x) = e^{t^2}\) does not have a Laplace transform.
Find the Laplace transform of \(f(t) = 8+3e^{2t}-\cos(6t)\).
Solve the initial value problem
Solve the initial value problem
Let \(f(t) = \begin{cases} t & \text{ if } 0 \leq t \leq 2 \\ 0 & \text{ if } t>2 \end{cases}\). Solve the initial value problem
Hint: First rewrite \(f(t)\) using the Heaviside function so that you can take the Laplace transform of both sides.