= Solution
Use the <Bromwich inversion formula> in the real variable $\omega$, with $p=\gamma+i\omega$:
$$
u(x,t)=\frac{e^{-ax+\gamma t}}{2\pi}\int_{-\infty}^{\infty}e^{i\omega t}W(x,\gamma+i\omega)\,d\omega.
$$
When the relevant <Laplace transforms> and spatial <integral transforms> are explicit, every sample of this integrand can be evaluated directly, without a time-stepping approximation to the <partial differential equation>. Split the <initial condition> integral at $y=x$: the two pieces of $R_q$ are linear combinations of $e^{\pm qy}$, so truncated spatial exponential transforms suffice. For real data the negative-frequency half is the <complex conjugate> of the positive-frequency half.
A practical <numerical integration> is to truncate to $|\omega|\leq\Omega$, apply an adaptive <quadrature rule>, and independently increase $\Omega$ and refine the quadrature. Choose $\gamma>0$ large enough to remain to the right of all singularities, but avoid an unnecessarily large $e^{\gamma t}$. Evaluate <hyperbolic function> ratios in scaled form; for example,
$$
\frac{\sinh(q[L-x])}{\sinh(qL)}=e^{-qx}\frac{1-e^{-2q(L-x)}}{1-e^{-2qL}}.
$$
This prevents overflow when $\operatorname{Re}qL$ is large. The boundary contributions at an interior point are damped by $e^{-x\operatorname{Re}q}$ or $e^{-(L-x)\operatorname{Re}q}$, with $\operatorname{Re}q\sim\sqrt{|\omega|/2}$. Near an endpoint more frequencies are needed; at the endpoint itself use the prescribed <Dirichlet boundary condition>. The <initial condition> resolvent has a generally only $O(1/\omega)$ tail. Treat its oscillatory tail accurately, subtract a known transform with the same leading term, or evaluate that contribution separately with the <heat kernel>.
An equally useful check is the <eigenfunction expansion>. Define
$$
U_n=\frac2L\int_0^Le^{ay}u_0(y)\sin(q_ny)\,dy,\qquad \lambda_n=q_n^2+a^2.
$$
The causal modal formula is
$$
u(x,t)=e^{-ax}\sum_{n=1}^{\infty}\sin(q_nx)\left[e^{-\lambda_nt}U_n+\frac{2q_n}{L}\int_0^te^{-\lambda_n(t-s)}\left(g_0(s)-(-1)^ne^{aL}h(s)\right)ds\right].
$$
It follows either from the <heat kernel> formula or directly from <integration by parts> against a sine <eigenfunction>. Exponential-transform formulas evaluate the time <integral> explicitly when available. The <initial condition> contribution has a <Gaussian function> cutoff in $n$ for each positive time. Nonzero endpoint forcing produces a more slowly convergent <sine series> tail. A <boundary lifting> $\ell(x,t)=(1-x/L)g_0(t)+(x/L)e^{aL}h(t)$ gives $w=\ell+z$, where $z$ has zero <Dirichlet boundary conditions> and forcing $-\ell_t-a^2\ell$; expanding $z$ gives better convergence and imposes the endpoint values exactly. At very small times the <method of images> is often more efficient than retaining many modes.
\b[Check convergence by increasing both the frequency cutoff and quadrature resolution, and compare with a separately truncated causal modal or image-kernel evaluation.] <Causality in finite-time Laplace contour inversion> means a leftward contour deformation must respect both <resolvent operator> poles and growth of the transformed data. In particular, the transform of data extended by zero after $T$ can grow like $e^{-pT}$ in the left half-plane: for $t<T$ one cannot close that contour indiscriminately and discard its large arc. The modal forcing integral with upper limit $t$ avoids this causality error.
Back to article page