Use the method of Separation of Variables to solve $ u_t-ku_{xx}=2x^2t$ Use the method of Separation of Variables to solve 
$$u_t-ku_{xx}=2x^2t\;\;0<x<1,t>0\\
u(0,x)=\cos(\frac{3 \pi x}{2})\;\;0<x<1\\
u(t,0)=1,u(t,1)=\frac{3 \pi}{2}\;\;t>0$$
my attemt:
suppose i take $u(x,t)=X(x)T(t)$
then $u''_x=X''T, u'_t=XT'$
then given equation reduced to $XT'-kX''T=2x^2t$
can any help me with this problem..and please tell me how to slove non-homogenous PDE equation or suggest me some good book for PDE with non homogenous that contains problem ..please 

 A: $$u_t-ku_{xx}=2x^2t$$
You cannot directly use the separation of variables as you did because the PDE is not homogeneous.
HINT :
First, one have to change of function $u(t,x)$ to another function $v(t,x)$ such as the PDE becomes homogeneous. So, we look for a particular solution $y(t,x)$ so that :
$$u(t,x)=v(t,x)+y(t,x) \quad\text{with}\quad
\begin{cases}y_t-ky_{xx}=2x^2t \\v_t-kv_{xx}=0\end{cases}$$
Doesn't matter the particular solution $y(t,x)$ is. So, we can look for one  as simple as possible, for example a polynomial easy to guess(or to determine by identification method) :
$$y(t,x)=x^2t^2+\frac{2k}{3}t^3$$
Then, the method of separation of variables $v(t,x)=T(t)X(x)$ can be used.
A: Separation of variables only works if you have homogeneous endpoint conditions. To this end, let
$$
               v(t,x) = u(t,x)-(1+(\frac{3\pi}{2}-1)x).
$$
The equation for $v$ becomes
$$
                v_t  - v_{xx} = u_t-u_{xx}= 2x^2t, \\
                v(t,0)=u(t,0)-1=0, \\
                v(t,1)=u(t,1)-\frac{3\pi}{2}=0, \\
                v(0,x)=u(0,x)-(1+(\frac{3\pi}{2}-1)x)
          =\cos(3\pi x/2)-(1+(\frac{3\pi}{2}-1)x).
$$
Now you can expand in the solutions of $-X''=\lambda X$, $X(0)=X(1)=0$, which have the form $X_n(x)=\sin(n\pi x)$:
$$
            v(t,x) = \sum_{n=1}^{\infty}T_n(t)\sin(n\pi x)
$$
Substituting into the equation for $v$ gives equations for $T_n$:
$$
             \sum_{n=1}^{\infty}(T_n'(t)+n^2\pi^2T_n(t))\sin(n\pi x)=2x^2t
$$
Multiplying by $\sin(m\pi x)$ and integrating over $[0,1]$, and using the orthogonality of the $\sin(n\pi x)$ functions leads to
$$
    T_n'(t)+n^2\pi^2T_n(t)= t\frac{\int_{0}^{1}2x^2\sin(n\pi x)dx}{\int_{0}^{1}\sin^2(n\pi x)dx} \\
     \frac{d}{dt}\left(e^{n^2\pi^2 t}T_n(t)\right)=te^{n^2\pi^2 t}C_n
$$
Integrating both sides in $t$ over $[0,t]$ gives
$$
     e^{n^2\pi^2 t} T_n(t) -T_n(0) = C_n\int_{0}^{t}se^{n^2\pi^2 s}ds \\
     T_n(t) = T_n(0)e^{-n^2\pi^2 t}+C_n e^{-n^2\pi^2 t}\int_{0}^{t}se^{n^2\pi^2s}ds
$$
The coefficients $T_n(0)$ are determined from the initial data for the system:
$$
     \sum_{n=1}^{\infty}T_n(0)\sin(n\pi x) = v(0,x)
$$
