# Heat Equation Solution in the domain $(0, \infty)$.

I understand that the heat equation in $R^{1}$ space: $u_{t} = ku_{xx}$, $x \in (-\infty, \infty), t >0$

with initial condition $u(x,0) = g(x)$ has the following exact solution:

$$u(x,t) = \frac{1}{\sqrt{4\pi kt}} \, \int_{-\infty}^{\infty} g(y) \, e^\frac{-(x-y)^{2}}{4kt} \, dy$$

Now, how does the previous exact solution change to satisfy the domain $(0,\infty)$ with a fixed boundary condition $u(0,t) = 0$. Thank you!

Extend $g$ to all of $\Bbb R$ as an odd function, that is, define $$\tilde g(x)=\begin{cases}-g(-x) &\text{if }x<0,\\g(x) &\text{if }x>0.\end{cases}$$ The solution is then $$u(x,t) = \frac{1}{\sqrt{4\pi\, k\,t}} \, \int_{-\infty}^{\infty}\tilde g(y) \, e^\frac{-(x-y)^{2}}{4kt} \, dy,\quad x,t>0.$$