Gaussian Quadrature, weight function

The weight function \( W \) is non-negative in the integration interval \( x\in [a,b] \) such that for any \( n \ge 0 \), the integral \( \int_a^b |x|^n W(x) dx \) is integrable. The naming weight function arises from the fact that it may be used to give more emphasis to one part of the interval than another. A quadrature formula $$ \begin{equation} \int_a^b W(x)f(x)dx \approx \sum_{i=1}^N\omega_if(x_i), \tag{8} \end{equation} $$ with \( N \) distinct quadrature points (mesh points) is a called a Gaussian quadrature formula if it integrates all polynomials \( p\in P_{2N-1} \) exactly, that is $$ \begin{equation} \int_a^bW(x)p(x)dx =\sum_{i=1}^N\omega_ip(x_i), \tag{9} \end{equation} $$ It is assumed that \( W(x) \) is continuous and positive and that the integral $$ \begin{equation*} \int_a^bW(x)dx \end{equation*} $$ exists. Note that the replacement of \( f\rightarrow Wg \) is normally a better approximation due to the fact that we may isolate possible singularities of \( W \) and its derivatives at the endpoints of the interval.