We derive an asymptotic error formula for Gauss--Legendre quadrature applied to functions with limited regularity, using the contour-integral representation of the remainder term. To address the absence of uniformly valid approximations of Legendre functions near $[-1,1]$, we approximate the integrand by smoother functions with singularities displaced from the interval and then obtain asymptotic expansions of the Legendre functions that hold uniformly along the contour. The resulting error formula identifies not only the optimal convergence rate but also the leading coefficient, expressed in terms of $\cos((2n+1)\phi)$, where $n$ is the number of quadrature points and $\cos(\phi)$ locates the singularity. This characterization enables both the selection of quadrature sizes that minimize the leading error and the use of the error formula as a correction term to accelerate convergence. Applications to functions with power and logarithmic singularities are presented, and numerical experiments confirm the accuracy of the analysis.
翻译:暂无翻译