To find the eigenfunctions $X_n$, substitute a trial solution $u=T(t)X(x)$ into the homogeneous part of the partial differential equation, $u_t = u_{xx} + xt$. Remember: ignore the inhomogeneous part $tx$ when finding the eigenfunctions. $$\frac{T'}{T} = \frac{X''}{X} = \mbox{constant} = \lambda.$$
We then get the following Sturm-Liouville problem for any eigenfunctions $X(x):$ $$\begin{equation}X''=\lambda X\label{x}\end{equation}$$ $$X(0)=X(L)=0.$$ Quickly go through three cases:- $\lambda = 0:$ $$X''=0\Rightarrow X(x)=Ax+B\Rightarrow A=B=0.$$
- $\lambda = \mu^2 = > 0:$ $$X''=\mu^2X\Rightarrow X=Ae^{\mu x}+Be^{-\mu x}\Rightarrow A=B=0.$$
- $\lambda = -\mu^2 = < 0:$ $$X''=-\mu^2X\Rightarrow X=A\cos{\mu x}+B\sin{\mu x}.$$ From b.c. $A=0$ and either $B = 0$ or $\sin{\mu x} = 0.$ The first case isn't interesting for us, because we would get no eigenvalues from it. The second case requires $\mu_n \pi = n\pi,$ so $\mu_n = n,$ that yields: $$X_n = A_n\sin{n x}.$$
To solve the equation we need to represent $x$ in terms of $X_n(x),$ which is as Fourier series on $[0,\pi]$ and then equate the coefficients on the right hand and the left hand sides.