I have a PDE for $x\in [0,L]$: $$u_t=\alpha u_{xx}+f(t)$$ BCs and IC: $$u(0,t)=u(L,t)=0\text{ and }u(x,0)=f(x)$$ My first 'instinct' is to solve the homogeneous PDE. $$\alpha u_{xx}+f(t)=0$$ $$\alpha u_E''(x)=-f(t)$$ $$u_E(x)=-\frac12 f(t)x^2+c_1 x+c_2$$ With the BCs: $$c_2=0$$ $$c_1=\frac12 f(t)L$$ Then, with the superposition principle, we look for a new function $v(x,t)$: $$u(x,t)=v(x,t)+u_E(x)$$ $$u_t=v_t$$ $$u_x=v_{xx}$$ The latter solves easily to: $$v\left( {x,t} \right) = \sum\limits_{n = 1}^\infty {{A_n}\sin \left( {\frac{{n\pi x}}{L}} \right){{\bf{e}}^{ - \alpha{{\left( {\frac{{n\pi }}{L}} \right)}^2}\,t}}}$$ At $t=0$: $$v(x,0)=f(x)-u_E(x)$$ $$v(x,0)=f(x)-\left[\frac12 f(0)\left(L-x^2\right)\right]$$ Using the Fourier series: $${A_n} = \frac{2}{L}\int_{{\,0}}^{{\,L}}{{\left( {f\left( x \right) - \left[\frac12 f(0)\left(L-x^2\right)\right]\left( x \right)} \right)\sin \left( {\frac{{n\,\pi x}}{L}} \right)\,dx}}\,\,\,\,\,\,\,\hspace{0.25in}n = 1,2,3, \ldots$$ However, I have a niggling doubt in that $u_E(x)$, where the heat source is of the kind $F(x)$, is the steady state (or Equilibrium) function and it is free of time $t$. That is not the case here.
So is this derivation correct or not?