An improved Maxima function for inverse Laplace transform

Maxima has a fairly serviceable Laplace transform utility built-in.  Here’s an example from the popular ordinary differential equations book by Blanchard, Devaney and Hall:

laplace1

Trouble arises when we look at discontinuous forcing functions, which is especially sad because it seems to me that’s what makes it worthwhile to spend time with Laplace transforms.  In particular, the inverse transform function ilt() fails on the Heaviside Function and Dirac Delta, even though the built-in laplace() treats them correctly:

laplace2

So, I’ve written an alternative inverse Laplace function laplaceInv() that fixes that problem:

laplace3

Here are a few differential equation solutions to show how the new function behaves:

A second-order linear equation with a constant forcing function that vanishes at t=7

laplace6

laplace7

A second-order equation with two impulsive forces:

laplace4

laplace5

The new Laplace transform Maxima function can be downloaded here.