Separation of Variables with functions which are not eigenfunctions I'm studying a book named 'Computational Techniques for fluid dynamics' by Fletcher , and it solves a heat conduction problem with mixed boundary conditions.
$$\frac{\partial T}{\partial t}-\alpha \frac{\partial^2 T}{\partial^2 x}=0~, \qquad \begin{aligned} 
&\text{B.C.}\quad \left\{ \begin{aligned}
\frac{\partial T}{\partial x}(0,t) &= -2 \\
T(1,t) &=1 \end{aligned} \right.\\
&\text{I.C.} \quad T(x,0) =3-2x-2x^2+2x^3
\end{aligned}$$
And it formulates the form of solution as 
$$T=3-2x+b_0+\sum_{j=1}^J{a_j \sin(2\pi j x )+b_j \cos(2\pi j x)}$$
I cannot understand how it comes out. I can see how 3-2x comes from the steady state solution, but what about Fourier series? They doesn't even satisfy boundary conditions individually!
However, the method works, I mean, if I plug in that form in the heat equation and let the computer solves for all coefficients a and b, I can see the numerical solution fits exactly on the exact solution.
So my question is, how non-eigenfunction can works as a component of separation of variables, and if it works, why the book had to separate steady state solution at all?
Why it just didn't assume 
$$T=b_0+\sum_{j=1}^J{a_j \sin(2\pi j x )+b_j \cos(2\pi j x)}$$
and let computer do all the job? (I tried that, but it failed, and I cannot see what's the difference)
 A: 
So my question is, how non-eigenfunction can works as a component of separation of variables, and if it works, why the book had to separate steady state solution at all?
  Why it just didn't assume 
  $$T=b_0+\sum_{j=1}^J{a_j \sin(2\pi j x )+b_j \cos(2\pi j x)}$$
  and let computer do all the job? (I tried that, but it failed, and I cannot see what's the difference)

Since we aren't requiring $T(0,t) = T(1,t)$, this isn't the general form for a bounded function on $[0,1]$. The general form is
$$T=a_0x + b_0+\sum_{j=1}^J{a_j \sin(2\pi j x )+b_j \cos(2\pi j x)},$$
where $a_0$ is needed since the rest of the function is periodic. You'll note this is identical to the trial solution from the book except they chose $a_0 = -2$ in advance.
A: (That $\partial T/\partial t$ is supposed to be $\partial T/\partial x$, right?)
The function $u(x,t) = T(x,t) - (3-2x)$ (i.e., the deviation from the steady state) satisfies the heat equation with homogeneous boundary conditions $u_x(0,t)=0$, $u(1,t)=0$, so it makes sense to look for a Fourier series solution for $u$. Once you have that, the final solution will $T(x,t)$ will be the steady state $3-2x$ plus the Fourier series $u(x,t)$.
