Given $g : [0,\infty) \to \mathbb{R}$, with $g(0)=0$, derive the formula $$u(x,t)=\frac{x}{\sqrt{4\pi}}\int_0^t \frac 1{(t-s)^{3/2}}e^{-\frac{x^2}{4(t-s)}}g(s)\,ds$$ for a solution of the initial/boundary-value problem $$\begin{cases}u_t-u_{xx}=0 & \text{in }\mathbb{R}_+ \times (0,\infty) \\ \qquad \quad \, u=0 & \text{on } \mathbb{R}_+ \times \{t=0\} \\ \qquad \quad \, u= g & \text{on }\{x=0\} \times [0,\infty). \end{cases}$$ (Hint: Let $v(x,t):=u(x,t)-g(t)$ and extend $v$ to $\{x<0\}$ by odd reflection.)
This is Chapter 2, Exercise 15 of PDE Evans, 2nd edition.
Question: How can I integrate by parts to derive the line in my work (before the final word "Hence")?
Note: Please don't consider this question to be a duplicate of this earlier one I asked. The work I attempted here is substantially different.
My work:
Following the hint and taking odd reflection, we have $$v(x,t):=\begin{cases}u(x,t)-g(t) & \text{if }x > 0 \\ -[u(-x,t)-g(t)] & \text{if }x<0 \end{cases}.$$
Thus, $\require{cancel} v(x,0)=\cancelto{0}{u(|x|,0)}-\cancelto{0}{g(0)}=0$ and $v(0,t)=\cancelto{g'(t)}{u(0,t)}-g'(t)=0$. Our transformed IBVP is $$\begin{cases}v_t - v_{xx} = \begin{cases}g'(t) & \text{if } x > 0 \\ -g'(t) & \text{if } x < 0 \end{cases} & \text{in } \mathbb{R}_+ \times (0,\infty) \\ \, \, \, \, v(x,0)=0 & \text{on } \mathbb{R}_+ \times \{t=0\} \\ \quad v(0,t) = 0& \text{on } \{x=0\} \times [0,\infty)\end{cases}$$
By $(13)$ of §2.3 (page 49) of the textbook, the solution to our transformed IBVP is, for all $t > 0$, \begin{align*} v(x,t)&= \int_0^t \frac 1{\sqrt{4\pi(t-s)}} \left[ \int_{-\infty}^0 e^{-\frac{|-x-y|^2}{4(t-s)}} [-g'(s)] \, dy+ \int_0^\infty e^{-\frac{|x-y|^2}{4(t-s)}} [g'(s)] \, dy \right] ds \\ &=\int_0^t -\frac 1{\sqrt{4\pi(t-s)}} \left[-\int_0^{-\infty} e^{-\frac{|-x-y|^2}{4(t-s)}} g'(s) \, dy - \int_0^\infty e^{-\frac{|x-y|^2}{4(t-s)}} g'(s) \, dy \right] ds. \end{align*}
Let $z=\frac{-x-y}{\sqrt{4(t-s)}}$ for the first term inside the bracket, and let $z=\frac{|y-x|}{\sqrt{4(t-s)}}$ for the second term. Then \begin{align*} v(x,t)&=-\frac 1{\sqrt{\pi}} \int_0^t \left[\int_{-\frac x{\sqrt{4(t-s)}}}^{\infty} e^{-z^2} g'(s) \, dz - \int_{\frac x{\sqrt{4(t-s)}}}^\infty e^{-z^2} g'(s) \, dz \right] ds \\ &= -\frac 2{\sqrt{\pi}} \int_0^t g'(s) \int_{0}^{\frac x{\sqrt{4(t-s)}}} e^{-z^2} \, dz \, ds. \end{align*}
Integrating by parts (with $u=\int_{0}^{\frac{x}{\sqrt{4(t-s)}}}e^{-z^2} \, dz$ and $dv =g'(s) \, ds$), we obtain \begin{align*} v(x,t)&=-\frac 2{\sqrt{\pi}} \left[\int_{0}^{\frac x{\sqrt{4(t-s)}}} \left. e^{-z^2} \, dz \, g(s) \right\vert_0^t - \frac x{2\sqrt{4}} \int_0^t \frac 1{(t-s)^{3/2}} e^{-\frac{|x|^2}{4(t-s)}} g(s) \, ds \right] \\ &=-\frac 2{\sqrt{\pi}} \left[\left(\int_{0}^{\infty} e^{-z^2} \, dz \, g(t) - \int_{0}^{\frac x{\sqrt{4t}}} e^{-z^2} \, dz \, \require{cancel} \cancelto{0}{g(0)} \right) - \frac x{2\sqrt{4}} \int_0^t \frac 1{(t-s)^{3/2}} e^{-\frac{|x|^2}{4(t-s)}} g(s) \, ds \right] \\ &=-g(t) + \frac x{\sqrt{4\pi}} \int_0^t \frac 1{(t-s)^{3/2}} e^{-\frac{|x|^2}{4(t-s)}} g(s) \, ds. \end{align*}
Hence, $$u(x,t)=v(x,t)+g(t)=\frac x{\sqrt{4\pi}} \int_0^t \frac 1{(t-s)^{3/2}} e^{-\frac{|x|^2}{4(t-s)}} g(s) \, ds.$$