Proof (eigenfunction expansion of Green's function)

(Although $\dfd{G}{x}$ is discontinuous, if we interpret the delta function $\delta(x)$ as the limit of smooth functions $\delta_n(x)$ and define $G_n(x)$ as the solution to $L[G_n(x;\xi)] = \delta_n(x-\xi)$, then $G_n\in C^2[a,b]$ and by the completeness of $\set{Y_k}$, we can write $G_n$ as an expansion of eigenfunctions. So it makes sense to pretend $G$ to be in $C^2[a,b]$.)

By completeness, $$ \begin{align*} G(x;\xi) = \sum_{k=1}^{\infty} \hat G_k(\xi) Y_k(\xi), \end{align*} $$ where $$ \begin{align*} \hat G_k(\xi) ={}& \langle G(\,\cdot\,;\xi), Y_k\rangle_w \\ ={}& \frac{1}{\lambda_k} \langle G(\,\cdot\,;\xi), LY_k\rangle_w \\ ={}& \frac{1}{\lambda_k} \langle LG(\,\cdot\,;\xi), Y_k\rangle_w \\ ={}& \frac{1}{\lambda_k} \langle \delta(\cdot-\xi), Y_K\rangle_w \\ ={}& \frac{1}{\lambda_k} \int_{a}^{b} \delta(x-\xi) Y_k(x) w(x) \d x \\ ={}& \frac{1}{\lambda_k} Y_k(\xi) w(\xi). \end{align*} $$