Consider the heat equation $u_t=u_{xx}, 0<x<\pi,t>0$ with the boundary conditions $u(0,t)=0,u(\pi,t)=0$ for $t>0$ and the initial condition $u(x,0)=\sin x$. Then $u(\pi/2,1)=?$
Solution: Let $u(x,t)=X(x)T(t)$ be a solution of given heat equation. Then
$X''/X=T'/T=-p^2(say)$
Then
$X''+p^2X=0$ and $T'+p^2T=0$.
Then, we have
$X=c_1\cos px+c_2\sin px$ and $T=c_3e^{-p^2t}$.
It follows that,
$u(x,t)=(c_1\cos px+c_2\sin px)c_3e^{-p^2t}$.
Applying the condition $u(0,t)=0$, we obtain
$0=c_1c_3e^{-p^2t}\cos px$
As $c_3\neq 0$ so $c_1=0$.
Thus, we have $u(x,t)=c_2c_3\sin px e^{-p^2t}$
Now applying the condition $u(\pi,t)=0$. we have
$0=c_2c_3\sin p\pi e^{-p^2t}\Rightarrow \sin p\pi=0\Rightarrow p=n,n\in\mathbb Z$
Hence, we have $u(x,t)=c_2c_3e^{-n^2t}\sin n x$.
Now, applying the condition $u(x,0)=\sin x$. we have
$\sin x=c_2c_3\sin nx$ Using these values we have
$u(x,t)=\frac{sin x}{\sin nx} \cdot \sin nx\cdot e^{-n^2t}$
$u(x,t)=\sin x e^{-n^2t}$.
Now, $u(\pi/2,1)=\sin (\pi/2)e^{-n^2}=e^{-n^2}$
Given answer is 0.36 which is only true if I put $n=\pm1$, so my question is why $n=\pm 1$, or my solution need some more things. Please help me out!
Let $u(x,t)=X(x)T(t)$ be a solution of given heat equation. Then
$X''/X=T'/T=-p^2(say)$
Then
$X''+p^2X=0$ and $T'+p^2T=0$.
Then, we have
$X=c_1\cos px+c_2\sin px$ and $T=c_3e^{-p^2t}$.
It follows that,
$u(x,t)=(c_1\cos px+c_2\sin px)c_3e^{-p^2t}$.
Applying the condition $u(0,t)=0$, we obtain
$0=c_1c_3e^{-p^2t}\cos px$
As $c_3\neq 0$ so $c_1=0$.
Thus, we have $u(x,t)=c_2c_3\sin px e^{-p^2t}$
Now applying the condition $u(\pi,t)=0$. we have
$0=c_2c_3\sin p\pi e^{-p^2t}\Rightarrow \sin p\pi=0\Rightarrow p=n,n\in\mathbb Z$
Hence, we have $u(x,t)=c_2c_3e^{-n^2t}\sin n x$.
Now, applying the condition $u(x,0)=\sin x$. we have
$\sin x=c_2c_3\sin nx\implies n=1$, and $c_2c_3=1$. Using these values we have
$u(x,t)=1 \cdot \sin (1\cdot x)\cdot e^{-1^2t}$
$u(x,t)=\sin x e^{-t}$.
Now, $u(\pi/2,1)=e^{-1}=0.36$