Piecewise function as initial condition in Heat Equation exercise - Confirm solution

1.7k Views Asked by At

I have $u_t = u_{xx}$ for $0<x<1$,

$u(0,t) = 0, \; 0 \leq t < \infty$

$u(1,t) = 0, \; 0 \leq t < \infty$

$u(x,0) = \varphi(x), \; 0 \leq x \leq 1$ where $\varphi(x) = \begin{cases} \frac{5x}{2}, 0 < x < \frac{2}{3} \\ 3-2x, \frac{2}{3} < x < 1 \end{cases}$

I know the general solution to the heat equation written as $u_t = \alpha^2 u_{xx}$ for $0 < x< l$, $t > 0$

$u(0,t) = 0, \; u(l,t) = 0$ for all $t > 0$ and $u(x,0) = f(x)$ for all $0<x<l$ is $u(x,t) = \sum_{k=1}^{\infty} \beta_k \sin(\frac{k\pi}{l}x)e^{\frac{-\alpha^2 \pi^2 k^2 t}{l^2}}$ where $\beta_k = \frac{2}{l}\int_0^l sin(\frac{k \pi x}{l})dx$. This is derived directly from applying the method of separation of variables.

I've never had a piece-wise function as the initial condition for this sort of exercise so I want to confirm my thoughts for the solution. I think $u(x,t) = \sum_{k=1}^{\infty} \beta_k \sin(\frac{k\pi}{1}x)e^{\frac{-\alpha^2 \pi^2 k^2 t}{1^2}}$ where $\beta_k = \begin{cases} \frac{2}{\frac{2}{3}}\int_0^\frac{2}{3} \frac{5x}{2}\sin(\frac{k \pi}{1}x)e^{\frac{-1^2 \pi^2 k^2 t}{1^2}} ,\; 0 < x<\frac{2}{3} \\ \frac{2}{1}\int_\frac{2}{3}^1 (3-2x)\sin(\frac{k \pi}{1}x)e^{\frac{-1^2 \pi^2 k^2 t}{1^2}} ,\; \frac{2}{3} < x<1\end{cases}$.

Is this correct?

2

There are 2 best solutions below

4
On

Yes, this is correct, it is just an integration by part.

0
On

The general solution of your problem is given by the formula $$ u(t,x)=\sum_{0}^{\infty }A_{n}\sin (\frac{n\pi }{L}x)e^{-(\frac{n\pi }{L}% )^{2}t} $$

with $(x,t)\in (0,L)\times (0,\infty )$

since the family $\left( \sin (\frac{n\pi }{L}x)\right) _{n\geq 1}$ is orthogonal system in $L^2(0,L)$, a direct computation gives

$$ \int_{0}^{L}\sin (\frac{n\pi }{L}x)\sin (\frac{m\pi }{L}x)dx=\left\{ \begin{array}{c} 0\text{ if }n\neq m \\ L/2\text{ if }n=m% \end{array}% \right. . $$

To obtain the coefficient $A_{n}$ , let $t=0$ in the above formula, we multiply $u(0,x)$ by $\sin (\frac{m\pi }{L}x)$ and integrating over $(0,L):$ $$ \int_{0}^{L}u(0,x)\sin (\frac{m\pi }{L}x)dx=\sum_{0}^{\infty }A_{n}\int_{0}^{L}\sin (\frac{m\pi }{L}x)\sin (\frac{n\pi }{L}x)dx=\left\{ \begin{array}{c} 0\text{ if }n\neq m \\ L/2\text{ if }n=m% \end{array}% \right. $$

so we can deduce that $A_{n}=\frac{2}{L}\int_{0}^{L}u(0,x)\sin (\frac{m\pi }{% L}x)dx.$