Edit Article

wikiHow to Solve Differential Equations Using Laplace Transforms

The Laplace transform is an integral transform that is widely used to solve linear differential equations with constant coefficients. When such a differential equation is transformed into Laplace space, the result is an algebraic equation, which is much easier to solve. Furthermore, unlike the method of undetermined coefficients, the Laplace transform can be used to directly solve for functions given initial conditions. It is for these reasons that the Laplace transform is often used to solve such equations.

Preliminaries

• In this article, we will use ${\displaystyle Y(s)}$ to denote the function ${\displaystyle y(t)}$ in Laplace space.
• ${\displaystyle Y(s)=\int _{0}^{\infty }y(t)e^{-st}{\mathrm {d} }t}$
• A few properties of the Laplace transform will be listed below. It is also assumed that you have a table of Laplace transforms with you.
• ${\displaystyle {\mathcal {L}}\{y^{\prime }(t)\}=sY(s)-y(0)}$
• ${\displaystyle {\mathcal {L}}\{y^{\prime \prime }(t)\}=s^{2}Y(s)-sy(0)-y^{\prime }(0)}$
• Notice that these derivatives encode the information about the initial conditions into the algebraic equation.

Part 1 Example 1

1. 1
Solve the differential equation given initial conditions. ${\displaystyle y}$ and its derivatives only depend on ${\displaystyle t.}$
• ${\displaystyle y^{\prime \prime }+5y^{\prime }+6y=\cos t;\ \ y(0)=1,\ y^{\prime }(0)=0}$
2. 2
Take the Laplace transform of both sides. Using the properties of the Laplace transform, we can transform this constant coefficient differential equation into an algebraic equation.
• {\displaystyle {\begin{aligned}s^{2}Y-sy(0)-y^{\prime }(0)+5(sY-y(0))+6Y&={\frac {s}{s^{2}+1}}\\s^{2}Y-s+5sY-5+6Y&={\frac {s}{s^{2}+1}}\end{aligned}}}
3. 3
Solve for ${\displaystyle Y(s)}$. Simplify and factor the denominator to prepare for partial fraction decomposition.
• {\displaystyle {\begin{aligned}Y&={\frac {{\frac {s}{s^{2}+1}}+s+5}{s^{2}+5s+6}}\\&={\frac {s}{(s^{2}+1)(s+3)(s+2)}}+{\frac {s+5}{(s+3)(s+2)}}\end{aligned}}}
4. 4
Decompose the solution into its partial fractions. This process can be long-winded, but there are ways to streamline this process. Because partial fractions are inevitably going to show up while working in Laplace space, we will detail the entire process into solving for each coefficient.
• First, let's work with the first fraction, the harder one. This fraction can be written in terms of four coefficients.
• ${\displaystyle {\frac {s}{(s^{2}+1)(s+3)(s+2)}}={\frac {As+B}{s^{2}+1}}+{\frac {C}{s+3}}+{\frac {D}{s+2}}}$
• ${\displaystyle C}$ and ${\displaystyle D}$ can easily be solved for. To solve for ${\displaystyle C,}$ we multiply both sides by ${\displaystyle (s+3)}$ and substitute ${\displaystyle s=-3.}$ By doing so, we will be evaluating the "reduced fraction" on the left, while ${\displaystyle C}$ on the right side becomes isolated as the other terms vanish. ${\displaystyle D}$ can be found in a similar manner. In general, such coefficients can be found by multiplying by the factor in the denominator and substituting that root. This is an excellent way to avoid solving a system of equations.
• ${\displaystyle C={\frac {s}{(s^{2}+1)(s+2)}}{\Bigg |}_{s=-3}={\frac {3}{10}}}$
• ${\displaystyle D={\frac {s}{(s^{2}+1)(s+3)}}{\Bigg |}_{s=-2}=-{\frac {2}{5}}}$
• ${\displaystyle B}$ can be found by multiplying both sides by ${\displaystyle (s^{2}+1)}$ and choosing ${\displaystyle s=0.}$
• ${\displaystyle 0=B+{\frac {C}{3}}+{\frac {D}{2}}}$
• ${\displaystyle B={\frac {1}{10}}}$
• ${\displaystyle A}$ is a bit trickier to find. We first get rid of the denominators to both sides. Then, we recognize that ${\displaystyle A}$ is a coefficient of ${\displaystyle s^{3}.}$ The other ${\displaystyle s^{3}}$ terms will have ${\displaystyle C}$ and ${\displaystyle D}$ in them. Now, notice that the left side has no cubic term. Therefore, we can say that ${\displaystyle A+C+D=0.}$
• {\displaystyle {\begin{aligned}s=As(s+3)(s+2)&+B(s+3)(s+2)\\&+C(s+2)(s^{2}+1)\\&+D(s+3)(s^{2}+1)\end{aligned}}}
• ${\displaystyle A=-C-D={\frac {1}{10}}}$
• The same process in finding ${\displaystyle C}$ and ${\displaystyle D}$ can be used to find the coefficients of the partial fractions for the second fraction. In general, this idea of substituting, differentiating (for fractions with repeated roots), or equating coefficients can be used to efficiently find partial fraction decompositions. Of course, such efficiency takes practice, and if you need to double-check your work, going back to the system of equations is another option.
• ${\displaystyle {\frac {s+5}{(s+3)(s+2)}}={\frac {E}{s+3}}+{\frac {F}{s+2}}}$
• ${\displaystyle E=-2,\ F=3}$
5. 5
Write out the solution in terms of its partial fraction decomposition. We now have the coefficients, so we can now simplify the solution.
• {\displaystyle {\begin{aligned}Y&={\frac {1}{10}}{\frac {s+1}{s^{2}+1}}+{\frac {3/10}{s+3}}+{\frac {-2/5}{s+2}}+{\frac {-2}{s+3}}+{\frac {3}{s+2}}\\&={\frac {1}{10}}{\frac {s+1}{s^{2}+1}}+{\frac {-17/10}{s+3}}+{\frac {26/10}{s+2}}\end{aligned}}}
6. 6
Write out the solution in physical space. Now, we can finally transform back from Laplace space. We are lucky because our terms are all written such that we can find the functions in physical space by looking at a table of Laplace transforms. In general, taking inverse Laplace transforms is no joke, and requires a fair bit of knowledge of complex analysis (the Bromwich integral is a contour integral typically done using residue theory).
• ${\displaystyle y(t)={\frac {1}{10}}\cos t+{\frac {1}{10}}\sin t-{\frac {17}{10}}e^{-3t}+{\frac {13}{5}}e^{-2t}}$

Part 2 Example 2: Damped Harmonic Oscillator

1. 1
Find the equation of motion of an object exhibiting simple harmonic motion with a resistive force. In physics, the equation of an object undergoing simple harmonic motion with no resistance is given by ${\displaystyle m{\ddot {x}}+m\omega ^{2}x=0,}$ where ${\displaystyle \omega }$ is the angular frequency of oscillation, and the number of dots specifies the number of derivatives (Newton's notation for derivatives). Of course, in real life, there will always be some form of resistance. In this example, the resistive force is assumed to be proportional to velocity ${\displaystyle F=-m\beta {\dot {x}},}$ where ${\displaystyle \beta }$ is a constant. Our initial conditions are a displacement of 1 from equilibrium at rest. By using Newton's second law, we can write the differential equation in the following manner. Notice that the presence of mass ${\displaystyle m}$ in each of the terms means that our solution must eventually be independent of ${\displaystyle m.}$
• ${\displaystyle m{\ddot {x}}+2m\beta {\dot {x}}+m\omega ^{2}x=0,\ \ x(0)=1,\ {\dot {x}}(0)=0}$
• ${\displaystyle {\ddot {x}}+2\beta {\dot {x}}+\omega ^{2}x=0}$
2. 2
Take the Laplace transform of both sides, and solve for ${\displaystyle X(s)}$.
• ${\displaystyle s^{2}X-s+2\beta sX-2\beta +\omega ^{2}X=0}$
• ${\displaystyle X(s)={\frac {s+2\beta }{s^{2}+2\beta s+\omega ^{2}}}}$
3. 3
Rewrite the denominator by completing the square. The purpose of this is to obtain a result from which we can look at a table of Laplace transforms and find the function in physical space by inspection. Of course, to compensate for the added ${\displaystyle \beta ^{2}}$ term, we need to subtract that so that we are "adding 0."
• ${\displaystyle X={\frac {s+2\beta }{(s+\beta )^{2}+\omega ^{2}-\beta ^{2}}}}$
4. 4
Write out the solution in physical space. From the numerator, it is obvious that this is going to be a sum of a cosine and sine term. From the ${\displaystyle (s+\beta )^{2}}$ in the denominator, it is obvious that both of these terms will be multiplied by an exponential term (in fact, an exponential decay term ${\displaystyle e^{-\beta t}}$). In order to see the two contributions more clearly, we can rewrite the numerator as ${\displaystyle (s+\beta )+\beta .}$
• ${\displaystyle x(t)=e^{-\beta t}\cos \left({\sqrt {\omega ^{2}-\beta ^{2}}}\,t\right)+{\frac {\beta }{\sqrt {\omega ^{2}-\beta ^{2}}}}e^{-\beta t}\sin \left({\sqrt {\omega ^{2}-\beta ^{2}}}\,t\right)}$
• This example has shown us that the method of Laplace transforms can be used to solve homogeneous differential equations with initial conditions without taking derivatives to solve the system of equations that results. However, it is a good idea to check your answer by solving the differential equation using the standard ansatz method.

Part 3 Example 3: Driven Harmonic Oscillator

1. 1
Find the equation of motion of an object exhibiting harmonic motion with a resistive force and a driven force. The previous example serves as a prelude for this more complicated problem. Now, we add a driving force ${\displaystyle F=A\sin \omega t,}$ where ${\displaystyle A}$ is the amplitude and ${\displaystyle \omega }$ is the frequency of the driving force. Our differential equation is now modified to be inhomogeneous with more general initial conditions. We denote ${\displaystyle \omega _{0}}$ to be the frequency of the oscillator free of the driving force.
• ${\displaystyle {\ddot {x}}+2\beta {\dot {x}}+\omega _{0}^{2}x=A\sin \omega t,\ \ x(0)=x_{0},\ {\dot {x}}(0)=v_{0}}$
2. 2
Take the Laplace transform of both sides, and solve for ${\displaystyle X(s)}$. We split the answer into two pieces. The first fraction is easy, and we will transform that back into physical space at the end of this problem. The second fraction is a bit more complicated (to say the least).
• ${\displaystyle s^{2}X-sx_{0}-v_{0}+2\beta sX-2\beta x_{0}+\omega _{0}^{2}X={\frac {A\omega }{s^{2}+\omega ^{2}}}}$
• ${\displaystyle X(s)={\frac {sx_{0}+2\beta x_{0}+v_{0}}{(s+\beta )^{2}+\omega _{0}^{2}-\beta ^{2}}}+{\frac {A\omega }{((s+\beta )^{2}+\omega _{0}^{2}-\beta ^{2})(s^{2}+\omega ^{2})}}}$
3. 3
Consider the second fraction without ${\displaystyle A\omega }$ and write its partial fraction decomposition. ${\displaystyle A\omega }$ can be treated as a constant. Notice that ${\displaystyle B}$ is being multiplied by ${\displaystyle (s+\beta ),}$ which should be the case because the denominator contains a ${\displaystyle (s+\beta )}$ term important for getting the ${\displaystyle e^{-\beta t}}$ out when we transform back.
• ${\displaystyle {\frac {1}{((s+\beta )^{2}+\omega _{0}^{2}-\beta ^{2})(s^{2}+\omega ^{2})}}={\frac {B(s+\beta )+C}{(s+\beta )^{2}+\omega _{0}^{2}-\beta ^{2}}}+{\frac {Ds+E}{s^{2}+\omega ^{2}}}}$
4. 4
Get rid of the denominators. Equate the coefficients first.
• {\displaystyle {\begin{aligned}1&=B(s+\beta )(s^{2}+\omega ^{2})+C(s^{2}+\omega ^{2})\\&+Ds((s+\beta )^{2}+\omega _{0}^{2}-\beta ^{2})+E((s+\beta )^{2}+\omega _{0}^{2}-\beta ^{2})\end{aligned}}}
• From this result, we clearly see by equating the cubic terms ${\displaystyle s^{3},}$ we obtain ${\displaystyle B+D=0.}$
5. 5
Substitute ${\displaystyle s=i\omega }$ to get rid of the ${\displaystyle (s^{2}+\omega ^{2})}$ terms. Remember that ${\displaystyle s}$ is, in general, a complex number. Since ${\displaystyle s}$ is involved in a sum of squares, we recognize that if ${\displaystyle s}$ is purely imaginary, such a term will vanish. This causes both ${\displaystyle B}$ and ${\displaystyle C}$ to vanish. Then we obtain a system of equations because we can equate the real and imaginary components. This gets us ${\displaystyle D}$ and ${\displaystyle E}$ simultaneously. This also gets us ${\displaystyle B}$ because ${\displaystyle B=-D.}$
• ${\displaystyle 1=Di\omega (\omega _{0}^{2}-\omega ^{2}+2i\omega \beta )+E(\omega _{0}^{2}-\omega ^{2}+2i\omega \beta )}$
• ${\displaystyle {\begin{cases}0=D\omega (\omega _{0}^{2}-\omega ^{2})+2E\omega \beta \\1=E(\omega _{0}^{2}-\omega ^{2})-2D\omega ^{2}\beta \end{cases}}}$
• ${\displaystyle E={\frac {\omega _{0}^{2}-\omega ^{2}}{(\omega _{0}^{2}-\omega ^{2})^{2}+4\beta ^{2}\omega ^{2}}}}$
• ${\displaystyle D={\frac {-2\beta }{(\omega _{0}^{2}-\omega ^{2})^{2}+4\beta ^{2}\omega ^{2}}}}$
• ${\displaystyle B={\frac {2\beta }{(\omega _{0}^{2}-\omega ^{2})^{2}+4\beta ^{2}\omega ^{2}}}}$
6. 6
Substitute ${\displaystyle s=-\beta }$ to obtain ${\displaystyle C}$. The reason for this is simple - ${\displaystyle B}$ vanishes, and the other terms simplify. Then substitute the results for ${\displaystyle D}$ and ${\displaystyle E.}$ This coefficient is the most laborious to obtain, but the goal here is to write all terms on the right side in terms of ${\displaystyle (\omega ^{2}+\beta ^{2}).}$
• ${\displaystyle 1=C(\beta ^{2}+\omega ^{2})+(\omega _{0}^{2}-\beta ^{2})(E-\beta D)}$
• {\displaystyle {\begin{aligned}C(\beta ^{2}+\omega ^{2})&=1-{\frac {(\omega _{0}^{2}-\omega ^{2}+2\beta ^{2})(\omega _{0}^{2}-\beta ^{2})}{(\omega _{0}^{2}-\omega ^{2})^{2}+4\beta ^{2}\omega ^{2}}}\\&={\frac {\omega ^{4}+3\omega ^{2}\beta ^{2}-\omega ^{2}\omega _{0}^{2}-\omega _{0}^{2}\beta ^{2}+2\beta ^{4}}{(\omega _{0}^{2}-\omega ^{2})^{2}+4\beta ^{2}\omega ^{2}}}\\&={\frac {(\omega ^{2}+\beta ^{2}-\beta ^{2})^{2}+3(\omega ^{2}+\beta ^{2}-\beta ^{2})\beta ^{2}+2\beta ^{4}-\omega _{0}^{2}(\omega ^{2}+\beta ^{2})}{(\omega _{0}^{2}-\omega ^{2})^{2}+4\beta ^{2}\omega ^{2}}}\\&={\frac {(\omega ^{2}+\beta ^{2})^{2}+\beta ^{2}(\omega ^{2}+\beta ^{2})-\omega _{0}^{2}(\omega ^{2}+\beta ^{2})}{(\omega _{0}^{2}-\omega ^{2})^{2}+4\beta ^{2}\omega ^{2}}}\end{aligned}}}
• ${\displaystyle C={\frac {\omega ^{2}-\omega _{0}^{2}+2\beta ^{2}}{(\omega _{0}^{2}-\omega ^{2})^{2}+4\beta ^{2}\omega ^{2}}}}$
7. 7
Transform back into physical space. (Of course, transform back using the coefficients, not their explicit forms! Remember to multiply by ${\displaystyle A\omega ,}$ since we omitted that when finding the coefficients.) This solution is fairly complicated, and it seems unusual that the simple addition of a sinusoidal driving force would end up complicating the motion to this degree. Unfortunately, this is what the math tells us. What we have found in this section is that, while the process of obtaining this solution took a lot of algebra, our only steps that involved some resemblance of calculus were the Laplace transforms both to and from Laplace space. The rest was simply finding the coefficients of the partial fractions.
• {\displaystyle {\begin{aligned}x(t)&=x_{0}e^{-\beta t}\cos \left({\sqrt {\omega _{0}^{2}-\beta ^{2}}}\,t\right)+{\frac {\beta x_{0}+v_{0}}{\sqrt {\omega _{0}^{2}-\beta ^{2}}}}e^{-\beta t}\sin \left({\sqrt {\omega _{0}^{2}-\beta ^{2}}}\,t\right)\\&+{\frac {2A\omega \beta }{(\omega _{0}^{2}-\omega ^{2})^{2}+4\omega ^{2}\beta ^{2}}}e^{-\beta t}\cos \left({\sqrt {\omega _{0}^{2}-\beta ^{2}}}\,t\right)\\&+{\frac {A\omega }{\sqrt {\omega _{0}^{2}-\beta ^{2}}}}{\frac {\omega ^{2}-\omega _{0}^{2}+2\beta ^{2}}{(\omega _{0}^{2}-\omega ^{2})^{2}+4\omega ^{2}\beta ^{2}}}e^{-\beta t}\sin \left({\sqrt {\omega _{0}^{2}-\beta ^{2}}}\,t\right)\\&+{\frac {-2A\omega \beta }{(\omega _{0}^{2}-\omega ^{2})^{2}+4\omega ^{2}\beta ^{2}}}\cos \omega t+{\frac {A(\omega _{0}^{2}-\omega ^{2})}{(\omega _{0}^{2}-\omega ^{2})^{2}+4\omega ^{2}\beta ^{2}}}\sin \omega t\end{aligned}}}
• Luckily, this solution is very general. There are many interesting properties of this physical system that we can gleam by analyzing this solution. However, since such analysis is not relevant to Laplace transforms anymore, we will not go into it here.
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 103, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}