I'm looking for help with the following problem. We have the heat equation $u_t=Du_{xx}$ modelling the temperature across a conducting material, defined for $0<x<1, t>0$ with boundary conditions $u_x(0,t)=u_x(1,t)=0$ and initial condition $u(x,0)=\begin{cases} 1 & 0<x\leq a \\ 0 & a<x<1 \\ \end{cases}$.
Questions:
(i) What is the physical interpretation of the boundary conditions?
Attempt at solution: The difference in temperature at each of the boundaries? (Not quite sure what the partial derivative of $u$ w.r.t $x$ would represent?)
(ii) How would the solution be effected if $D<0$?
Attempt at solution: Temperature would be concentrating instead of spreading out so the solution would tend to infinity?
(iii) Solve the equation?
Attempt at solution: $u(x,t)=X(x)T(t)$ so by separation of variables we get $X(x)=\cos(n\pi x), n=0,1,...$ and $T(t)=e^{-n^2\pi^2Dt}$. Hence $u(x,t)=\displaystyle\sum_{n=0}^\infty a_ne^{-n^2\pi^2Dt}\cos(n\pi x)$.
Using the I.C. we have $u(x,0)=\displaystyle\sum_{n=0}^\infty a_n\cos(n\pi x)=\begin{cases} 1 & 0<x\leq a \\ 0 & a<x<1 \\ \end{cases}$.
So for $a<x<1 $, we have $a_n=0$, hence $u(x,t)=0$ for $a<x<1 $.
For $0<x\leq a$, we have $a_n=\frac{\int_0^1\cos(n\pi x)}{\int_0^1\cos^2(n\pi x)}=2\int_0^1\cos(n\pi x)=\begin{cases} 1 & n=0 \\ 0 & \text{otherwise} \\ \end{cases}$
Hence solution is $u(x,t)=1$ for $0<x\leq a$?
To me this doesn't seem correct as the following question asks about the solution's decaying behaviour, yet from my computations the solution remains the same for all $t$? Any help on where I've gone wrong would be appreciated.
EDIT:
I've now computed $a_n$ by using $a_n=2\left(\int_0^a\cos(n\pi x)dx+\int_a^1 0dx\right)$ for $n>0$, so is it true that $u(x,t)=a+\displaystyle\sum_{n=1}^\infty\frac{2}{n\pi}\sin(n\pi a)e^{-n^2\pi^2Dt}\cos(n\pi x)$?