This sort of problem is well documented, but, I can not see how to get this solution;
The problem is:
$$\frac{\partial c}{\partial t}=D\frac{\partial^2 c}{\partial x^2}, 0 < x < \infty, t > 0$$
with boundary conditions $c(0,t)= C_0, c(x,0) = 0$ and possibly $\lim_{x \rightarrow \infty}c(x,t) = 0$ as the capillary that the model is modelling is infinitely long.
whose solution is
$$c(x,t) = 2C_0\bigg( 1-\frac{1}{\sqrt{2\pi}}\int^z_{-\infty}\exp(-\frac{s^2}{2}) ds \bigg), z = \frac{x}{\sqrt{2Dt}}$$
Now I have let $c(x,t) = X(x)T(t)$ and then obtained
$$\frac{T'}{DT} = - s^2 = \frac{X''}{X}$$
we have
$\begin{cases}T(t)=c_3(s)e^{-Dts^2}\\X(x)=\begin{cases}c_1(s)\sin xs+c_2(s)\cos xs&\text{when}~s\neq0\\c_1x+c_2&\text{when}~s=0\end{cases}\end{cases}$
so
$$ u(x,t)=\int_0^\infty C_1(s)e^{-Dts^2}\sin xs~ds+\int_0^\infty C_2(s)e^{-Dts^2}\cos xs~ds$$
but my initial conditions give, first
$$\int_0^\infty C_2(s)e^{-Dts^2}ds = C_0$$
then changing variables $s = \sqrt{\frac{r}{D}}$
$$\int_0^\infty \frac{1}{2}\sqrt{\frac{D}{r}}C_2(r)e^{-tr}ds = C_0$$
$$ L[ \frac{1}{2}\sqrt{\frac{D}{r}}C_2(r)] = C_0$$
the inverse Laplace transformation of the right and side is a multiple of the delta function.... I feel like I have taken the wrong way.