# Solving the initial value problem using odd extention

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 - We see that the boundary condition is a Dirichlet boundary condition, thus we have to use the odd reflection to this problem. Let $\phi_{\text{odd}}$ be the unique off extension of $e^{-2x}$, so we have $$\phi_{\text{odd}} = \begin{cases} \phi(x) = e^{-2x} \ \ &\text{for} \ \ x > 0\\ -\phi(-x) = -e^{2x} \ \ &\text{for} \ \ x < 0\\ = 0 \ \ &\text{for} \ \ x =0\\ \end{cases}$$ Assume $v(x,t)$ is the solution to $$\begin{cases} v_t = k v_{xx} \ \ &\text{for} \ \ x\in \mathbb{R}, t > 0\\ v(x,0) = \phi_{\text{odd}} \ \ &\text{for} \ \ x\in\mathbb{R} \end{cases}$$ The formula for the heat equation is $$v(x,t) = \int_{-\infty}^{\infty}S(x-y,t)\phi_{\text{odd}} dy$$ where $v(x,t)$ is an odd function of $x$, so $v(0,t) = 0$. Therefore, the boundary condition is satisfied. The restriction is $u(x,t) = v(x,t)$ for $x > 0$ which will be the unique solution of out half-line problem. The explicit formula for $u(x,t)$ is deduced from the latter above. We have $$v(x,t) = \int_{0}^{\infty}S(x-y,t)\phi(y)dy - \int_{-\infty}^{0}S(x-y,t)\phi(-y)dy = \int_{0}^{\infty}\left[ S(x-y,t) - S(x+y,t) \right]\phi(y) dy$$ Hence for $0 < x < \infty$, $0 < t < \infty$ we have \begin{align*} u(x,t) &= \frac{1}{\sqrt{4x kt}}\int_{0}^{\infty}\left[ e^{\frac{-(x-y)}{4kt}} - e^{\frac{-(x+y)}{4kt}}\right]\phi(y)dy\\ &= \frac{1}{\sqrt{4x kt}}\int_{0}^{\infty}\left[ e^{\frac{-(x-y)}{4kt}} - e^{\frac{-(x+y)}{4kt}}\right]e^{-2y}dy\\ &= \frac{1}{\sqrt{4x kt}}\int_{0}^{\infty}\left[ e^{\frac{-(x^2 - 2xy + y^2)-2y - 4kt}{4kt}} - e^{\frac{-x^2 + 2xy + y^2 - 2y - 4kt}{4kt}}\right]e^{-2y}dy\\ &= \frac{1}{\sqrt{4x kt}}\left[e^{2x + 4kt}\int_{-\frac{x+4kt}{\sqrt{4kt}}}^{\infty}e^{-p^2}\sqrt{4kt}dp - e^{-2x+4kt}\int_{\frac{x-4kt}{\sqrt{4kt}}}^{\infty}e^{-q^2}\sqrt{4kt}dq \right]\\ &= \vdots\\ &= \frac{1}{2}\left[ e^{2x+4kt}(1 + erf(\frac{x+4kt}{\sqrt{4kt}})) - e^{-2x + 4kt}(1 - erf(\frac{x - 4kt}{\sqrt{4kt}})) \right] \end{align*}

I am not sure if this is correct. Any suggestions are greatly appreciated.