# Thread: Heat Equation u_t=ku_xx, k>0

1. ## Heat Equation u_t=ku_xx, k>0

Folks,
THis is my first of this type.

$\displaystyle u_t=ku_{xx}$ given $\displaystyle u_x(0,t)=u_x(1,t)=0$ and $\displaystyle u(x,0)=x, x \in (0,1)$.

The domain $\displaystyle x \in [0,1] \text{and} t \in [0,\infty)$

Using separation of variables with u(x,t)=F(x)G(t)

$\displaystyle \displaystyle \frac{G'(t)}{G(t)}=k\frac{F''(x)}{F(x)}=\lambda \therefore$General solution for $\displaystyle F(x)=C'cos(\beta x)+D'sin(\beta x)$ and $\displaystyle G(t)=Be^{\lambda t}$

For non trivial solution let $\displaystyle \lambda=-a^2<0$ where a>0. Let $\displaystyle r^2=\frac{\lambda}{k}$ therefore $\displaystyle \beta=\pm i \frac {a}{\sqrt{k}}$

$\displaystyle F'(0)=0$ and $\displaystyle F'(1)=0$ $\displaystyle \implies D=0$ and $\displaystyle sin(\frac{a}{\sqrt{k}})=0\implies -a^2=\lambda=-kn^2 \pi^2$

$\displaystyle u(x,t)=F(x)G(t)=[Ccos(\frac{a x}{\sqrt k}})+Dsin(\frac{a x}{\sqrt k}})]e^{\lambda t}$

The general solution for the BC's is

$\displaystyle F_n(x)G_n(t)=\sum_{n=1}^{\infty} C_n e^{-kn^2 \pi^2 t} cos(n \pi x)$ for n=1,2,3

How am I doing so far?

2. Looks good so far. Now expand x as a cosine series. Since cosine is even, you will really need to find the Fourier series for |x| on [-1, 1].

3. Originally Posted by HallsofIvy
Looks good so far. Now expand x as a cosine series. Since cosine is even, you will really need to find the Fourier series for |x| on [-1, 1].
For the IC,

$\displaystyle \displaystyle x=\sum_{n=1}^{\infty} C_n cos(n \pi x), C_n=\frac{2}{L}\int_{0}^{L} cos \frac{n \pi x}{L} f(x) dx$ where f(x)=x

Is L=1? Therefore integrating by parts I get

$\displaystyle C_n= \displaystyle \frac{2}{n^2 \pi^2}[(-1)^n-1], C_0=2\int_{0}^{1}xdx=1$
therefore

$\displaystyle u(x,t)= \frac{1}{2} +\sum_{n=1}^{\infty}(\frac{2}{n^2 \pi^2}[(-1)^n-1]cos(n \pi x))e^{-kn^2 \pi^2 t$

Is this correct?

Thanks

4. Originally Posted by bugatti79
For the IC,

$\displaystyle \displaystyle x=\sum_{n=1}^{\infty} C_n cos(n \pi x), C_n=\frac{2}{L}\int_{0}^{L} cos \frac{n \pi x}{L} f(x) dx$ where f(x)=x

Is L=1? Therefore integrating by parts I get

$\displaystyle C_n= \displaystyle \frac{2}{n^2 \pi^2}[(-1)^n-1], C_0=2\int_{0}^{1}xdx=1$
therefore

$\displaystyle u(x,t)= \frac{1}{2} +\sum_{n=1}^{\infty}(\frac{2}{n^2 \pi^2}[(-1)^n-1]cos(n \pi x))e^{-kn^2 \pi^2 t$

Is this correct?

Thanks
Assuming the above is correct, how would one actually differentiate this to check it satisifies the original DE when there is a summation in there. I am guessing since the heat equation above is linear second order and homogeneous which implies a linear combination of solutions is also a solution. If that is the case, can we set n=1 and then differentiate?

Thanks

5. Originally Posted by bugatti79
Assuming the above is correct, how would one actually differentiate this to check it satisifies the original DE when there is a summation in there. I am guessing since the heat equation above is linear second order and homogeneous which implies a linear combination of solutions is also a solution. If that is the case, can we set n=1 and then differentiate?

Thanks
Notice that

$\displaystyle \bigg| \frac{2}{n^2 \pi^2}((-1)^n-1) \cos(n \pi x) \bigg|\le \frac{4}{\pi^2}$

For all n, so for t > 0 you can use the Weierstrass M-test with

$\displaystyle M_n=\frac{4}{\pi^2}e^{-kn^2 \pi^2}t$

This shows that the series converges uniformly and this allows us to interchange the derivative and the sum!
n will be constant when you take both the x and t derivatives.

6. Originally Posted by TheEmptySet
Notice that

$\displaystyle \bigg| \frac{2}{n^2 \pi^2}((-1)^n-1) \cos(n \pi x) \bigg|\le \frac{4}{\pi^2}$

For all n, so for t > 0 you can use the Weierstrass M-test with

$\displaystyle M_n=\frac{4}{\pi^2}e^{-kn^2 \pi^2}t$

This shows that the series converges uniformly and this allows us to interchange the derivative and the sum!
n will be constant when you take both the x and t derivatives.
Thats interesting however beyond the scope of the question. So just out of curiosity, would u(x,t) be since it converges

$\displaystyle u(x,t)= \frac{1}{2} +\frac{4}{\pi^2}cos(n \pi x))e^{-kn^2 \pi^2 t$

Get the x and t derivatives and put back in DE?

Cheers

7. Originally Posted by bugatti79
Thats interesting however beyond the scope of the question. So just out of curiosity, would u(x,t) be since it converges

$\displaystyle u(x,t)= \frac{1}{2} +\frac{4}{\pi^2}cos(n \pi x))e^{-kn^2 \pi^2 t$

Get the x and t derivatives and put back in DE?

Cheers
This is exactly what you need! The solution is

$\displaystyle u(x,t)=\frac{1}{2}+\sum_{n=1}^{\infty}\left( \frac{2}{n^2\pi^2}[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

With what I said above we take take derivatives inside the sum this gives

$\displaystyle \frac{\partial }{\partial x} u(x,t)=\frac{\partial }{\partial x} \frac{1}{2}+\frac{\partial }{\partial x} \sum_{n=1}^{\infty}\left( \frac{2}{n^2\pi^2}[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

$\displaystyle \frac{\partial }{\partial x} u(x,t)=\sum_{n=1}^{\infty}\frac{\partial }{\partial x} \left( \frac{2}{n^2\pi^2}[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}=-\sum_{n=1}^{\infty}\left( \frac{2}{n\pi}[(-1)^n-1]\right)\sin(n \pi x)e^{-kn^2\pi^2t}$

Now if we take one more derivative with respect to x we get

$\displaystyle \frac{\partial^2 }{\partial x^2} u(x,t)=-\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

Now if you do the same thing with respect to t we get

$\displaystyle \frac{\partial }{\partial t} u(x,t)=-k\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

Now if you plug these into the ode you get

$\displaystyle u_t-ku_{xx}=-k\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}-k\left( -\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}\right)=0$

The key idea is we need to exchange limits eg bring the derivative inside the infinite sum.

We actually need more than just uniform convergence of the function, they must also be continuous and their derivatives must be uniformly convergent.

8. Originally Posted by TheEmptySet
This is exactly what you need! The solution is

$\displaystyle u(x,t)=\frac{1}{2}+\sum_{n=1}^{\infty}\left( \frac{2}{n^2\pi^2}[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

With what I said above we take take derivatives inside the sum this gives

$\displaystyle \frac{\partial }{\partial x} u(x,t)=\frac{\partial }{\partial x} \frac{1}{2}+\frac{\partial }{\partial x} \sum_{n=1}^{\infty}\left( \frac{2}{n^2\pi^2}[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

$\displaystyle \frac{\partial }{\partial x} u(x,t)=\sum_{n=1}^{\infty}\frac{\partial }{\partial x} \left( \frac{2}{n^2\pi^2}[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}=-\sum_{n=1}^{\infty}\left( \frac{2}{n\pi}[(-1)^n-1]\right)\sin(n \pi x)e^{-kn^2\pi^2t}$

Now if we take one more derivative with respect to x we get

$\displaystyle \frac{\partial^2 }{\partial x^2} u(x,t)=-\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

Now if you do the same thing with respect to t we get

$\displaystyle \frac{\partial }{\partial t} u(x,t)=-k\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

Now if you plug these into the ode you get

$\displaystyle u_t-ku_{xx}=-k\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}-k\left( -\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}\right)=0$

The key idea is we need to exchange limits eg bring the derivative inside the infinite sum.

We actually need more than just uniform convergence of the function, they must also be continuous and their derivatives must be uniformly convergent.
So we can only interchange the sum and derivative only when the series converges uniformly. Well Noted!

This is beautiful! Thank you very much TheEmptySet!