Solution (source code)

= Solution

Use the principal square root and deform the <Bromwich contour> around the negative real-axis branch cut. The pole at $p=0$ contributes $a$. The two boundary values at $p=-b$ combine to
$$
-ae^{-bt}\cos\left(x\sqrt{b/\kappa}\right).
$$
On the cut put $p=-v^2$; the jump of $e^{-x\sqrt{p/\kappa}}$ is $-2i\sin(xv/\sqrt\kappa)$ and $dp=-2v,dv$. Taking the principal value at $v=\sqrt b$ gives
$$
\boxed{T(x,t)=a\left[1-e^{-bt}\cos\left(\sqrt{b/\kappa}\,x\right)\right]
+\frac{2ab}{\pi}\mathcal P\int_0^\infty
\frac{e^{-v^2t}\sin(xv/\sqrt\kappa)}{v(v^2-b)}\,dv}.
$$
The expression has the prescribed boundary value and decays into the bar.