My Question:
What is the general formula/method for turning an ODE into an eigenvalue problem?
My book turns this equation from an example
$$\frac{d^2u}{dx^2}+ u=e^x, u(0)=u(\pi)=0$$
into
$$\frac{d^2\phi}{dx^2}+ \phi=-\lambda \phi, \phi(0)=\phi(\pi)=0$$
If $u$ is replaced by $\phi$ everywhere it appears, why does $e^x$ turn into $\phi$ as well?
The Problem:
Without determining $u(x)$, how many solutions are there of
$$\frac{d^2u}{dx^2}+ u=\sin(x), \frac{du}{dx}(0)=\frac{du}{dx}(\pi)=0~?$$
Work So Far:
The eigenvalue problem for our given equation is:
$$\frac{d^2\phi}{dx^2}+\phi=-\lambda \phi, \frac{d\phi}{dx}(0)=\frac{d\phi}{dx}(\pi)=0$$
The goal is to express the solution as the linear combination some basis functions
$$ u(x) = \sum_n c_n \phi_n(x) $$
where $c_n$ are unknown constants and $\phi_n$ are linearly independent. Plugging this form into the original ODE gives
$$ u''(x) + u(x) = \sum_n c_n\big[\phi_n''(x) + \phi_n(x)\big] $$
It would be really convenient if this result was also a linear combination of the same basis functions, i,e,
$$ \sum_n c_n\big[\phi_n''(x) + \phi_n(x)\big] = -\sum_n c_n\lambda_n\phi_n(x) $$
where $\lambda_n$ is known. Then the equation becomes
$$ -\sum_n c_n\lambda_n\phi_n(x) = e^x $$
If you decompose the RHS function into its own basis functions, then $c_n$ can easily be found.
As for the boundary conditions, note that
$$ u(0) = \sum_n c_n \phi_n(0) = 0 $$
Since $\phi_n(x)$ are linearly independent, it follows that $\phi_n(0) = 0$. The same goes for $\phi_n(\pi)=0$