  We study the asymptotic error arising when approximating the Green's function
of a Sturm-Liouville problem through a truncation of its eigenfunction
expansion, both for the Green's function of a regular Sturm-Liouville problem
and for the Green's function associated with the Hermite polynomials, the
associated Laguerre polynomials, and the Jacobi polynomials, respectively. We
prove that the asymptotic error obtained on the diagonal can be expressed in
terms of the coefficients of the related second-order Sturm-Liouville
differential equation, and that the suitable scaling exponent which yields a
non-degenerate limit on the diagonal depends on the asymptotic behaviour of the
corresponding eigenvalues. We further consider the asymptotic error away from
the diagonal and analyse which scaling exponents ensure that it remains at
zero. For the Hermite polynomials, the associated Laguerre polynomials, and the
Jacobi polynomials, a Christoffel-Darboux type formula, which we establish for
all classical orthogonal polynomial systems, allows us to obtain a better
control away from the diagonal than what a sole application of known asymptotic
formulae gives. As a consequence of our study for regular Sturm-Liouville
problems, we identify the fluctuations for the Karhunen-Lo\`eve expansion of
Brownian motion.
