Part(a)
Dirichlet boundary
\begin{array}{l}
{u_t} = k{u_{xx}}, x > 0,t > 0\\
u{|_{t = 0}} = g(x)\\
u{|_{x = 0}} = 0\\
u(x,t) = \int\limits_0^\infty {G(x - y,t)g(y)dy - \int\limits_0^\infty {G(x + y,t)g(y)dy} } \\
{\rm{ = }}\frac{1}{{\sqrt {4k\pi t} }}\int\limits_0^\infty {{e^{\frac{{ - {{(x - y)}^2}}}{{4kt}}}}} g(y)dy - \frac{1}{{\sqrt {4k\pi t} }}\int\limits_0^\infty {{e^{\frac{{ - {{(x + y)}^2}}}{{4kt}}}}} g(y)dy\\
{\rm{ = }}\frac{1}{{\sqrt {4k\pi t} }}\int\limits_0^\infty {({e^{\frac{{ - {{(x - y)}^2}}}{{4kt}}}} - {e^{\frac{{ - {{(x + y)}^2}}}{{4kt}}}}) }g(y)dy\\
\end{array}
part(b):
Neumann boundary
\begin{array}{l}
{u_t} = k{u_{xx}}, x > 0,t > 0\\
u{|_{t = 0}} = g(x)\\
{u_x}{|_{x = 0}} = 0\\
u(x,t) = \int\limits_0^\infty {G(x - y,t)g(y)dy + \int\limits_0^\infty {G(x + y,t)g(y)dy} } \\
{\rm{ = }}\frac{1}{{\sqrt {4k\pi t} }}\int\limits_0^\infty {{e^{\frac{{ - {{(x - y)}^2}}}{{4kt}}}}} g(y)dy + \frac{1}{{\sqrt {4k\pi t} }}\int\limits_0^\infty {{e^{\frac{{ - {{(x + y)}^2}}}{{4kt}}}}} g(y)dy\\
{\rm{ = }}\frac{1}{{\sqrt {4k\pi t} }}\int\limits_0^\infty {({e^{\frac{{ - {{(x - y)}^2}}}{{4kt}}}} + {e^{\frac{{ - {{(x + y)}^2}}}{{4kt}}}}} )g(y)dy\\
\\
\end{array}