Skip to content
DeepForgeby svx
All problems
HardCalculusca-093

Inverse Laplace Two Poles

Problem

The inverse Laplace transform of F(s) = 1 / ((s - a) * (s - b)) with a != b is

f(t) = (e^(a*t) - e^(b*t)) / (a - b)

This comes from partial fractions. Given a, b, and t, return f(t).

Hint

Split 1 / ((s-a)(s-b)) into two simple poles before inverting.

Test cases

case 1
in: [1,-2,0]
expected: 0
case 2
in: [1,-2,1]
expected: 0.8609821817408108
case 3
in: [0,-1,1]
expected: 0.6321205588285577
case 4
in: [1,3,2]
expected: 198.01986869690222
Starter codePython
def inverse_laplace_two_poles(a, b, t):
    # Your code here
    pass

4 test cases · run your code against them in the editor