Solve the initial value problem: $$\begin{cases} u_t = ku_{xx} \ \ &\text{for} \ \ x > 0, t > 0,\\ u(x,0) = e^{-2x} \ \ &\text{for} \ \ x > 0,\\ u(0,t) = 0 \ \ &\text{for} \ \ t > 0\\ \end{cases}$$
Attempted solution - Using the separation of variables $$u(x,t) = X(x)T(t)$$ then $$u_t(x,t) = X(x)T'(t), \ \ u_x(x,t) = X'(x)T(t)$$ $$u_{xx}(x,t) = X^{\prime\prime}(x)T(t)$$ thus $$X(x)T'(t) = k X^{\prime\prime}T(t)$$ Rearranging algebraically we have $$\frac{X^{\prime\prime}}{X(x)} = \frac{T'(t)}{kT(t)} = -\lambda$$ Rearranging again we get $$T' + k\lambda T = 0 \ \ X^{\prime\prime} + \lambda X = 0$$ The general solution to the $T$-equation is of the form $$T(t) = e^{k\lambda t}$$ The general solution to the $X$-equation is of the form $$X(x) = \begin{cases} c_1\cos Bx + c_2 \sin Bx \ \ &\text{if} \ \ \lambda = B^2 > 0\\ c_1e^{\sqrt{\gamma} x} + c_2 e^{-\sqrt{\gamma} x} \ \ &\text{if} \ \ \lambda = -\gamma^2 < 0\\ c_1 + c_2 x \ \ &\text{if} \ \ \lambda = 0\\ \end{cases}$$ Since the given equation is a heat equation $u(x,t)$ should decrease with the increase of time thus we have $$X(x) = c_1 e^{\sqrt{\gamma}x} + c_2 e^{-\sqrt{\gamma}x} \ \ \text{and} \ \ T = c_3 e^{\lambda k t}$$
I am not sure how to apply the initial/boundary conditions to this problem any help would be greatly appreciated.