In fact the "subtraction method" you so called is a little trick that pointedly changing some of the conditions from inhomogeneous to become homogeneous by applying the variable transformation on the dependent variable only.
This little trick is briefly introduced in http://maths.swan.ac.uk/staff/vl/pdes-course.pdf#page=32 and http://maths.swan.ac.uk/staff/vl/pdes-course.pdf#page=38.
For example the PDEs with dependent variable $u$ and independent variables $x$ and $t$ , the little trick is as follows:
for pointedly changing $u(0,t)=f(t)$ and $u(a,t)=g(t)$ $(a\neq0)$ : Let $v(x,t)=u(x,t)-f(t)-\dfrac{x}{a}(g(t)-f(t))$
for pointedly changing $u(0,t)=f(t)$ and $u_x(a,t)=g(t)$ : Let $v(x,t)=u(x,t)-f(t)-xg(t)$
for pointedly changing $u_x(0,t)=f(t)$ and $u(a,t)=g(t)$ : Let $v(x,t)=u(x,t)-(x-a)f(t)-g(t)$
for pointedly changing $u_x(0,t)=f(t)$ and $u_x(a,t)=g(t)$ $(a\neq0)$ : Let $v(x,t)=u(x,t)-h(t)-xf(t)-\dfrac{x^2}{2a}(g(t)-f(t))$
The other types of pointedly changing examples leaves yourself to think.
Sometimes this little trick is a must to apply, for example in Boundaries in heat equation and Heat equation with an unknown diffusion coefficient, otherwise you will get the wrong conclusion that has no solution.
For this problem, you might let $v(x,t)=u(x,t)-b(t)-xb(t)$ , but since there are no other conditions exist, so you have not necessarily to apply this trick, just seckilling this problem by one of the these two approaches:
Approach $1$: separation of variables
Case $1$: $\text{Re}(t)\geq0$
Let $u(x,t)=X(x)T(t)$ ,
Then $X(x)T'(t)=X''(x)T(t)$
$\dfrac{T'(t)}{T(t)}=\dfrac{X''(x)}{X(x)}=-s^2$
$\begin{cases}\dfrac{T'(t)}{T(t)}=-s^2\\X''(x)+s^2X(x)=0\end{cases}$
$\begin{cases}T(t)=c_3(s^2)e^{-ts^2}\\X(x)=\begin{cases}c_1(s^2)\sin xs+c_2(s^2)\cos xs&\text{when}~s\neq0\\c_1x+c_2&\text{when}~s=0\end{cases}\end{cases}$
$\therefore u(x,t)=C_1x+C_2+\int_0^\infty C_3(s^2)e^{-ts^2}\sin xs~ds+\int_0^\infty C_4(s^2)e^{-ts^2}\cos xs~ds$
$u_x(x,t)=C_1+\int_0^\infty sC_3(s^2)e^{-ts^2}\cos xs~ds-\int_0^\infty sC_4(s^2)e^{-ts^2}\sin xs~ds$
$u_x(0,t)=b(t)$ :
$C_1+\int_0^\infty sC_3(s^2)e^{-ts^2}~ds=b(t)$
$\int_0^\infty\dfrac{C_3(s^2)e^{-ts^2}}{2}d(s^2)=b(t)-C_1$
$\int_0^\infty\dfrac{C_3(s)e^{-ts}}{2}ds=b(t)-C_1$
$\mathcal{L}_{s\to t}\biggl\{\dfrac{C_3(s)}{2}\biggr\}=b(t)-C_1$
$C_3(s)=2\mathcal{L}^{-1}_{t\to s}\{b(t)\}-2C_1\delta(s)$
$\therefore u(x,t)=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds-2C_1\int_0^\infty\delta(s^2)e^{-ts^2}\sin xs~ds+\int_0^\infty C_4(s^2)e^{-ts^2}\cos xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds-C_1\int_0^\infty\dfrac{\delta(s^2)e^{-ts^2}\sin xs}{s}d(s^2)+\int_0^\infty C_4(s^2)e^{-ts^2}\cos xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds-C_1\int_0^\infty\dfrac{\delta(s)e^{-ts}\sin x\sqrt{s}}{\sqrt{s}}ds+\int_0^\infty C_4(s^2)e^{-ts^2}\cos xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds-C_1\lim\limits_{s\to 0}\dfrac{e^{-ts}\sin x\sqrt{s}}{\sqrt{s}}+\int_0^\infty C_4(s^2)e^{-ts^2}\cos xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds-C_1\lim\limits_{s\to 0}\dfrac{\dfrac{xe^{-ts}\cos x\sqrt{s}}{2\sqrt{s}}-te^{-ts}\sin x\sqrt{s}}{\dfrac{1}{2\sqrt{s}}}+\int_0^\infty C_4(s^2)e^{-ts^2}\cos xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds-C_1\lim\limits_{s\to 0}(xe^{-ts}\cos x\sqrt{s}-2t\sqrt{s}e^{-ts}\sin x\sqrt{s})+\int_0^\infty C_4(s^2)e^{-ts^2}\cos xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds-C_1x+\int_0^\infty C_4(s^2)e^{-ts^2}\cos xs~ds=C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds+\int_0^\infty C_4(s^2)e^{-ts^2}\cos xs~ds$
$u(0,t)=b(t)$ :
$C_2+\int_0^\infty C_4(s^2)e^{-ts^2}~ds=b(t)$
$\int_0^\infty\dfrac{C_4(s^2)e^{-ts^2}}{2s}d(s^2)=b(t)-C_2$
$\int_0^\infty\dfrac{C_4(s)e^{-ts}}{2\sqrt{s}}ds=b(t)-C_2$
$\mathcal{L}_{s\to t}\biggl\{\dfrac{C_4(s)}{2\sqrt{s}}\biggr\}=b(t)-C_2$
$C_4(s)=2\sqrt{s}\mathcal{L}^{-1}_{t\to s}\{b(t)\}-C_2\delta(\sqrt{s})$
$\therefore u(x,t)=C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds+2\int_0^\infty s\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\cos xs~ds-C_2\int_0^\infty\delta(s)e^{-ts^2}\cos xs~ds=C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds+2\int_0^\infty s\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\cos xs~ds-C_2=2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds+2\int_0^\infty s\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\cos xs~ds$
Case $2$: $\text{Re}(t)\leq0$
Let $u(x,t)=X(x)T(t)$ ,
Then $X(x)T'(t)=X''(x)T(t)$
$\dfrac{T'(t)}{T(t)}=\dfrac{X''(x)}{X(x)}=s^2$
$\begin{cases}\dfrac{T'(t)}{T(t)}=s^2\\X''(x)-s^2X(x)=0\end{cases}$
$\begin{cases}T(t)=c_3(s^2)e^{ts^2}\\X(x)=\begin{cases}c_1(s^2)\sinh xs+c_2(s^2)\cosh xs&\text{when}~s\neq0\\c_1x+c_2&\text{when}~s=0\end{cases}\end{cases}$
$\therefore u(x,t)=C_1x+C_2+\int_0^\infty C_3(s^2)e^{ts^2}\sinh xs~ds+\int_0^\infty C_4(s^2)e^{ts^2}\cosh xs~ds$
$u_x(x,t)=C_1+\int_0^\infty sC_3(s^2)e^{ts^2}\cosh xs~ds+\int_0^\infty sC_4(s^2)e^{ts^2}\sinh xs~ds$
$u_x(0,t)=b(t)$ :
$C_1+\int_0^\infty sC_3(s^2)e^{ts^2}~ds=b(t)$
$\int_0^\infty\dfrac{C_3(s^2)e^{ts^2}}{2}d(s^2)=b(t)-C_1$
$\int_0^\infty\dfrac{C_3(s)e^{ts}}{2}ds=b(t)-C_1$
$\int_0^\infty\dfrac{C_3(s)e^{-ts}}{2}ds=b(-t)-C_1$
$\mathcal{L}_{s\to t}\biggl\{\dfrac{C_3(s)}{2}\biggr\}=b(-t)-C_1$
$C_3(s)=2\mathcal{L}^{-1}_{t\to s}\{b(-t)\}-2C_1\delta(s)$
$\therefore u(x,t)=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds-2C_1\int_0^\infty\delta(s^2)e^{ts^2}\sinh xs~ds+\int_0^\infty C_4(s^2)e^{ts^2}\cosh xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds-C_1\int_0^\infty\dfrac{\delta(s^2)e^{ts^2}\sinh xs}{s}d(s^2)+\int_0^\infty C_4(s^2)e^{ts^2}\cosh xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds-C_1\int_0^\infty\dfrac{\delta(s)e^{ts}\sinh x\sqrt{s}}{\sqrt{s}}ds+\int_0^\infty C_4(s^2)e^{ts^2}\cosh xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds-C_1\lim\limits_{s\to 0}\dfrac{e^{ts}\sinh x\sqrt{s}}{\sqrt{s}}+\int_0^\infty C_4(s^2)e^{ts^2}\cosh xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds-C_1\lim\limits_{s\to 0}\dfrac{\dfrac{xe^{ts}\cosh x\sqrt{s}}{2\sqrt{s}}+te^{ts}\sinh x\sqrt{s}}{\dfrac{1}{2\sqrt{s}}}+\int_0^\infty C_4(s^2)e^{ts^2}\cosh xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds-C_1\lim\limits_{s\to 0}(xe^{ts}\cosh x\sqrt{s}+2t\sqrt{s}e^{ts}\sinh x\sqrt{s})+\int_0^\infty C_4(s^2)e^{ts^2}\cosh xs~ds=C_1x+C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds-C_1x+\int_0^\infty C_4(s^2)e^{ts^2}\cosh xs~ds=C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds+\int_0^\infty C_4(s^2)e^{ts^2}\cosh xs~ds$
$u(0,t)=b(t)$ :
$C_2+\int_0^\infty C_4(s^2)e^{ts^2}~ds=b(t)$
$\int_0^\infty\dfrac{C_4(s^2)e^{ts^2}}{2s}d(s^2)=b(t)-C_2$
$\int_0^\infty\dfrac{C_4(s)e^{ts}}{2\sqrt{s}}ds=b(t)-C_2$
$\int_0^\infty\dfrac{C_4(s)e^{-ts}}{2\sqrt{s}}ds=b(-t)-C_2$
$\mathcal{L}_{s\to t}\biggl\{\dfrac{C_4(s)}{2\sqrt{s}}\biggr\}=b(-t)-C_2$
$C_4(s)=2\sqrt{s}\mathcal{L}^{-1}_{t\to s}\{b(-t)\}-C_2\delta(\sqrt{s})$
$\therefore u(x,t)=C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds+2\int_0^\infty s\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\cosh xs~ds-C_2\int_0^\infty\delta(s)e^{ts^2}\cosh xs~ds=C_2+2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds+2\int_0^\infty s\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\cosh xs~ds-C_2=2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds+2\int_0^\infty s\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\cosh xs~ds$
Hence $u(x,t)=\begin{cases}2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\sin xs~ds+2\int_0^\infty s\mathcal{L}^{-1}_{t\to s^2}\{b(t)\}e^{-ts^2}\cos xs~ds&\text{when Re}(t)\geq0\\2\int_0^\infty\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\sinh xs~ds+2\int_0^\infty s\mathcal{L}^{-1}_{t\to s^2}\{b(-t)\}e^{ts^2}\cosh xs~ds&\text{when Re}(t)\leq0\end{cases}$
Approach $2$: power series method
Similar to PDE - solution with power series:
Let $u(x,t)=\sum\limits_{n=0}^\infty\dfrac{x^n}{n!}\dfrac{\partial^nu(0,t)}{\partial x^n}$ ,
Then $u(x,t)=\sum\limits_{n=0}^\infty\dfrac{x^{2n}}{(2n)!}\dfrac{\partial^{2n}u(0,t)}{\partial x^{2n}}+\sum\limits_{n=0}^\infty\dfrac{x^{2n+1}}{(2n+1)!}\dfrac{\partial^{2n+1}u(0,t)}{\partial x^{2n+1}}=\sum\limits_{n=0}^\infty\dfrac{x^{2n}}{(2n)!}\dfrac{\partial^nu(0,t)}{\partial t^n}+\sum\limits_{n=0}^\infty\dfrac{x^{2n+1}}{(2n+1)!}\dfrac{\partial^nu_x(0,t)}{\partial t^n}=\sum\limits_{n=0}^\infty\dfrac{x^{2n}}{(2n)!}\dfrac{\partial^nb(t)}{\partial t^n}+\sum\limits_{n=0}^\infty\dfrac{x^{2n+1}}{(2n+1)!}\dfrac{\partial^nb(t)}{\partial t^n}$
Best Answer
The problem can be solved with the ansatz $$ u(x,t)=F(x-t)+G(x+t)+H(-x+t). \tag{1} $$ For convenience, the domain of all functions on the RHS of $(1)$ is $\mathbb{R}$, but they have support on $[0,\infty)$. It's also convenient to extend the domain of $f$ by defining $f(x)=0$ for $x<0$.
Now, let's use the initial and boundary conditions to the determine $F, G$ and $H$: \begin{align} u(x,0)=f(x) &\implies F(x)+G(x)+H(-x)=f(x), \tag{2.1} \\ u_t(x,0)=0 &\implies -F'(x)+G'(x)+H'(-x)=0, \tag{2.2} \\ u_x(0,t)=ku_t(0,t) &\implies F'(-t)+G'(t)-H'(t)=k[-F'(-t)+G'(t)+H'(t)]. \tag{2.3} \end{align} Since, by construction, $F$ and $G$ have support on $[0,\infty)$, the terms $H(-x)$, $H'(-x)$ and $F'(-t)$ are equal to zero in the domain $x>0, t>0$. After eliminating them, we can solve the system $(2)$, obtaining \begin{align} F(x)&=\frac{1}{2}f(x), \tag{3.1} \\ G(x)&=\frac{1}{2}f(x), \tag{3.2} \\ H(t)&=\frac{1}{2}\left(\frac{1-k}{1+k}\right)f(t) \qquad(k\neq -1). \tag{3.3} \end{align} Plugging $(3)$ into $(1)$, we finally get $$ u(x,t)=\frac{1}{2}f(x-t)+\frac{1}{2}f(x+t)+\frac{1}{2}\left(\frac{1-k}{1+k}\right)f(-x+t). \tag{4} $$