Inhomogenous eigenvalue problem
Consider an inhomogenous problem $$ \begin{align*} Ly = f, \qquad a<x<b \end{align*} $$ where $L$ is a Sturm-Liouville operator and $y,f\in V$ defined here. Since we can absorb the weight function into $f$, take $w=1$ WLOG.
Let $\set{Y_k}$ be the normalised eigenfunctions of $L$, with $LY_k = \lambda_k Y_k$ and $\|Y_k\| = 1$. Assume all $\lambda_k\neq 0$. Then by completeness, let $$ \begin{align*} f = \sum_k \hat f_k Y_k, \qquad y = \sum_k \hat y_k Y_k \end{align*} $$ and then $$ \begin{align*} Ly = f \implies \sum_k (\lambda_k \hat y_k - \hat f_k) Y_k = 0 \implies \hat y_k = \frac{\hat f_k}{\lambda_k} \end{align*} $$ so $$ \begin{align*} y(x) = \sum_{k} \frac{\langle f,Y_k\rangle}{\lambda_k} Y_k(x) = \int_{a}^{b} \left(\sum_{k} \frac{Y_k(x) Y_k(y)}{\lambda_k}\right) f(y) \d y := \int_{a}^{b} G(x,y) f(y) \d y \end{align*} $$ where $G(x,y)$ is called Green's function.