Bromwich integral transformed to an integral on the real axis

113 Views Asked by At

I am new in complex integration and inverse Laplace transforms.

The author of a textbook claims that the inverse Laplace transform has expression $$ f(t) = \frac{2\exp(bt)}{\pi}\int_0^\infty\Re\bigl(\hat{f}(b+iu)\bigr)\cos(ut)\,\mathrm{d}u. $$ He obtains this formula by substituting $s = b+iu$ in the Bromwich integral $$ f(t) = \frac{1}{2\pi i}\int_{b-i\infty}^{b+i\infty}\exp(st)\hat{f}(s)\,\mathrm{d}s. $$ However I've numerically checked this formula and it doesn't seem to hold true:

fhat <- function(s) 1/(s+3) # Laplace transform of exp(-3x)
b <- 5 
integrand <- function(u, x){
  Re(fhat(b+1i*u))*cos(x*u)
}
x <- 2 
2*exp(b*x)/pi * integrate(integrand, 0, Inf, x = x, subdivisions = 10000)$value
# -0.1124648
exp(-3*x)
# 0.002478752

For $b = -2$ the result is close to $\exp(-3x)$:

b <- -2
2*exp(b*x)/pi * integrate(integrand, 0, Inf, x = x, subdivisions = 10000)$value
# 0.002479138

I understood that $b$ must be choosen anywhere at the right of the singularities of $\hat{f}$ (here $-3$). Am I wrong? Here the result depends on the choice of $b$. Do I misunderstand something, or is there something wrong in this textbook?