I need to find a formal solution to
\begin{eqnarray} &u_{tt} &= c^2 u_{xx}, \;\;\;0<x<1, \mathrm{and \;}t>0\\ &u(x,0)&=x+1,\\ &u_t(x,0)&=x(1-x), \;\;\;\;0 \leq x \leq 1\\ &u(0,t) &= 1,\\ &u(1,t)&= 2, \;\;\;\;\;\;\;\;\;\;\;\;\; t\geq 0 \end{eqnarray}
I tried doing separation of variables and assuming $u(x,t)=X(x)\cdot T(t)$, but the boundary conditions are confusing me.
I get $X^{\prime\prime}(x)+\lambda X(x)=0$, so $X(x) = \alpha e^{-\sqrt{-\lambda}x}+\beta e^{\sqrt{-\lambda}x}$. When I use $X(0)=1$ and $X(1)=2$, I get,
\begin{eqnarray} \beta &=& \frac{2-e^{-\sqrt{-\lambda}}}{e^{\sqrt{-\lambda}}+e^{-\sqrt{-\lambda}}}\\ \alpha&=& \frac{2e^{-\sqrt{-\lambda}}+e^{\sqrt{-\lambda}}-2}{e^{\sqrt{-\lambda}}+e^{-\sqrt{-\lambda}}}, \end{eqnarray}
but I feel like this isn't leading me in the right direction. Any suggestions?