# Heated rod utilizing super position

I am trying to solve the heat equation $$u_t=u_{xx}$$ with $$u(0,t)=0, u(1,t)=100, u(x,0)=\sin(\pi\,x), 0<x<1$$

obviously one solution is $100\,x$ for $u(0,t)=0, u(1,t)=100$, and I am supposed to use superposition to come up with a series solution.

my initial reaction is to consider this like a neumann problem letting $$u_x(1,t)=0, u_x(0,t)=0$$ and using seperation of variables to get $$u_n(x,t)=\cos(n\,\pi\,x)e^{n^2 \pi^2 t}$$ Then utilizing super position I can rerwrite my solution as

$$u(x,t) = a_0/2 + \sum_{n=1}^\infty a_n\cos(n\,\pi\,x)e^{n^2 \pi^2 t} +100x$$

keeping in mind that for $x=1$ the terms other then $100x$ go to $0$ as the $a_n$ and $a_0$ are picked in a way that for $u(x,0)$ we get $\sin(n \pi \,x)e^{n^2 \pi^2 t} + 100x$ which is $0+100x$. thus satisfying the initial condition I still feel as if I messed up as it does not satisfy $u(x,0)=\sin(\pi\,x)$

maybe I pick my $a$ values differently? Or maybe pick $100x$ to be $100 \alpha$ where $\alpha$ is a picecewise function that is 0 everywhere except x=1?

Why Neumann boundary conditions? Let $u=v(x,t)+100\,x$. Then $v$ satisfies the heat equation $v_t-v_{xx}=0$ with boundary and initial conditions $$v(0,t)=0,\quad v(1,t)=0,\quad v(x,0)=\sin(\pi\,x)-100\,x.$$ The solution will be of the form $$v(x,t)=\sum_{k=1}^\infty a_n\,e^{n^2\pi^2t}\sin(n\,\pi\,x).$$
• You cannot take the derivative of the boundary conditions: there is no $x$ in $u(0,t)=0$. – Julián Aguirre Aug 8 '18 at 10:15
• if you dont mind, could you explain to me why I cannot take the derivative of $u(0,t)=0$ by using separation of variables I have $X(0)T(t)=u(0,t)$ so wouldn't we assume any derivative of this would be 0? (sorry I dont have any experience taking derivatives of boundary conditions I only saw it as a potential way to get the problem into a familiar form) – yipper Aug 8 '18 at 10:36
• $$\frac{\partial u}{\partial x}(0,t)\ne\frac{\partial}{\partial x}\bigl(u(0,t)\bigr)$$ – Julián Aguirre Aug 8 '18 at 10:39