Given boundary conditions and initial condition, solve the PDE 
Question, solve the given PDE :
$$ \frac{\partial C}{\partial t} = a \frac{\partial^2 C}{\partial x^2} -kC $$
where a, k are constants.
boundary conditions : $C= C_0$ at $x=0$, $C=0 $ at $x =$ infinitum
initial condition : $C=0$ at $t=0$

My attempt :

$$C(x,t) = X(x)~T(t)$$
$$ C = X~T$$
$$ \tag{1}\boxed{ \frac{\partial C}{\partial t} = T^{\prime} X,~ \space \frac{\partial C}{\partial x}= X^{\prime}T, ~ \frac{\partial^2 C}{\partial x^2} = X^{\prime \prime } T}$$
replacing the partial derivatives into the Original equation :
$$  T^{\prime}X = a ~X^{\prime \prime}T-k(X~T)    $$
$$ X (T^{\prime} +KT)=a ~X^{\prime \prime}T  $$
$$\frac{T^{\prime}}{T} = a ~\frac{ X^{\prime \prime}}{X} -k$$
$$ \tag{2}\boxed{\frac{T^{\prime}}{T} = J,  ~\frac{ X^{\prime \prime}}{X} -k = J}$$
equating each side to a constant $J = -\lambda^2$
$$ \tag{3}\boxed{\frac{d T}{d t} = -\lambda^2 T ,~ \frac{d^2 X}{d x^2} = \left (\frac{-\lambda^2 + k}{a} \right) X}$$
solving each differential equation :
$$T(t) = Ae^{- \lambda t} , ~ ~~~X(x) = B ~e^{\left (x \sqrt{\frac{ k - \lambda^2}{a}} \right)} + C ~e^{\left (-x \sqrt{\frac{ k - \lambda^2}{a}} \right) } $$
Note :  D = AB and E = AC
Corrected equation :
$$\tag{4} \boxed{{C(x,t) = \left(D \ e^ {x \sqrt{\frac{k-\lambda^2}{a}}} + E e^ {-x \sqrt{\frac{k-\lambda^2}{a}}} \right) e^{-\lambda t}}}$$
confused with Boundary conditions and initial condition, could you guys help please

 A: Using the Laplace transform
$$
sC(s,x) - a C_{xx}(s,x)+ k C(s,x) = c(0,x)
$$
here $c(0,x) = 0$ so we follow with
$$
(s+k)C(s,x) - a C_{xx}(s,x)=0
$$
now solving for $x$ we have
$$
C(s,x) = \phi_1(s) e^{\sqrt{\frac{s+k}{a}}x}+\phi_2(s) e^{-\sqrt{\frac{s+k}{a}}x}
$$
and due to the boundary conditions $\phi_1(s) = 0,\phi_2(s) = c_0$ so
$$
C(s,x) = c_0e^{-\sqrt{\frac{s+k}{a}}x}
$$
and finally
$$
c(t,x) = \mathcal{L}^{-1}\left[C(s,x)\right]=\frac{c_0 x e^{-\left(\frac{x^2}{4 a t}+k t\right)}}{2 \sqrt{a\pi }  t^{3/2}},\ \ \ \frac {x}{\sqrt{a}}\gt 0
$$
NOTE
The answer above considers the boundary conditions at $x = 0$ as initial conditions (Dirac impulses). To consider a step at $x = 0$ with amplitude $c_0$ then the boundary conditions should be $\phi_1(s) = \frac{c_0}{s}$ and then
$$
C(s,x) = \frac{c_0}{s}e^{-\sqrt{\frac{s+k}{a}}x}
$$
with inverse Laplace transform
$$
c(t,x) = \frac{1}{2} c_0 e^{x \left(-\sqrt{\frac{k}{a}}\right)} \left(2-\text{erfc}\left(\frac{2 t \sqrt{a k}-x}{2 \sqrt{a t}}\right)+e^{2 x \sqrt{\frac{k}{a}}}
   \text{erfc}\left(\frac{2 t \sqrt{a k}+x}{2 \sqrt{a t}}\right)\right)
$$
Follows a plot for $k=a=1, c_0=2,\ \ 0\le x\le 1, \ \ 0 \le t\le 2$.

