Solve the Cauchy problem
$$
\begin{align}
u_t &= u_{xx}, \text{ over } x\in{\mathbb R}, t>0 \\
u(x,0) &= \left\{
\begin{array}{ll}
e^{-x} & \text{if } x\geq 0 \\
0 & \text{if } x<0.
\end{array}
\right.
\end{align}
$$
Write your answer down in terms of an integral and attempt to express the integral in terms of the error function. Sketch the initial condition, the steady state, and the evolution towards the steady state.
Section 2.1 #1(b)
Assuming that I'm understanding the process of representing the answer to the equation in terms of an integral correctly, our answer should be in the form of:$$\int_{-\infty}^{\infty} G(x-y,t)\phi(y) dy$$ Where $\phi(y) = u(x,0)$ and $G(x-y,t) = \frac1{\sqrt{4{\pi}kt}} e^{-(x-y)^2/4kt}$, which is the heat kernel. Since in our problem $k=1$, when we plug our values for $u(x,0)$ and the heat kernel into the above formula, we get: $$u(x,t) =\frac1{\sqrt{4{\pi}t}}\int_0^{\infty}e^{-x}e^{-(x-y)^2/4t} dy$$ for our solution expressed in terms of an integral. But now we need to try to get our integral here expressed in terms of the error function $erf(x) = \frac2{\sqrt\pi}\int_0^xe^{-y^2}dy$. The first thing we're going to have to do is manipulate our $u(x,t)$ so that we have something that looks like the error function. This is going to involve both multiplying the entire answer by $2/2$, substituting b into our upper bound for the integral, some basic factoring, and U substitution:$$ \frac22\frac1{\sqrt{4{\pi}t}}\int_0^{\infty}e^{-x}e^{-(x-y)^2/4t} dy = \frac1{4\sqrt{t}}\frac2{\sqrt{\pi}}\int_0^be^{-x}e^{-{((x-y)/2\sqrt{t}})^2} dy$$
$$u = \frac{x-y}{2\sqrt{t}} $$
$$\frac{du}{dy} = \frac{-1}{2\sqrt{t}} \implies dy = -2\sqrt{t}du$$
We're also going to need to change our bounds of integration for the integral, so after doing that, we get
$$-\frac12\frac2{\sqrt{\pi}}\int_{{x}/{2\sqrt{t}}}^{{(x-y)}/{2\sqrt{t}}}e^{-x}e^{-u} du$$
It's important to note here that in our current integral, $e^{-x}$ is nothing more than a constant, so we can pull it out of the integral, and from there we can go ahead and replace the rest of the integral with the value of the error function at both of our bounds, and then take the limit as b approaches $\infty$:
$$\lim \limits_{b\to\infty}\frac{-1}2e^{-x}(erf(\frac{(x-b)}{2\sqrt{t}}) - erf(\frac{x}{2\sqrt{t}}))$$
We learned in class that $\lim \limits_{b\to\infty}erf(\frac{(x-b)}{2\sqrt{t}} = -1$, so our final answer expressed in terms of the error function is
$$\frac1{2e^x} + \frac{erf(\frac{x}{2\sqrt{t}})}{2e^x}$$
Graphs
The initial state looks like the graph of $e^{-x}$, since $\lim \limits_{x{\to}0} erf(\frac{x}{2{\sqrt{t}}}) = 1$, and plugging that into what we have above would make our function equal to $e^{-x}$.
So in preparation for the test, I was going through some of the older problems on Discourse and I realized you made an error while you were doing this question. $\phi(x) = e^{-x}$ and when you plug in to the integral, it's supposed to be $\phi(y)$ and you left it as $\phi(x)$. Where your integral reads $$u(x, t) = \frac{1}{\sqrt{4\pi t}} \int_{0}^{\infty} e^{-x}e^{-(x-y)^2/4t} dy$$ it should be $$u(x, t) = \frac{1}{\sqrt{4\pi t}} \int_{0}^{\infty} e^{-y}e^{-(x-y)^2/4t} dy$$ and that drastically changes the solution.
$$\frac{1}{\sqrt{4\pi t}} \int_{0}^{\infty} e^{-y}e^{-(x-y)^2/4t} dy$$
$$\frac{1}{\sqrt{4\pi t}} \int_{0}^{\infty} e^{-y-\frac{(x-y)^2}{4t}} dy$$
Ignoring the integral for now, factor and simplify the exponent:
$$-y-\frac{(x-y)^2}{4t} = - y - \frac{x^2-2xy+y^2}{4t} = -\frac{x^2-2xy-4ty+y^2}{4t}$$
It gets a little weird here but you refactor it again:
$$-\frac{x^2-2xy-4ty+y^2}{4t} = -\frac{(y+2t-x)^2}{4t}+t-x$$
So now going back to our actual integral, you can write it like this:
$$\frac{1}{\sqrt{4\pi t}} \int_{0}^{\infty} e^{-\frac{(y+2t-x)^2}{4t}+t-x} dy = \frac{1}{\sqrt{4\pi t}} \int_{0}^{\infty} e^{-\frac{(y+2t-x)^2}{4t}}e^{t-x} dy$$
And since this integral is with respect to y, you can pull that $e^{t-x}$ term out.
$$\frac{e^{t-x}}{\sqrt{4\pi t}}\int_{0}^{\infty} e^{-\frac{(y+2t-x)^2}{4t}} dy$$
Now you can start to see how this could be eventually put in terms of the error function.
$$\frac{e^{t-x}}{\sqrt{4\pi t}}\int_{0}^{\infty} e^{-\frac{(y+2t-x)^2}{4t}} dy$$
$$\frac{e^{t-x}}{2\sqrt t}\cdot\frac{1}{\sqrt\pi}\int_{0}^{\infty} e^{-\frac{(y+2t-x)^2}{4t}} dy$$
$$\frac{e^{t-x}}{2\sqrt t}\cdot\frac{1}{\sqrt\pi}\int_{0}^{\infty} e^{-\Big(\frac{y+2t-x}{2\sqrt t}\Big)^2} dy$$
$$u =\frac{y+2t-x}{2\sqrt t}$$
$$\frac{du}{dy}=\frac{1}{2\sqrt t}$$
$$dy = 2\sqrt t du$$
Substituting all these values back in and changing our limits of integration to reflect the bounds of u:
$$\frac{2\sqrt t\cdot e^{t-x}}{2\sqrt t}\cdot\frac{1}{\sqrt\pi}\int_{0}^{\infty} e^{-u^2} du = e^{t-x}\cdot\frac{1}{\sqrt\pi}\int_{\frac{2t-x}{2\sqrt t}}^{\frac{b+2t-x}{2\sqrt t}} e^{-u^2} du$$
$$\frac{e^{t-x}}{2}\bigg[\mathrm{erf}\bigg(\frac{b+2t-x}{2\sqrt t}\bigg)-\mathrm{erf}\bigg(\frac{2t-x}{2\sqrt t}\bigg)\bigg]$$
$$\lim_{b\to\infty} \frac{e^{t-x}}{2}\bigg[\mathrm{erf}\bigg(\frac{b+2t-x}{2\sqrt t}\bigg)-\mathrm{erf}\bigg(\frac{2t-x}{2\sqrt t}\bigg)\bigg]$$
Recalling that as ${b\to\infty}, \mathrm{erf}(b) = 1$ which leads us to our final answer:
$$\frac{e^{t-x}}{2}\bigg[1+\mathrm{erf}\bigg(\frac{2t-x}{2\sqrt t}\bigg)\bigg]$$
If anybody wants to chime in with the graphs, that'd be awesome, I just thought I'd share. Your process was beautiful, Joe, a rogue $e^{-x}$ got you.
@jtamberi I'm just now noticing the hand drawn graph. Very beautiful.