I would be thankful to anyone who can present an analytical solution to the following inhomogeneous PDE equation:


$$\frac{\partial{u}}{\partial{t}}= \alpha\frac{\partial^2{u}}{\partial{x^2}}-ku$$


$$u(0,t) = 0$$


$$u(1,t) = M\_R$$


$$u(x,0) = x\*f(x)$$


where k, $\alpha$ and $M\_R$ are constants and k>0.



Analytical solution to inhomogeneous parabolic PDE
Set first $u= ve^{-kt}$ so that
$
\partial\_t u+ku=e^{-kt}(\partial\_t v-kv+kv)=e^{-kt}\partial\_t v.
$
The equation becomes
$$
\partial\_t v=\alpha\partial\_x^2 v, \quad v(0,t)=0, \quad v(1,t)=M\_R e^{kt}, \quad v(x,0)=x\ast f(x).
$$
You may assume $\alpha =1$ by writing $v(x,t)=w(x, \alpha t)$ and get then
$$
\partial\_t w=\partial\_x^2 w, \quad w(0,t)=0, \quad w(1,t)=M\_R e^{kt/\alpha}, \quad w(x,0)=x\ast f(x),
$$ 
ending-up with an Initial-value and boundary problem for the heat equation. You can follow the standard Fourier method by looking for $2$-periodic functions in the variable $x$.


