I am trying to find the solution of the following Initial boundary- value problem. \begin{equation*} u_t = k \Delta u ~~~~~~0<x<1,~~~~ 0<y<1 ~~~~,0<t<1 \end{equation*} \begin{equation*} u(x,y,0)= u_0(x,y)~~~~~ 0\leq x \leq 1, ~~0\leq y \leq 1\\ u(0,y,t)=u(1,y,t)=cos(\pi y)~~~~~ 0\leq t \leq 1, ~~0\leq y \leq 1\\ u_y(x,0,t)=u_y(x,1,t)=0~~~~~ 0\leq t \leq 1, ~~0\leq x \leq 1\\ \end{equation*}
My attempt: By the method of separation of variables, we may assume a non trivial separable solution in the form \begin{equation*} u(x,y,t)=U(x,y)T(t) \end{equation*} Substituting this into the give PDE, we get \begin{equation*} T' + \lambda k T=0\\ \Delta U +\lambda U =0 \end{equation*}
I assume a non trivial separable solution in the form $U(x,y)=X(x)Y(y)$, then we have \begin{equation*} X''-\mu X=0\\ Y''+(\lambda + \mu)Y =0 \end{equation*} Because the conditions in x are homogenous, we choose $\mu = -\alpha^2$ so that \begin{equation*} X''+\alpha^2 X=0\\ X(x)= A ~cos(\alpha x) +B~ sin(\alpha y) \end{equation*}
Now we have,
\begin{equation*} u(0,y,t)=cos(\pi~ y) \implies U(0,y)T(t) = cos(\pi~y)\\ \implies X(0)Y(y) = cos (\pi~y) = X(1)Y(y)\\ X(0)=X(1)=1\\ Y(y) = cos(\pi~y) \end{equation*}
I am little confused in the calculation of boundary conditions here.
Can anyone suggest the solution of the boundary condition here?