An archived instance of discourse for discussion in undergraduate PDE.

Test 1 Sample Part 2 Problems - #2

wbartoli

I've completed problem #2 on the sample problems handout. I was wondering if someone could confirm the solution, so I could make sure I'm doing things right.

Given: $\phi(x)=2$ if $|x|\leq 3$, or $\phi(x)=0$ otherwise (I couldn't figure out how to format the array for the piecewise function), express the solution to the heat problem $u_t=u_{xx}, u(x,0)=\phi(x)$ in terms of the error function.

Setting up the solution,
$$u(x,t)=\int_{-\infty}^\infty \phi(y)G(x-y,t)\ dy$$

Plugging in the bounds given by the $\phi$ function and using the heat kernel,
$$u(x,t)=\int_{-3}^3 2\frac{1}{\sqrt{4\pi k t}}e^{-\frac{(x-y)^2}{4kt}}\ dy$$
$$u(x,t)=\int_{-3}^3 2\frac{1}{\sqrt{4\pi k t}}e^{-\left(\frac{x-y}{2\sqrt{kt}}\right)^2}\ dy$$

Making the u-substitution requires the following:
$$u=\frac{x-y}{2\sqrt{kt}}$$
$$du=-\frac{1}{2\sqrt{kt}}\ dy$$
$$-2\sqrt{kt}\ du=dy$$
Also, the new bounds of integration will be $u=\frac{x+3}{2\sqrt{kt}}$ and $u=\frac{x-3}{2\sqrt{kt}}$ for $y=-3$ and $y=3$, respectively. Plugging all this in gives me:
$$u(x,t)=\int_{\frac{x+3}{2\sqrt{kt}}}^{\frac{x-3}{2\sqrt{kt}}} \frac{2}{\sqrt{4\pi k t}}e^{-u^2}\ (-2\sqrt{kt})\ du$$
Simplifying the integral in terms of the error function reduces the integral to this:
$$u(x,t)= \frac{-4\sqrt{kt}}{\sqrt{4\pi k t}} \int_{\frac{x+3}{2\sqrt{kt}}}^{\frac{x-3}{2\sqrt{kt}}}e^{-u^2}\ du=-\frac{2}{\sqrt{\pi}} \int_{\frac{x+3}{2\sqrt{kt}}}^{\frac{x-3}{2\sqrt{kt}}} e^{-u^2}\ du=\frac{2}{\sqrt{\pi}} \int_{\frac{x-3}{2\sqrt{kt}}}^{\frac{x+3}{2\sqrt{kt}}} e^{-u^2}\ du$$






The last step gives the integral in terms of the error function, which can be written as:
$$u(x,t)=erf\left(\frac{x+3}{2\sqrt{kt}}\right)-erf\left(\frac{x-3}{2\sqrt{kt}}\right)$$

cromer

This looks like exactly what I got when I did the problem.

dwillia2

Just a note, your $\phi(x)$ should be $|x|\leq3$ instead of $\frac{1}{n}$. Looks like you did the problem using the correct value though.

jradford

Can somebody explain the last step evaluating the integral? Mainly - what happened to the $\frac{2}{\sqrt{\pi}}$

wbartoli

Thanks! Accidentally looked at problem #1 while writing down the question.

wbartoli

Jacob, I got rid of the integral by evaluating in terms of the error function, specifically
$$erf(a)-erf(b)=\frac{2}{\sqrt{\pi}}\int_a^b e^{-z^2}\ dx$$
Doing this includes the $\frac{2}{\sqrt{\pi}}$ in the $erf$ terms. The algebraic manipulation in the previous two steps was to get the integral to resemble the error function.

jradford

Ahh, I missed the fact that $\frac{2}{\sqrt{\pi}}$ is part of the error function. Thanks!

wbartoli

Yes it is, no problem!

gigaliciousness

Hey! Just being a nitpicker, but you're missing a square in the exponential after you've initially plugged in the bounds to the function! It should be: $$u(x,t)=\int_{-3}^{3} 2\frac{1}{\sqrt{4πkt}}e^{-\frac{(x-y)^2}{4kt}}dy$$

(don't worry, you carried through correctly and everything else is awesome, again, just being a nitpicker!)

wbartoli

Thanks, @gigaliciousness! I fixed it. I guess my proofreading skills aren't quite up to par tonight.

cbridges

I was working out the problem and I got the bounds of the integral flipped. Initially, I got the integral going from $u=\frac{x-3}{2\sqrt{t}}$ (lower bound) to $u=\frac{x+3}{2\sqrt{t}}$ (upper bound). So then when I switched the bounds to get rid of the negative I got the integral going from $u=\frac{x+3}{2\sqrt{t}}$ (lower bound) to $u=\frac{x-3}{2\sqrt{t}}$ (upper bound). Thus my answer was $erf (\frac{x-3}{2\sqrt{t}})+erf (\frac{x+3}{2\sqrt{t}})$.

If anyone is could help me out.

wbartoli

@cbridges, remember that $u=\frac{x-y}{2\sqrt{kt}}$, so the original bounds will be the following when you plug in $y=-3$ and $y=3$. (Added italics to emphasize.)

rlewis1

Can't we eliminate k entirely? From our original equation, $$u_{t}=u_{xx}$$ so k just equals 1. Can anybody back me up on this?

shill2

Just what I was thinking. I can corroborate this line of thinking. Otherwise great solution.

Vince

I agree for sure. We can probably just start with this as our kernel:

$$G (x)=\frac{e^{-\left(\frac{x}{\sqrt{4 t}}\right)^2}}{\sqrt{4 \pi t}}$$