Differential Equations Day 20 -- Laplace Transform for Solving Initial Value Problems
Overview
Before the advent of accurate numerical methods such RK4 and the computational technology needed to run them, Pierre-Simon Laplace (1749-1827) and then Oliver Heaviside (1850-1925) devised an elegant "all in one" method for algebraically solving linear higher order differential equations of many types. The method is called the Laplace Transform for Solving Initial Value Problems (IVPs). In some sense, you can think of the method as "one ring to rule them all"; it synthesizes a lot of this chapter into a single theory and method.
A quick word of warning: if you try to learn the theory and the method of the Laplace transform simultaneously, this is like pizza-ing when you should have french fried: you're gonna have a bad time. So after a few introductory and historical remarks, we'll only focus on the method. There are links throughout what follows to read about the relevant theory, and see all the gory details of the algebra that we skip.
Introduction to the Laplace Transform
The theory of the Laplace Transform provides a method for solving linear higher order differential equations with initial conditions.
The term "linear" means that only and so on appear in the differential equation. No , , , etcetera, are allowed when using this method. Consequently this method does not work to solve the class of differential equations that we learned about that model simple pendulums (because of the presence of sine on ); we'll have to content ourselves with RK4 for that.
Also, this method works best when there are initial conditions present and a specific solution is sought. A little bit of "hacking" is required to produce general solutions. It's best to use it fresh for each new specific solution you seek.
The details of the theory are admittedly quite intricate. However, the overall guiding principle that Pierre-Simon Laplace and Oliver Heaviside used in their discovery process are not too complex. Their overall strategy for developing this theory was to:
- First: "systematically transform" a linear higher order differential equation with initial conditions on , etc. into an algebraic equation. This step is where the eponymous "Laplace Transform" comes into play.
- Then: after this transformation into an algebraic domain has occurred, solve the algebraic equation, which should be easier than the differential equation.
- Then: use an "inverse transform mechanism" to transform the solution of the algebraic equation back to the realm of differential equations to obtain a specific solution of the differential equation that matches the initial conditions. This is called the "Inverse Laplace Transform".
History of the Laplace Transform
The theory and method of the Laplace Transform was extremely popular prior to the dawn of computers (i.e. pre World War 2) when it was not feasible to implement numerical methods. Indeed, in this pre-computer era, the method of the Laplace transform was viewed as a huge time saver that compiled the entire algebraic theory of higher order linear differential equations with IVPs into one neat and tidy "theoretical body". As a bonus, the theory was able to be put into methodological practice! It was so popular during this era that it is still taught today in classes on Differential Equations.
This pre-computer "glory-day" period for the Laplace Transform turned out to be somewhat short however. The method ran into headwinds during the tail end of World War 2. At that time American scientists were in a literal race to develop the atom bomb before the Axis powers. In so doing, "highly non linear" differential equations appeared while modeling the fission of uranium required to produce the detonation. Laplace transforms either weren't up for the task, or took to long to compute for human beings. Numerical methods such as RK4 were often turned to instead due to their combination of flexibility and accuracy. Computers--which were just coming into existence--were rapidly developed to perform RK4 calculations.
That said, the theory, methodological practice, and related topics of the Laplace Transform have continued to flourish. They are still used widely in areas where linear second order differential equations appear, and advances in Computer Algebra Systems (such as GeoGebra's) have made them much more wieldy to work with. Furthermore, the core idea of the Laplace Transform--transforming a problem from one domain into another where the problem is easier--has turned out to be the seed of a much wider trend in mathematics and computing to systematically transform hard problems in one area into easier problems in another. This "transform style" of thinking has led to other transforms (the Fourier Transform standing out amongst them) that have found exciting applications in computer data compression and digital signal processing, to name a few. Unfortunately we won't have a chance to explore these applications in this course.
So even if the Laplace Transform is a bit dated, its importance in the pantheon of 20th Century mathematics makes it worth studying.
Moving Forward
In what follows we'll skip all the details of the algebraic theory of the Laplace Transform, and simply focus on the practice of applying this method to higher order IVPs.
It's not that the theory isn't interesting; it's that it's just that: theory. I'd rather we focus on how to do something than learning about something.
In particular, we'll see how to use GeoGebra's Computer Algebra System (CAS) to perform many of the grueling steps of the method. Throughout this lesson, we'll stick to second order differential equations. Everything works very similarly for higher order equations, but we won't cover that here.
All the gory details of the theory of the method can be found here. In particular, note that we will use GeoGebra to replicate the solution of Example 2 here. In particular, I recommend you at least take a look at Example 2 in that link; the author does all the algebra "by hand", and needless to say it's a lot of algebra. You should look over Example 2 enough to realize that by availing ourselves of a CAS we'll get rid of a tremendous amount of algebra, and boil this process down to some pretty routine and prosaic steps.
The Method
Given a linear second order differential equation with initial values
follow these steps (and use GeoGebra's CAS and Algebra tools) to obtain the specific solution function:
- Use the formulas for the Laplace transform of and below to transform the left hand side of the differential equation by hand. Be sure to enter and as appropriate*.
- In row 1** of the GeoGebra CAS use the
Laplace()
command to transform , the right hand side of the differential equation. Be sure your result is reported as a function of . You now have the left and right hand sides of the differential equation transformed. Congratulations! - Set the result of step 1 and step 2 equal to each other. This is the Laplace transformation of the differential equation. By hand, solve the Laplace transformation for . Don't bother with any simplifications (the CAS will do them later). This should only involve Algebra 1 level skills.
- In row 2 in the CAS, simplify the formula for as a function of , with
Simplify()
- In row 3 in the CAS, apply
InverseLaplace()
to row 2. Note that you can reference row 2 with$2
. - This is the the solution of your Initial Value Problem. Copy the result to your clipboard, paste it in the input bar, and declare it as a new function
f(t)
. This is your specific solution of the differential equation and initial values. - Use the GeoGebra Algebra Pane (you may need to re-open the pane if you're using GeoGebra Desktop) to calculate the derivatives of
f
, check thatf
is a solution of the differential equation, and check thatf
agrees the values specified by the given initial conditions.
Example
Let's go step by step through solving the initial value problem
with the Laplace transform and the GeoGebra CAS. Note that and . Also note that this example can be found as Example 2 here, where all the algebra we skip is done in full 3-part harmony.
1.
First we need to transform the left hand side:
Now plug in and
2.
Now we need to use GeoGebra's CAS to transform the right hand . Note that you must use
exp()
for e in the CAS.
The code is Laplace(t*exp(-2*t))
3.
We now need to do a little work by hand. Set the result of step 1 and step 2 equal to each other to obtain the so-called Laplace transformation
Now we need to solve this for . This might seem hard, but it only actually involves Algebra 1. In summary we need to: distribute the 2, the 3, and the -2; combine like terms; isolate . One way of doing the Algebra is:
DO NOT bother simplifying this when planning to use a CAS.
4.
Now we need to ask the CAS in GeoGebra to simplify . This step actually isn't essential, but I like to do it to be sure I type in accurately. Careful with parentheses! :)
5.
Now we need to calculate the inverse Laplace Transform of this to translate the algebraic representation of the differential equation back to the realm of differential equations. In practice though, this is easy with GeoGebra's CAS. Just type
InverseLaplace($2)
to apply the inverse Laplace transformation to the result of row 2 in the CAS.
Note: if you were to do this by hand, you'd need to do a partial fraction decomposition, and you'd have to plan to spend around 20 minutes doing so. See Example 2 here for the gory details! If you want, feel free to try out PartialFractions()
on row 2 (you can reference row 2 with $2
) to see the results of this intermediate step. That said, we don't need to do this when using the CAS because GeoGebra can apply InverseLaplace()
in the next step without a partial fraction decomposition.6.
Voila! This is our solution! Very cool! Right click on the output of row 3, and copy the result. Paste it into the input bar to declare it as
f(t)
in the Algebra window. (Note: you may need to open the Algebra window.)
Here's the exact code for this example:
f(t)=(-96 / 125 * ℯ^((1 / 2 * t))) + (((-25 * t^(2)) - (20 * t) + 192) / 250 * ℯ^((-2 * t)))
In the applet below, I've opened the Algebra window, and also made the normal input bar available again. I've also declared f(t)
.7.
Finally let's check our work. After all, we want to be sure that this function solves the differential equation and agrees with the initial values we started with:
As usual, this means we calculate the derivatives of f with
Derivative(f)
and
Derivative(f,2)
Then check that
Simplify(2*f''+3f'-2f-t*e^(-2*t))
is equal to 0. And finally, that
f(0)
is equal to 0, and
f'(0)
is equal to -2. If not, then something went wrong! Luckily nothing went wrong here.
Closing Remarks
Obviously there's a LOT going on here!
Totally normal questions to have are:
- What the heck is the Laplace Transform in steps 1 and 2?
- What the heck is the inverse Laplace Transform in step 5?!
- How do I calculate these things without a CAS?
- Why does this all work so darn well?
- How did Pierre-Simon Laplace and Oliver Heaviside come up with this?