I am asked to solve the following problem $$\begin{cases} u_t-u_{xx} = u + \sin 2x \,& 0 < x < \pi, t >0\\ u(x,0)=0 & 0 \leq x \leq \pi\\ u(0,t)=u(\pi, t) = 0 & t >0 \end{cases}$$
So I first did seek for a solution of the form $v(x,t) = e^{-t}u(x,t)$ to "kill" that $u$ term. Transforming the problem we get $$\begin{cases} v_t - v_{xx} = e^{-t}\sin 2x \, & 0<x<\pi t>0\\ v(x,0) = 0 & 0 \leq x \leq \pi\\ v(0,t)=v(\pi,t)=0 & t>0 \end{cases}$$
Now i'd try to solve the homogeneous problem (without the $e^{-t}\sin 2x $ term), and apply the variation of parameters method, that is seeking for solutions of the form $v(x,t) = X(x)T(t)$.
The $T' = \lambda T$ equation has a general solution of the form $T(t) = C e^{\lambda t}$, and for the other equation, considering the case $\lambda < 0$ since the other cases yield trivial solutions, letting $\lambda = - \mu^2$ $$X(x) = A \cos (\mu x) + B \sin (\mu x)$$ and applying the boundary conditions, $0 = X(0) = A$ so $A = 0$ and $0 = X(\pi) = B \sin (\mu \pi)$ so $ \mu = n$ for $n$ and integer. Therefore $$v(x,t) = \sum_{n=0}^{\infty} C_n e^{-n^2 t} \sin (nx)$$
But now, applying the other boundary condition, we get $$0 = \sum_{n=0}^{\infty} C_n \sin (nx)$$ so all $C_n = 0$ and the solutions is again the trivial one. The question then is
Where did I commit a mistake? Is this possible?
Following my hint, you should be able to see that the second coefficient($C_2$) of the eigenfunction expansion should be nonzero. Thus arriving to the solution
$$v(x,t) = -\frac{1}{3}\left(e^{-t} - e^{-4t}\right)\sin{(2x)}$$
Hence,
$$u(x,t) = -\frac{1}{3}\left(e^{-2t} - e^{-5t}\right)\sin{(2x)}$$
is the unique solution to the original problem.