I'm trying to solve the partial differential equation $\frac{\partial u}{\partial t} = \frac{\partial^2 u}{\partial x^2}$ on the square $[0,\pi] \times [0,b[$ with initial conditions:
$u(0,t) = 0$
$u(x,0) = \sin(x)$
$u(\pi,t) = \sin(t)$
I know I have to use the separation of variables, and I know exactly how to solve it when $u(\pi,t) = 0$, because I then have $X(0) = X(\pi) = 0$. But know we have $X(\pi)T(t)=sin(t)$, which seems useless to me. Can you help me?
Find any function that satisfies the boundary conditions, like $\dfrac{1}{\pi}\,x\sin t$, and let $$ u(x,t)=v(x,t)+\frac{1}{\pi}\,x\sin t. $$ Then $v$ satisfies $$ \begin{cases} v_t-v_{xx}=-\dfrac{1}{\pi}\,x\cos t,\\ v(x,0)=\sin x,\\ v(0,t)=v(\pi,t)=0. \end{cases} $$ This can be solved by separation of variables looking for a solution of the form $$ v(x,t)=\sum_{n=1}^\infty v_n(t)\sin(n\,x). $$