To carry out the definite integral of a given function
:
![$\displaystyle I[f]=\int_a^b f(x)\,dx=F(b)-F(a)$](img73.svg) |
(20) |
we need to know the antiderivative (primitive or indefinite integral)
of the integrand
, satisfying
. However,
may be difficult or even impossible to obtain, when
is
not an elementary function (e.g., the error function
), or the closed-form expression of
is unknown, its value is known only at a set of discrete
points. In such cases,
can be approximated numerically by
integrating the interpolation polynomial of the integrand
,
such as the
Lagrange polynomial interpolation:
 |
(21) |
based on a set of
sammple points of the integrand
with
and
. 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)$](img82.svg) |
(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]$](img83.svg) |
(23) |
Here
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$](img85.svg) |
(24) |
with coefficients
 |
(25) |
These coefficients are independent of the specific integrand
, and can therefore be pre-calculated given the abscissas
of the sammple points. When in particular
and
, 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$](img90.svg) |
(26) |
Also,
above is the integration error of the quadrature
rule:
In particular, if
, we have
,
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)$](img97.svg) |
(27) |
and we also have
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
if
,
but not exact if
, then its degree of accuracy is
.
We immediately see that the degree of accuracy of
based on
is at least
(
,
,
therefore
).