An archived instance of discourse for discussion in undergraduate PDE.

A simple heat problem

Mark

Solve the heat problem
$$
\begin{array}{ll}
u_t=u_{xx} & u(x,0) = 1 \\
u(0,t) = 0 & u(\pi,t) = 0.
\end{array}
$$





rjensen

Using Fourier's solution to the heat equation, we know that a solution will be of the form:
$$ \sum\limits_{i=0}^\infty a_n e^{-n^2t} sin(nx) $$
where,
$$a_n = \frac{2}{\pi} \int_0^\pi f(x) sin(nx) dx.$$
So in our case since $f(x) = 1$,
$$a_n = \frac{2}{\pi} \int_0^\pi sin(nx) dx.= \frac{-2}{\pi n}\left[ cos(n\pi) - cos(0) \right].$$
Replacing $cos(n\pi)$ with $(-1)^n$ since $cos(n\pi) = \{1, -1, 1, -1,...\}$ gives:
$$a_n = \frac{-2}{\pi n}\left[ (-1)^n - 1 \right] = \frac{2}{\pi n}\left[ (-1)^{n+1} + 1 \right].$$
Putting it together gives a solution:
$$ u(x,t) = \sum\limits_{i=0}^\infty \frac{2}{\pi n}\left[ (-1)^{n+1} + 1 \right] e^{-n^2t} sin(nx) .$$
Not sure if this is legit but it looks similar to a linear combination of two other solutions ($a_n, a_m$):
$$ u(x,t) = \sum\limits_{i=0}^\infty \frac{2}{\pi n}(-1)^{n+1}e^{-n^2t} sin(nx) + \sum\limits_{i=0}^\infty \frac{2}{\pi n}e^{-n^2t} sin(nx).$$










Mark

Very nice - just a couple of little comments. Your index of summation on your sums is $i$, but you're using $n$ in your formula. Also, like the combined version with $(-1)^{n+1}+1$ in there better. In fact, we can see that term is zero for even $n$ and $2$ for odd $n$. Thus, we can can drop all the even terms by replacing the $n$ with a $2n+1$. The final result looks like
$$
\frac{4}{\pi }\sum _{n=0}^{\infty }
\frac{\exp \left(-(2 n+1)^2
t\right) \sin ((2 n+1) x)}{2
n+1}.
$$





Might be fun to try to plot it with Mathematica to double check.