Solving Differential Equations with the Method of Laplace TransformsPart Iby Karen Donnellykarend@saintjoe.eduSaint Joseph's CollegeAll Rights ReservedIntroductionThe Method of Laplace Transforms is useful for solving initial value problems involving linear, constant coefficient equations. Laplace transforms is that derivatives are transformed into powers transforming the differential equation into an algebraic equation, which can be solved by simple algebraic techniques. The inverse Laplace transform is applied to then give the corresponding function which is a solution to the differential equation.Useful Maple commands for computing Laplace Transforms and their inverses in this process include:
alias define another name for a Maple expressionlaplace apply the Laplace transform (inttrans library)
invlaplace apply the inverse Laplace transform (inttrans library)
convert(..., parfrac, s) compute the partial fraction decomposition of an expression
collect collect like termscombine combine sums, products, powers into a single termcompletesquare complete the square of a polynomial of degree 2Heaviside the unit step function -- we alias as u(t)Useful in checking our computations are dsolve solve differential equationsubs substitute solution in to the differential equationodetest test solution for correctnessLUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2I1EhRictRiM2Iy1GLDYlUShyZXN0YXJ0RicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnRis=Load the inttrans library with the Laplace and inverse Laplace transform functions.LUkld2l0aEc2IjYjSSlpbnR0cmFuc0dGJA==To make our work easier to read, we make Y(s) denote the Laplace transform of y(t):LUkmYWxpYXNHJSpwcm90ZWN0ZWRHNiMvLUkiWUc2IjYjSSJzR0YpLUkobGFwbGFjZUdGKTYlLUkieUdGKTYjSSJ0R0YpRjJGKw==First Example LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2I1EhRictRiM2J0YrLUYjNilGKy1GIzYmLUkmbWZyYWNHRiQ2KC1GIzYjLUklbXN1cEdGJDYlLUkjbW9HRiQ2LVEwJkRpZmZlcmVudGlhbEQ7RicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLyUmZmVuY2V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XNsaWJHRiRGLSIjNw==PkkjSUNHNiI2JC8tSSJ5R0YkNiMiIiEhIiIvLS1JIkRHNiQlKnByb3RlY3RlZEdJKF9zeXNsaWJHRiQ2I0YoRikiIig=We ask Maple to solve using the method of Lapace transforms -- so we know what answer we SHOULD get: LUknZHNvbHZlRzYiNiU8JEkkT0RFR0YkSSNJQ0dGJC1JInlHRiQ2I0kidEdGJC9JJ21ldGhvZEdGJEkobGFwbGFjZUdGJA==LUkoY29udmVydEclKnByb3RlY3RlZEc2JEkiJUc2IkkkZXhwRzYkRiRJKF9zeXNsaWJHRic=Breaking down into steps that we would perform by hand. Step 1: Apply the Laplace transform to the entire equation. (You should confirm by hand that this is the correct transform)PkkoT0RFX2xhcEc2Ii1JKGxhcGxhY2VHRiQ2JUkkT0RFR0YkSSJ0R0YkSSJzR0YkStep 2: Substitute in the initial conditions into the differential equation.PkkoT0RFX2xhcEc2Ii1JJXN1YnNHJSpwcm90ZWN0ZWRHNiRJI0lDR0YkRiM=Step 3: Next, explicitly solve for the Laplace transform Y(s) of the solution. (Again you should verify by hand that this is the correct Y(s).)PkkpU09MTl9sYXBHNiItSSZzb2x2ZUc2JCUqcHJvdGVjdGVkR0koX3N5c2xpYkdGJDYkSShPREVfbGFwR0YkPCMtSSJZR0YkNiNJInNHRiQ=Step 4: Now we will want to find the inverse of this Laplace transform. Since the right hand side above is a rational expression, we can expand the right hand side using the method of partial fractions via Maple's convert / parfrac command.PkkpU09MTl9sYXBHNiItSShjb252ZXJ0RyUqcHJvdGVjdGVkRzYlRiNJKHBhcmZyYWNHRiRJInNHRiQ=Step 5: Now we have our solution "Y(s)" -- Compute the inverse Laplace transform using invlaplace to get our solution y(t) to the initial value problem. PkklU09MTkc2Ii1JK2ludmxhcGxhY2VHRiQ2JUkpU09MTl9sYXBHRiRJInNHRiRJInRHRiQ=Note: If we were computing the inverse Laplace transform using a table of transforms, we would have likely written the answer in terms of the exponential function -- we can convert the above solution to this form with convert.PkklU09MTkc2Ii1JKGNvbnZlcnRHJSpwcm90ZWN0ZWRHNiRGI0kkZXhwRzYkRidJKF9zeXNsaWJHRiQ=The above corresponds to what we would get in a term by term computation of the inverse Laplace transform from the Y(s) in step 4:LCgtSStpbnZsYXBsYWNlRzYiNiUqJCwmSSJzR0YlIiIiISIiRipGK0YpSSJ0R0YlRiotRiQ2JSokLCZGKUYqIiImRipGK0YpRixGKy1GJDYlKiQsJkYpRipGKkYqRitGKUYsRis=Step 6: Test your solution -- With Maple you can use odetest or substitute the solution into the differential equation with the subs command.LUkob2RldGVzdEc2IjYlSSVTT0xOR0YkPCRJJE9ERUdGJEkjSUNHRiQtSSJ5R0YkNiNJInRHRiQ=QyQtSSVzdWJzRyUqcHJvdGVjdGVkRzYkSSVTT0xORzYiSSRPREVHRigiIiI=LUklZXZhbEclKnByb3RlY3RlZEc2I0kiJUc2Ig==Second Example LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2I1EhRictRiM2J0YrLUYjNilGKy1GIzYmLUkmbWZyYWNHRiQ2KC1GIzYjLUklbXN1cEdGJDYlLUkjbW9HRiQ2LVEwJkRpZmZlcmVudGlhbEQ7RicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLyUmZmVuY2VHUSZmYWxzZUYnLyUqc2VwYXJhdG9yR0ZGLyUpc3RyZXRjaHlHRkYvJSpzeW1tZXRyaWNHRkYvJShsYXJnZW9wR0ZGLyUubW92YWJsZWxpbWl0c0dGRi8lJ2FjY2VudEdGRi8lJ2xzcGFjZUdRJjAuMGVtRicvJSdyc3BhY2VHRlUtSSNtbkdGJDYkUSIyRidGQS8lMXN1cGVyc2NyaXB0c2hpZnRHUSIwRictRiM2JUYrLUYjNiRGPS1GOzYlLUYsNiVRInRGJy8lJ2l0YWxpY0dRJXRydWVGJy9GQlEnaXRhbGljRidGWEZmbkYrLyUubGluZXRoaWNrbmVzc0dRIjFGJy8lK2Rlb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JldGNoeUdGRi8lKnN5bW1ldHJpY0dGRi8lKGxhcmdlb3BHRkYvJS5tb3ZhYmxlbGltaXRzR0ZGLyUnYWNjZW50R0ZGLyUnbHNwYWNlR1EmMC4wZW1GJy8lJ3JzcGFjZUdGVS1JKG1mZW5jZWRHRiQ2JC1GIzYjLUkjbW5HRiQ2JFEiMEYnRkJGQi1GPzYtUSI9RidGQkZERkdGSUZLRk1GT0ZRL0ZUUSwwLjI3Nzc3NzhlbUYnL0ZXRl9vRmduLUY/Ni1RIixGJ0ZCRkQvRkhGOkZJRktGTUZPRlFGUy9GV1EsMC4zMzMzMzMzZW1GJy1GIzYmRistRiM2JkYrLUYjNiUtRiw2JVEiREYnL0Y5RkZGQkY+LUZZNiQtRiM2I0Y1RkJGPkZYRltvLUZobjYkUSIzRidGQkYrRis=Step 0: Define the differential equation to be solved (ODE) along with initial conditions (IC).PkkkT0RFRzYiLywoLUklZGlmZkclKnByb3RlY3RlZEc2JS1JInlHRiQ2I0kidEdGJEYuRi4iIiItRig2JEYrRi4iIiNGKyIiJiwkKiYtSSRleHBHNiRGKUkoX3N5c2xpYkdGJDYjLCRGLiEiIkYvLUkkc2luR0Y4Ri1GLyIiJA==PkkjSUNHNiI2JC8tSSJ5R0YkNiMiIiFGKi8tLUkiREc2JCUqcHJvdGVjdGVkR0koX3N5c2xpYkdGJDYjRihGKSIiJA==LUknZHNvbHZlRzYkJSpwcm90ZWN0ZWRHSShfc3lzbGliRzYiNiU8JEkkT0RFR0YnSSNJQ0dGJy1JInlHRic2I0kidEdGJy9JJ21ldGhvZEdGJ0kobGFwbGFjZUdGJw==Step 1: Apply the Laplace transform to the entire equation. PkkoT0RFX2xhcEc2Ii1JKGxhcGxhY2VHRiQ2JUkkT0RFR0YkSSJ0R0YkSSJzR0YkStep 2: Substitute in the initial conditions into the differential equation. PkkoT0RFX2xhcEc2Ii1JJXN1YnNHJSpwcm90ZWN0ZWRHNiRJI0lDR0YkRiM=Step 3: Solve for the Laplace transform Y(s) of the solution. PkkpU09MTl9sYXBHNiItSSZzb2x2ZUc2JCUqcHJvdGVjdGVkR0koX3N5c2xpYkdGJDYkSShPREVfbGFwR0YkPCMtSSJZR0YkNiNJInNHRiQ=Step 4: Expand the right hand side using the method of partial fractions.PkkpU09MTl9sYXBHNiItSShjb252ZXJ0RyUqcHJvdGVjdGVkRzYlRiNJKHBhcmZyYWNHRiRJInNHRiQ=In this case it is helpful to complete the square on Y(s) if determining the inverse Laplace transform from a table -- Maple can do this with the student[completesquare] function.QyQtSSV3aXRoRzYkJSpwcm90ZWN0ZWRHSShfc3lzbGliRzYiNiNJKHN0dWRlbnRHRiUiIiI=PkkpU09MTl9sYXBHNiItSS9jb21wbGV0ZXNxdWFyZUdGJDYkRiNJInNHRiQ=Step 5: Compute the inverse Laplace transform of Y(s) to get solution y(t) to the initial value problem. LCYtSStpbnZsYXBsYWNlRzYiNiUsJCokLCYqJCwmSSJzR0YlIiIiRi1GLSIiI0YtIiIlRi0hIiJGLkYsSSJ0R0YlRi0tRiQ2JSokLCZGKkYtRi1GLUYwRixGMUYtPkklU09MTkc2Ii1JK2ludmxhcGxhY2VHRiQ2JUkpU09MTl9sYXBHRiRJInNHRiRJInRHRiQ=Step 6: Test your solution -- With Maple you can use odetest or substitute the solution into the differential equation with the subs command.LUkob2RldGVzdEc2JCUqcHJvdGVjdGVkR0koX3N5c2xpYkc2IjYlSSVTT0xOR0YnPCRJJE9ERUdGJ0kjSUNHRictSSJ5R0YnNiNJInRHRic=LUklc3Vic0clKnByb3RlY3RlZEc2JEklU09MTkc2IkkkT0RFR0YnLUklZXZhbEclKnByb3RlY3RlZEc2I0kiJUc2Ig==LUkoY29tYmluZUc2JCUqcHJvdGVjdGVkR0koX3N5c2xpYkc2IjYjSSIlR0YnJSFH