Use method separation of variables: $\frac{{\partial u}}{{\partial y}} = \frac{{{\partial ^2}u}}{{\partial {x^2}}} - 4u$ I did the dpe:
$$\frac{\partial u}{\partial y} = \frac{\partial ^2 u}{\partial x^2} - 4u$$
$0 < x < \pi $ 
With boundary conditions: $\begin{array}{l}
 u(0,y) = u(\pi ,y) = 0 \\ 
 u(x,0) = {x^2} - \pi x \\ 
 \end{array}$
I used method separation of variables to solve the problem, and i got the solution is:
$$u(x,y) = \sum\limits_{n = \text{even}} \frac{- 8}{\pi n^3} \sin (nx) e^{ - (4 + n^2)y} $$
However, I feel that the solution is not fit with the boundary conditions
Could you give some hint??
 A: Using separation of variables
$$
u = XY \\
u_y = XY' \\
u_{xx} = X''Y \\
XY' = X''Y - XY \\
\frac {Y'}Y = \frac {X''}X - 4
$$
Since LHS and RHS are functions of different variables, they must be equal to some constant
$$
\frac {Y'}Y = \frac {X''}X - 4 = -\lambda^2-4 \\
\frac {Y'}Y = -\lambda^2-4 \\
Y = Y_0 e^{-(\lambda^2+4) y} \\
\frac {X''}X = -\lambda^2 \\
X = X_{01} \cos( \lambda x) + X_{02} \sin (\lambda x) \\
u = Y_0 e^{-(\lambda^2+4) y} \left (X_{01} \cos(\lambda x) + X_{02} \sin (\lambda x) \right )
$$
Applying first and second BCs
$$
u(0, y) = Y_0 e^{-(\lambda^2+4) y} X_{01} = 0 \\
u(\pi, y) = Y_0 e^{-(\lambda^2+4) y} X_{02} \sin (\lambda \pi) = 0
$$
From first equation $X_{01} = 0$, since if $Y_0$ one gets trivial solution. From second
$$
\lambda \pi = \pi n, \quad n \in \mathbb Z \\
\lambda = n\\
u = \sum_{n = 1}^\infty Y_0 e^{-(n^2+4) y} X_{01n} \sin nx
$$
Coefficients $X_{01n}$ can absorb $Y_0$, so without loss of generality, one can say
$$
u = \sum_{n = 1}^\infty X_{01n} e^{-(n^2+4) y} \sin nx
$$
Now apply third BC
$$
u(x, 0) = \sum_{n = 1}^\infty X_{01n} \sin nx = x^2 - \pi x
$$
So, basically you need to find LHS expansion of $x^2-\pi x$.
$$
b_n = \frac 2\pi \int_0^\pi (x^2 - \pi x) \sin n x dx = -\frac 4 {n^3 \pi} (-1+\cos n \pi) = \frac 8{n^3 \pi},\quad n \text{ is odd}
$$
so
$$
u = \frac 8{\pi^3} \sum_{n = odd} \frac {e^{-(n^2+4) y} \sin nx}{n^3}
$$
