Quadrature Integration

To carry out the definite integral of a given function $f(x)$:

$\displaystyle I[f]=\int_a^b f(x)\,dx=F(b)-F(a)$ (20)

we need to know the antiderivative (primitive or indefinite integral) $F(x)$ of the integrand $f(x)$, satisfying $dF(x)/dx=f(x)$. However, $I[f]$ may be difficult or even impossible to obtain, when $F(x)$ is not an elementary function (e.g., the error function $erf(x)=\int_0^x \exp(-u^2) du$), or the closed-form expression of $f(x)$ is unknown, its value is known only at a set of discrete points. In such cases, $I[f]$ can be approximated numerically by integrating the interpolation polynomial of the integrand $f(x)$, such as the Lagrange polynomial interpolation:

$\displaystyle f(x)\approx L_n(x)=\sum_{i=0}^n y_i l_i(x)
=\sum_{i=0}^n y_i\;\left(\prod_{j=0,\;j\ne i}^n \frac{x-x_j}{x_i-x_j}\right)$ (21)

based on a set of $n+1$ sammple points of the integrand $y_i=f(x_i),\;(i=0,1,\cdots,n)$ with $x_0=a$ and $x_n=b$. As discussed in the previoius chapter, the error of this approximation is

$\displaystyle R_n(x)=f(x)-L_n(x)=\frac{f^{(n+1)}(\xi(x))}{(n+1)!}\prod_{i=0}^n(x-x_i)
=f[x_0,\cdots,x_n, x]\,l_n(x)$ (22)

Now the integral can be written as:

$\displaystyle I[f]=\int_a^b f(x)dx\approx\int_a^b L_n(x)dx+\int_a^b R_n(x)\,dx
=I_n[f]+E_n[f]$ (23)

Here $I_n[f]$ is an nth order quadrature rule or formula:

$\displaystyle I_n[f]=\int_a^b L_n(x)\,dx=\sum_{i=0}^n y_i \int_a^bl_i(x)dx
=\su...
...t(\prod_{j=0,\;j\ne i}^n \frac{x-x_j}{x_i-x_j}\right) dx
=\sum_{i=0}^n c_i\;y_i$ (24)

with coefficients

$\displaystyle c_i=\int_a^b l_i(x)dx
=\int_a^b \left(\prod_{j=0,\;j\ne i}^n \frac{x-x_j}{x_i-x_j}\right) dx,
\;\;\;\;\;\;(i=0,\cdots,n)$ (25)

These coefficients are independent of the specific integrand $f(x)$, and can therefore be pre-calculated given the abscissas $x_0,\cdots,x_n$ of the sammple points. When in particular $f(x)=1$ and $y_0=\cdots=y_n=1$, we get an important property of these coefficients:

$\displaystyle I_n[f]=\sum_{i=0}^n c_i=I[f]=\int_a^b dx=b-a$ (26)

Also, $E_n[f]$ above is the integration error of the quadrature rule:
$\displaystyle E_n[f]$ $\displaystyle =$ $\displaystyle I[f]-I_n[f]=\int_a^b(f(x)-L_n(x))\;dx=\int_a^b R_n(x)dx$  
  $\displaystyle =$ $\displaystyle \int_a^b \frac{f^{(n+1)}(\xi(x))}{(n+1)!}\,l_n(x)\;dx
=\int_a^b f[x_0,\cdots,x_n,x]\,l_n(x)\,dx$  

In particular, if $f(x)=x^{n+1}$, we have $f^{(n+1)}(\xi)=(n+1)!$, and

$\displaystyle R_n(x)=f[x_0,\cdots,x_n,x]=\frac{f^{(n+1)}(\xi)}{(n+1)!}\,l_n(x)
=l_n(x)$ (27)

and we also have
$\displaystyle E_n[x^{n+1}]$ $\displaystyle =$ $\displaystyle \int_a^b [f(x)-L_n(x)]\,dx
=\int_a^b x^{n+1}\,dx-\sum_{i=0}^n c_i x^{i+1}$  
  $\displaystyle =$ $\displaystyle \frac{b^{n+2}-a^{n+2}}{n+2}-\sum_{i=0}^n c_i x_i^{n+1}
=\int_a^b l_n(x)\,dx$  

How accurate a quadrature rule approximate the true integral can be measured by its degree of accuracy. If the quadrature rule is exact for integrand $f(x)=x^k$ if $k\le m$, but not exact if $k=m+1$, then its degree of accuracy is $m$. We immediately see that the degree of accuracy of $I_n[f]$ based on $L_n(x)$ is at least $n$ ( $f^{(n+1)}(x)=0$, $R_n(x)=0$, therefore $E_n[f]=0$).