Using Sturm-Liouville theorem when solving nonhomogenous heat equation by eigenfunction expansion I am working my way through different methods for solving PDE's I find many of them challenging but I do my best to fully grasp the methods. I need some help with understanding some details for the method with eigenfunction expansion I think the two things I don't fully understand can be simplified as


*

*Combining series coefficients.

*Simplifying integrals using the Sturm Liouville theorem.


I have tried to present my questions as clear as I can by presenting my thoughts through the solution of the particular PDE I am working on, with some questionmarks along the way, and furthest down I have written what my questions are. 
So, I am trying to solve an nonhomogenous PDE of the form $$\partial u(x,t)/\partial t=k \partial^2 u(x,t)/\partial x^2+F(x,t)$$$$u(0,t)=u(\pi,t)=0$$$$u(x,0)=0$$ using Eigenfuntion expansion. In this particular case $F(x,t)=e^{-2t}sin(x)$
I start with solving the corresponding homogenous PDE, i.e when $F(x,t)=0$, using the method with separation of variables. Assuming $u(x,t)=X(x)T(t)$
I find the Eigenfunctions $$X_n(x)= c_n sin(nx)$$
and I find $$T_n(t)=b_ne^{-n^2kt}$$
Let $a_n=b_nc_n$. I have come to the result that my corresponding homogenous PDE, i.e when $F(x,t)=0$, has a solution $u_h(x,t)$ of the form. 
$$u_h(x,t)=\sum_{n=1}^\infty T_n(t)X_n(x)=\sum_{n=1}^\infty a_ne^{-n^2kt}sin(nx)$$
Assuming that the solution of the nonhomogenous PDE should take the form $$u(x,t)=\sum_{n=1}^\infty a_n(t)e^{-n^2kt}sin(nx)$$ and if I let $\alpha_n(t)=a_n(t)e^{-n^2kt}$.
$$u(x,t)=\sum_{n=1}^\infty \alpha_n(t)sin(nx)$$
This expression I substitute into the PDE $$(1)\space \sum_{n=1}^\infty \alpha_n'(t)sin(nx)=-\sum_{n=1}^\infty kn^2\alpha_n(t)sin(nx)+F(x,t)$$
Now I need to express the source-term $F(x,t)$ as a infinite series and after that I can hopefully find $\alpha_n(t)$ and the solution for $u(x,t)$ will be complete.
I express my source-term as an eigenfunction expansion
$$(2)\space F(x,t) =\sum_{n=1}^\infty f_n(t)X_n(x)=\sum_{n=1}^\infty f_n(t)c_nsin(nx)$$
Need to find the unknown $f_n(t)$. 
I choose $c_n$'s so that the norm $<c_nsin(nx),c_nsin(nx)>=1$. 
So $\{X_n(x)\}_1^\infty$ is an orthonormal set on $L^2[0,\pi]$.
<--Question 1
I multiply equation (2) with $X_m(x)=c_msin(mx)$ and integrate on $[0,\pi]$. <--Question 2
$$\int_0^\pi F(x,t)c_msin(mx) dx=\sum_{n=1}^\infty \int_0^\pi f_n(t)c_nsin(nx)c_msin(mx) dx$$
Using the Sturm Liouville theorem.
$<X_n,X_m>=0 $ if $m\neq n$
and $<X_n,X_m>=1 $ if $m=n$.
This leads to $$\int_0^\pi F(x,t)c_msin(mx) dx = \int_0^\pi f_n(t)dx=\pi f_n(t)$$
$$1/\pi \int_0^\pi F(x,t)c_msin(mx) dx =f_n(t)$$
And for this particular PDE, $F(x,t)=e^{-2t} sin(x)$, substituting into above equation yields $$1/\pi \int_0^\pi e^{-2t} sin(x)c_msin(mx) dx =f_n(t)$$ 
Using the Sturm Liouville theorem again and choose m=1 will yield
$$(3)\space e^{-2t}=f_n(t)=f_1(t)$$<---Question 3
Substituting equation (3) into equation (2), and then equation (2) into equation (1), to obtain
$$\sum_{n=1}^\infty \alpha_n'(t)sin(nx)=-\sum_{n=1}^\infty kn^2\alpha_n(t)sin(nx)+\sum_{n=1}^\infty f_n(t)sin(nx)$$<---Question 4
I can divide all the terms by $sin(nx)$.
$$\sum_{n=1}^\infty \alpha_n'(t)+ kn^2\alpha_n(t)=\sum_{n=1}^\infty f_n(t)$$
And since $e^{-2t}=f_n(t)=f_1(t)$ and $f_n(t)=0$ for all other $n$'s, we can simplify.
$$\alpha_1'(t)+ k\alpha_1(t)=e^{-2t}$$
which is a first order ODE which can be solved with integrating factor.
Resulting in:
$$u(x,t)=\sum_{n=1}^\infty \alpha_n(t)sin(nx)$$
$$u(x,t)=\alpha_1(t)sin(x)$$

Question 1: Is it ok to choose $c_n$'s this way? I think they are determined by the initial condition which I have not yet taken into account at this point and is it therefore ok to restrict the values?
Question 2: When I read many examples of somewhat similar excersises they seem to not include the coefficients $c_n$'s. If I don't I am not sure they are really solutions to the original Sturm-Liouville problem $X''(x)+\lambda X(x)=0$. And also, I wont be able to simplify the integral using the fact that $<c_nsin(nx),c_nsin(nx)>=1$
Question 3: My textbook finds this result. But I don't see how we can do it that way since $<sin(nx),c_nsin(nx)>\neq 1 $ necessarily since I have already chosen that $<c_nsin(nx),c_nsin(nx)>=1$. If we had excluded the $c_m$ in the first place we wouldn't face this problem, but then again if we do it that way I dont see how we can simplify the integral since $<sin(nx),sin(nx)>\neq 1$
Question 4: When they substitute $X_n(x)$ they don't include the $c_n$'s. Similar to what I observed in 'Question 2'.
 A: The eigenfunctions of the $X$ equation
$$
                      X''(x)=\lambda X(x),\;\;\; X(0)=X(\pi)=0,
$$
form a complete orthogonal basis of $L^2[0,\pi]$, which means that any function $f(x)$ can be expanded in a sum of such functions. The sum will converge in the $L^2[0,\pi]$ norm and, if sufficiently regular, will converge pointwise as well. Therefore, for a fixed $t$, it is possible to expand a solution of your inhomogeneous PDE as
$$
           u(x,t) = \sum_{n=1}^{\infty}c_n(t) X_n(x).
$$
The technique for solving the inhomogeneous solution is a matter of expanding in the orthogonal basis $\{ X_n(x)=\sin(nx) \}$ in order to reduce to an infinite system of coefficient equations for the $c_n(t)$.

Assuming the ability to interchange derivatives in $x,t$ with the sum leads to ODEs for each of the $c_n(t)$ functions:
$$
\sum_{n=1}^{\infty}c_n'(t)X_n(x)=k^2\sum_{n=1}^{\infty}c_n(t)X_n''(x)+F(x,t)\\
\sum_{n=1}^{\infty}c_n'(t)X_n(x)=-k^2\sum_{n=1}^{\infty}c_n(t)n^2X_n(x)+F(x,t).
$$
Expanding $F(x,t)=\sum_{n=1}^{\infty}d_n(t)X_n(x)$ gives, by uniqueness of Fourier coefficients,
$$
               c_n'(t)=-k^2n^2c_n(t)+d_n(t), \\
    \mbox{where }\;\; d_n(t) = \frac{\int_{0}^{\pi}F(x,t)X_n(x)dx}{\int_{0}^{\pi}X_n(x)^2dx}.
$$
The initial values of $c_n$ are determined by
$$
           0=u(x,0) = \sum_{n=1}^{\infty}c_n(0)X_n(x) \implies c_n(0)=0.
$$
Therefore, $c_n(t)$ is determined by the coefficient ODEs:
$$
             (c_n(t)e^{k^2n^2 t})' = d_n(t)e^{k^2n^2t} \\
           \implies c_n(t) = e^{-k^2n^2t}\int_{0}^{t}d_n(s)e^{k^2n^2 s}ds
$$
The solution $u$ may then be written as
$$
        u(x,t)=\sum_{n=1}^{\infty}\int_{0}^{t}d_n(s)e^{k^2n^2(s-t)}dsX_n(x)
$$
A: Adding some more detail to the answer of my particular example. 
$$F(x,t)=\sum_{n=1}^{\infty}f_n(t)X_n(x)=e^{-2t}sin(x)=\sum_{n=1}^{\infty}f_n(t)sin(nx)$$
Multiplying with $sin(mx)$ and integrating on $[0, \pi]$
$$\int_0^\pi e^{-2t}sin(x)sin(mx)dx=\sum_{n=1}^{\infty} \int_0^\pi f_n(t)sin(nx)sin(mx)dx$$
Using the Sturm Liouville theorem. The integral of the eigenfunctions $$\int_0^\pi X_n(x)X_m(x)dx$$
is zero for all but $m=n$. Simplifies the infinite sum to
$$\int_0^\pi e^{-2t}sin(x)sin(nx)dx= f_n(t)\int_0^\pi sin^2(nx)dx$$
$$\frac{\int_0^\pi e^{-2t}sin(x)sin(nx)dx}{\int_0^\pi sin^2(nx)dx}= f_n(t)$$
Using the Sturm Liouville theorem again, the numerator is zero for all but $n=1$. 
$$\frac{e^{-2t}\int_0^\pi sin^2(x)dx}{\int_0^\pi sin^2(x)dx}=e^{-2t}= f_1(t)$$
