[Math] Inverse Laplace Transfrom using sympy

laplace transformpython

I have just started learning about Laplace Transforms and taking Inverse of Laplace Transforms.

After finding the inverse of a Laplace Transform, I am using sympy to check my results.

My results seem to be matching, but the sympy results also contain a $\theta(t)$ function appended to each function. After going through the docs I found that sympy uses the following definition for the Inverse Laplace Transform:
$$
f(t) = \int_{c-i\infty}^{c+i\infty} e^{st} F(s) \mathrm{d}s
$$
while I have been computing the inverse Laplace transform by pattern matching using the Unilateral Laplace Transforms.

Is the $\theta(t)$ term appearing due to this discrepancy? Also, what does the $\theta(t)$ function represent?

Here is a screenshot of my code:

sympy code

Best Answer

Actually, the inverse LT is defined as

$$f(t) = \frac1{i 2 \pi} \int_{c-i \infty}^{c+i \infty} ds \, F(s) \, e^{s t} $$

There is good reason for the $\theta(t)$ being included in the results: causality. For a unilateral LT, the functions are defined only for $t \gt 0$. Thus, in the definition of the inverse LT, $c$ is defined such that it is greater than the largest real part of any of the poles of $F$. Thus, to compute the inverse LT via the residue theorem, we close a contour to the left of the line of integration; such a contour may only be used when $t \gt 0$. When $t \lt 0$, we must close to the right where, by definition, there are no poles and hence the inverse is zero. The function $\theta(t)$, also known as the Heaviside step function, is equal to zero for $t \lt 0$ and one for $t \gt 0$.