# Sample Programs

Sample programs for Minimal BASIC will appear here.

## Numerical Integration
### Introduction

There exists two cases, when the computation of the value of a definite integral by numerical methods is needed. One of them is the calculation of the area below the curve defined by a set of experimental data, and another is the calculation of the definite integral of a mathematical function, for which no known integral is known. The former is often the case of response functions in the experimental labors of science and engineering, while the latter is normally the case in the practical investigations of physics, mathematics, and engineering.
Independently of it, the development of numerical methods for integration purposes, a field that belongs to the department of applied mathematics, is based on the simple idea from which it stems, i.e., if $y(x)=f(x)$ is a real-valued (the complex-valued case can be treated analogously, by separating it into its real and imaginary parts) continuous function of $x$ defined in an interval $(a,b)$, its definite integral,
$\int _{a}^{b}f(x)dx=\sum _{x=a}^{x=b}\lim _{\delta x\rightarrow 0}f(x)\delta x=\lim _{\delta x\rightarrow 0}\sum _{x=a}^{x=b}f(x)\delta x\approx \sum _{x=a}^{x=b}f(x)\Delta x$,
can be calculated approximately as the finite sum of the product $f(x)\Delta x$ evaluated at some given points in the interval $(a,b)$.
In the case of experimental data, the set of points at which the value of the function is measured is usually not regularly distributed (i.e., the points are not equispaced), so the value of the definite integral must be calculated in the form:
$\int _{a}^{b}f(x)dx=\int _{{x_{0}}=a}^{x_{1}}f(x)dx+\int _{x_{1}}^{x_{2}}f(x)dx+...+\int _{x_{n-2}}^{x_{n-1}}f(x)dx+\int _{x_{n-1}}^{x_{n}=b}f(x)dx$,
which can be approximated either as:
$\int _{a}^{b}f(x)dx\approx f({x_{0}}=a)({x_{1}}-{x_{0}})+f({x_{1}})({x_{2}}-{x_{1}})+...+f({x_{n-2}})({x_{n-1}}-{x_{n-2}})+f({x_{n-1}})({x_{n}}-{x_{n-1}})$,
or as:
$\int _{a}^{b}f(x)dx\approx f({x_{1}})({x_{1}}-{x_{0}})+f({x_{2}})({x_{2}}-{x_{1}})+...+f({x_{n-1}})({x_{n-1}}-{x_{n-2}})+f({x_{n}}=b)({x_{n}}-{x_{n-1}})$.
In the first case, the value of the integral is underestimated (overestimated) in the case of monotonically ascending (descending) functions, since the value of $f(x)$ taken in each evaluation is always the lowest (highest) in every subinterval, and hence constituting an absolute lower (upper) bound to the value of the integral, while in the second case, the value of the integral is overestimated (underestimated) in the case of monotonically descending (ascending) functions, since the value of $f(x)$ taken in each evaluation is always the highest (lowest) in every subinterval, and hence constituting an absolute upper (lower) bound to the value of the integral.
According to the Mean-Value Theorem of Calculus, the value of a definite integral can also be calculated as:
$\int _{a}^{b}f(x)dx=f(\gamma )(b-a)$,
for some value $\gamma$ in $(a,b)$ for which $f(\gamma )$ represents the mean value of $f(x)$ in $(a,b)$, so it is then a better approximation to calculate the definite integral of a set of experimental data as:
$\int _{a}^{b}f(x)dx=\int _{{x_{0}}=a}^{x_{1}}f(x)dx+\int _{x_{1}}^{x_{2}}f(x)dx+...+\int _{x_{n-2}}^{x_{n-1}}f(x)dx+\int _{x_{n-1}}^{x_{n}=b}f(x)dx$,
$\int _{a}^{b}f(x)dx=f(\gamma _{(0,1)})({x_{1}}-{x_{0}})+f(\gamma _{(1,2)})({x_{2}}-{x_{1}})+...+f(\gamma _{(n-2,n-1)})({x_{n-1}}-{x_{n-2}})+f(\gamma _{(n-1,n)})({x_{n}}-{x_{n-1}})$,
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{0}})+f({x_{1}})}{2}}({x_{1}}-{x_{0}})+{\frac {f({x_{1}})+f({x_{2}})}{2}}({x_{2}}-{x_{1}})+...+{\frac {f({x_{n-2}})+f({x_{n-1}})}{2}}({x_{n-1}}-{x_{n-2}})+{\frac {f({x_{n-1}})+f({x_{n}})}{2}}({x_{n}}-{x_{n-1}})$.
For reasons that we shall see later, this is equal to assume a piecewise linear interpolating function between the different points, and the value of the integral so calculated is exact for linear functions (i.e., functions for which its slope changes at constant rate), although it is underestimated for functions for which its slope grows at non-constant rate (i.e., its second derivative is strictly positive in the considered interval), and it is overestimated for functions for which its slope decreases at non-constant rate (i.e., its second derivative is strictly negative in the considered interval). The value so calculated constitutes a better approximation than the lower and upper bounds presented before, and in the case that the second derivative of the function (which can be calculated from the experimental data with the help of second or central differences) changes signs between subintervals, the value is expected to be close to the actual value due to the cancellation of the errors in the approximation of the mean values.
In the case of mathematical functions, there is more information about the function, since it is possible not only to calculate the value of the function at any given point, but also to compute first, second, and higher-order derivatives with any degree of accuracy.
Let us elaborate some mathematical results, going from simple to more elaborate methods:
The main theme in the development of numerical methods, together with the study of the stability (i.e., if a method converges), is the rate of convergence of the method, which studies how many evaluations are needed and the error in the approximation, for non-iterative methods, or how many iterations are needed and how the error is minimized in each iteration, for iterative methods.
In the case of the study of the stability, and as we have seen before, the value of the definite integral of a function $f(x)$ defined in an interval $(a,b)$,
$\int _{a}^{b}f(x)dx=\sum _{x=a}^{x=b}\lim _{\delta x\rightarrow 0}f(x)\delta x=\lim _{\delta x\rightarrow 0}\sum _{x=a}^{x=b}f(x)\delta x\approx \sum _{x=a}^{x=b}f({x_{k}})\Delta {x_{k}}$,
can be calculated approximately as the finite sum of the product $f(x)\Delta x$ evaluated at some given points in the interval $(a,b)$.
In the limit $\Delta x\rightarrow \delta x\rightarrow 0$, the finite sum tends to the infinite integral, and so convergence is assured.
In the case of the study of the rate of convergence, one is interested in increasing the accuracy of the approximation, while retaining the number of subintervals, with a minor increase in computational complexity.
The approach used consists normally in using a polynomial approximation for the evaluation of the function $f(x)$ in each subinterval, using the information provided by the value of the function at several points in the subinterval.
Let us consider the case of equally-spaced points (although this restriction can be easily lifted):
According to the definition,
$\int _{a}^{b}f(x)dx=\sum _{x=a}^{x=b}\lim _{\delta x\rightarrow 0}f(x)\delta x=\lim _{\delta x\rightarrow 0}\sum _{x=a}^{x=b}f(x)\delta x\approx \sum _{x=a}^{x=b}f({x_{k}})\Delta {x_{k}}=\sum _{x=a}^{x=b}f({x_{k}})({x_{j+1}}-{x_{j}})$,
with $k$ being indicative of the subinterval, ${x_{k}}$ being some arbitrary number in every subinterval $({x_{j}},{x_{j+1}})$, with $j=0,1,2,...,n-1$, and ${x_{0}}=a,{x_{n}}=b$, and $\Delta {x_{k}}=({x_{j+1}}-{x_{j}})$, with $k=1,2,...,n$, and $j=k-1$.
The Mean-Value Theorem of Calculus tells us, that if
$\int _{a}^{b}f(x)dx$
is the definite integral of $f(x)$ in $(a,b)$, there exists a value $\gamma$ in $(a,b)$, such that
$\int _{a}^{b}f(x)dx=f(\gamma )(b-a)$.
Additionally, by definition, if
$\int _{a}^{b}f(x)dx$
is the definite integral of $f(x)$ in $(a,b)$, this one can also be understood as being composed of the individual contributions
$\int _{a}^{b}f(x)dx=\int _{{x_{0}}=a}^{x_{1}}f(x)dx+\int _{x_{1}}^{x_{2}}f(x)dx+...+\int _{x_{n-2}}^{x_{n-1}}f(x)dx+\int _{x_{n-1}}^{x_{n}=b}f(x)dx$
for arbitrary values ${x_{0}}=a,{x_{1}},{x_{2}},...,{x_{n-2}},{x_{n-1}},{x_{n}}=b$.
Now, applying the Mean-Value Theorem to each individual contribution yields the result:
$\int _{a}^{b}f(x)dx=f(\gamma _{({x_{0}},{x_{1}})})({x_{1}}-{x_{0}})+f(\gamma _{({x_{1}},{x_{2}})})({x_{2}}-{x_{1}})+...+f(\gamma _{({x_{n-2}},{x_{n-1}})})({x_{n-1}}-{x_{n-2}})+f(\gamma _{({x_{n-1}},{x_{n}})})({x_{n}}-{x_{n-1}})$,
which is exact.
In the particular case that every subinterval is of equal size, i.e., $({x_{1}}-{x_{0}})=({x_{2}}-{x_{1}})=...=({x_{n-1}}-{x_{n-2}})=({x_{n}}-{x_{n-1}})=\Delta x$, then the expression reduces to
$\int _{a}^{b}f(x)dx=\left(f(\gamma _{({x_{0}},{x_{1}})})+f(\gamma _{({x_{1}},{x_{2}})})+...+f(\gamma _{({x_{n-2}},{x_{n-1}})})+f(\gamma _{({x_{n-1}},{x_{n}})})\right)\Delta x$.
In this way, the calculation of the initial definite integral reduces to the calculation of the mean values
$f(\gamma _{({x_{0}},{x_{1}})}),f(\gamma _{({x_{1}},{x_{2}})}),...,f(\gamma _{({x_{n-2}},{x_{n-1}})}),f(\gamma _{({x_{n-1}},{x_{n}})})$.
In a first approximation, with only one point,
$f(\gamma _{({x_{0}},{x_{1}})})\approx f({x_{i}}_{({x_{0}},{x_{1}})}),f(\gamma _{({x_{1}},{x_{2}})})\approx f({x_{i}}_{({x_{1}},{x_{2}})}),...,f(\gamma _{({x_{n-2}},{x_{n-1}})})\approx f({x_{i}}_{({x_{n-2}},{x_{n-1}})}),f(\gamma _{({x_{n-1}},{x_{n}})})\approx f({x_{i}}_{({x_{n-1}},{x_{n}})})$,
with ${x_{i}}$ being the value of $x$ in the middle of each subinterval, which leads to
$\int _{a}^{b}f(x)dx\approx \left(f({x_{i}}_{({x_{0}},{x_{1}})})+f({x_{i}}_{({x_{1}},{x_{2}})})+...+f({x_{i}}_{({x_{n-2}},{x_{n-1}})})+f({x_{i}}_{({x_{n-1}},{x_{n}})})\right)\Delta x$.
In a second approximation, with only two points,
$f(\gamma _{({x_{0}},{x_{1}})})\approx {\frac {f({x_{0}})+f({x_{1}})}{2}},f(\gamma _{({x_{1}},{x_{2}})})\approx {\frac {f({x_{1}})+f({x_{2}})}{2}},...,f(\gamma _{({x_{n-2}},{x_{n-1}})})\approx {\frac {f({x_{n-2}})+f({x_{n-1}})}{2}},f(\gamma _{({x_{n-1}},{x_{n}})})\approx {\frac {f({x_{n-1}})+f({x_{n}})}{2}}$,
with ${x_{n-1}},{x_{n}}$ being the value of $x$ at the beginning and at the end of each subinterval, which leads to
$\int _{a}^{b}f(x)dx\approx \left(f({x_{0}})+2f({x_{1}})+...+2f({x_{n-1}})+f({x_{n}})\right)\Delta x/2$.
In a third approximation, with only three points,
$f(\gamma _{({x_{0}},{x_{1}})})\approx {\frac {f({x_{0}})+f({x_{i}}_{({x_{0}},{x_{1}})})+f({x_{1}})}{3}},f(\gamma _{({x_{1}},{x_{2}})})\approx {\frac {f({x_{1}})+f({x_{i}}_{({x_{1}},{x_{2}})})+f({x_{2}})}{3}},...,f(\gamma _{({x_{n-2}},{x_{n-1}})})\approx {\frac {f({x_{n-2}})+f({x_{i}}_{({x_{n-2}},{x_{n-1}})})+f({x_{n-1}})}{3}},f(\gamma _{({x_{n-1}},{x_{n}})})\approx {\frac {f({x_{n-1}})+f({x_{i}}_{({x_{n-1}},{x_{n}})})+f({x_{n}})}{3}}$,
with ${x_{n-1}},{x_{i}},{x_{n}}$ being the value of $x$ at the beginning, in the middle, and at the end of each subinterval, which leads to
$\int _{a}^{b}f(x)dx\approx \left(f({x_{0}})+f({x_{i}}_{({x_{0}},{x_{1}})})+2f({x_{1}})+f({x_{i}}_{({x_{1}},{x_{2}})})+2f({x_{2}})+...+2f({x_{n-2}})+f({x_{i}}_{({x_{n-2}},{x_{n-1}})})+2f({x_{n-1}})+f({x_{i}}_{({x_{n-1}},{x_{n}})})+f({x_{n}})\right)\Delta x/3$.
In a fourth approximation, while still making use of the evaluation of the function $f(x)$ at the beginning, in the middle, and at the end of each subinterval, one can use the result that if $f(\gamma ^{-})$ and $f(\gamma ^{+})$ are estimates for $f(\gamma )$, then its arithmetic mean $\left(f(\gamma ^{-})+f(\gamma ^{+})\right)/2$ is also another estimate with at least the same accuracy, if not better.
So, adding the results for the first and second approximation, and dividing by two,
$f(\gamma _{({x_{n-1}},{x_{n}})})\approx {\frac {f({x_{i}}_{({x_{n-1}},{x_{n}})})+{\frac {f({x_{n-1}})+f({x_{n}})}{2}}}{2}}={\frac {f({x_{n-1}})+2f({x_{i}}_{({x_{n-1}},{x_{n}})})+f({x_{n}})}{4}}$,
which leads to the result
$\int _{a}^{b}f(x)dx\approx \left(f({x_{0}})+2f({x_{i}}_{({x_{0}},{x_{1}})})+2f({x_{1}})+2f({x_{i}}_{({x_{1}},{x_{2}})})+2f({x_{2}})+...+2f({x_{n-2}})+2f({x_{i}}_{({x_{n-2}},{x_{n-1}})})+2f({x_{n-1}})+2f({x_{i}}_{({x_{n-1}},{x_{n}})})+f({x_{n}})\right)\Delta x/4$.
Adding the results for the first and third approximation, and dividing by two,
$f(\gamma _{({x_{n-1}},{x_{n}})})\approx {\frac {f({x_{i}}_{({x_{n-1}},{x_{n}})})+{\frac {f({x_{n-1}})+f({x_{i}}_{({x_{n-1}},{x_{n}})})+f({x_{n}})}{3}}}{2}}={\frac {f({x_{n-1}})+4f({x_{i}}_{({x_{n-1}},{x_{n}})})+f({x_{n}})}{6}}$,
which leads to the result
$\int _{a}^{b}f(x)dx\approx \left(f({x_{0}})+4f({x_{i}}_{({x_{0}},{x_{1}})})+2f({x_{1}})+4f({x_{i}}_{({x_{1}},{x_{2}})})+2f({x_{2}})+...+2f({x_{n-2}})+4f({x_{i}}_{({x_{n-2}},{x_{n-1}})})+2f({x_{n-1}})+4f({x_{i}}_{({x_{n-1}},{x_{n}})})+f({x_{n}})\right)\Delta x/6$.
In practice, one can do no better with only three evaluations in an interval, but the results obtained are simple and accurate enough, even in the case of one single interval.
Let us illustrate the case by means of an example:
Let us suppose, that we wish to calculate the definite integral of the function $f(x)=exp(x)$ in the interval $(0,1)$, for which we know its exact value, $F(x)|_{0}^{1}=\int _{0}^{1}exp(x)dx=exp(x)|_{0}^{1}=exp(1)-exp(0)=2.71828-1.00000=1.71828$.
Let us also keep the problem simple and do the calculations with a single interval, i.e., ${x_{0}}=a=0.0$, ${x_{n}}=b=1.0$, and $x_{i}=0.5$.
So, we have:
First approximation:
$\int _{a}^{b}f(x)dx\approx f(x_{i})(b-a)=exp(0.5)(1.0-0.0)=1.64872$
This is equal to a relative error of
$error={\frac {1.64872-1.71828}{1.71828}}\times 100=-4.04823\%$.
Second approximation:
$\int _{a}^{b}f(x)dx\approx {\frac {f(x_{a})+f(x_{b})}{2}}(b-a)={\frac {exp(0.0)+exp(1.0)}{2}}(1.0-0.0)=1.85914$
This is equal to a relative error of
$error={\frac {1.85914-1.71828}{1.71828}}\times 100=+8.19774\%$.
Third approximation:
$\int _{a}^{b}f(x)dx\approx {\frac {f(x_{a})+f(x_{i})+f(x_{b})}{3}}(b-a)={\frac {exp(0.0)+exp(0.5)+exp(1.0)}{3}}(1.0-0.0)=1.78900$
This is equal to a relative error of
$error={\frac {1.85914-1.71828}{1.71828}}\times 100=+4.11575\%$.
Fourth approximation, first and second terms (linear expansion):
$\int _{a}^{b}f(x)dx\approx {\frac {f(x_{a})+2f(x_{i})+f(x_{b})}{4}}(b-a)={\frac {exp(0.0)+2\times exp(0.5)+exp(1.0)}{4}}(1.0-0.0)=1.75393$
This is equal to a relative error of
$error={\frac {1.75393-1.71828}{1.71828}}\times 100=+2.07475\%$.
Fourth approximation, first and third terms (quadratic expansion):
$\int _{a}^{b}f(x)dx\approx {\frac {f(x_{a})+4f(x_{i})+f(x_{b})}{6}}(b-a)={\frac {exp(0.0)+4\times exp(0.5)+exp(1.0)}{6}}(1.0-0.0)=1.71886$
This is equal to a relative error of
$error={\frac {1.71886-1.71828}{1.71828}}\times 100=+0.0337589\%$.
In case more accuracy is needed, one can analogously introduce higher-order terms in the expansion of $f(x)$ around $x_{i}$, or half the integration step in one of the methods considered before.
Let us consider the case, when higher-order terms are considered in the expansion, i.e.,
$f(\gamma _{({x_{n-1}},{x_{n}})})\approx {\frac {f({x_{i}}_{({x_{n-1}},{x_{n}})})+{\frac {f({x_{n-1}})+f({x_{i}}_{1/4})+f({x_{i}}_{({x_{n-1}},{x_{n}})})+f({x_{i}}_{3/4})+f({x_{n}})}{5}}}{2}}={\frac {f({x_{n-1}})+f({x_{i}}_{1/4})+6f({x_{i}}_{({x_{n-1}},{x_{n}})})+f({x_{i}}_{3/4})+f({x_{n}})}{10}}$,
which leads to the result
$\int _{a}^{b}f(x)dx\approx \left(f({x_{0}})+f({x_{1/4}}_{({x_{0}},{x_{1}})})+6f({x_{i}}_{({x_{1}},{x_{2}})})+f({x_{3/4}}_{({x_{0}},{x_{1}})})+2f({x_{1}})+...+2f({x_{n-1}})+f({x_{1/4}}_{({x_{n-1}},{x_{n}})})+6f({x_{i}}_{({x_{n-1}},{x_{n}})})+f({x_{1/4}}_{({x_{n-1}},{x_{n}})})+f({x_{n}})\right)\Delta x/10$.
Let us illustrate the case by means of an example:
Let us suppose, that we wish to calculate the definite integral of the function $f(x)=exp(x)$ in the interval $(0,1)$, for which we know its exact value, $F(x)|_{0}^{1}=\int _{0}^{1}exp(x)dx=exp(x)|_{0}^{1}=exp(1)-exp(0)=2.71828-1.00000=1.71828$.
Let us also keep the problem simple and do the calculations with two intervals, i.e., ${x_{0}}=a=0.0$, ${x_{n}}=b=1.0$, ${x_{1}}=0.5$, ${x_{i}}_{({x_{0}},{x_{1}})}=0.25$ and ${x_{i}}_{({x_{1}},{x_{2}})}=0.25$.
Applying second order expansion
$\int _{a}^{b}f(x)dx\approx \left(f({x_{0}})+4f({x_{i}}_{({x_{0}},{x_{1}})})+2f({x_{1}})+4f({x_{i}}_{({x_{1}},{x_{2}})})+f({x_{2}})\right)\Delta x/6$,
which yields
$\int _{a}^{b}f(x)dx\approx \left(exp(0.0)+4exp(0.25)+2exp(0.5)+4exp(0.75)+exp(1.0)\right)\times 0.5/6=1.71832$,
which is equal to a relative error of
$error={\frac {1.71832-1.71828}{1.71828}}\times 100=+0.00216456\%$.
Applying fourth order expansion
$\int _{a}^{b}f(x)dx\approx \left(f(0.0)+f(0.25)+6f(0.50)+f(0.75)+f(1.0)\right)1.0/10$,
which yields
$\int _{a}^{b}f(x)dx\approx \left(exp(0.0)+7exp(0.25)+2exp(0.5)+7exp(0.75)+exp(1.0)\right)\times 1.0/10$.
We know from the Calculus of Differences, that any function can be expressed as the polynomial expansion
$f(x)=f({x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{0}})^{2}+...$
in the case of forward differences, or
$f(x)=f({x_{1}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{1}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{1}})^{2}+...$
in the case of backward differences, or
$f(x)=f({x_{i}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{i}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{i}})^{2}+...$
in the case of central differences.
In a first approximation,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{0}})+h({x_{0}})(x-{x_{0}})\right)dx\approx \int _{a}^{b}f({x_{0}})dx=f({x_{0}})(b-a)=f({x_{0}})({x_{1}}-{x_{0}})=f({x_{0}})\Delta x$
$\int _{a}^{b}h({x_{0}})(x-{x_{0}})dx=h({x_{0}}){\frac {(x-{x_{0}})^{2}}{2}}|_{a}^{b}=h({x_{0}}){\frac {(b-{x_{0}})^{2}-(a-{x_{0}})^{2}}{2}}=h({x_{0}}){\frac {({x_{1}}-{x_{0}})^{2}-({x_{0}}-{x_{0}})^{2}}{2}}=h({x_{0}}){\frac {({x_{1}}-{x_{0}})^{2}}{2}}=h({x_{0}}){\frac {\Delta x^{2}}{2}}\simeq f'({x_{0}}){\frac {\Delta x^{2}}{2}}$
in the case of forward differences,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{1}})+h({x_{1}})(x-{x_{1}})\right)dx\approx \int _{a}^{b}f({x_{1}})dx=f({x_{1}})(b-a)=f({x_{1}})({x_{1}}-{x_{0}})=f({x_{1}})\Delta x$
$\int _{a}^{b}h({x_{1}})(x-{x_{1}})dx=h({x_{1}}){\frac {(x-{x_{1}})^{2}}{2}}|_{a}^{b}=h({x_{1}}){\frac {(b-{x_{1}})^{2}-(a-{x_{1}})^{2}}{2}}=h({x_{1}}){\frac {({x_{1}}-{x_{1}})^{2}-({x_{0}}-{x_{1}})^{2}}{2}}=h({x_{1}}){\frac {-({x_{0}}-{x_{1}})^{2}}{2}}=-h({x_{1}}){\frac {\Delta x^{2}}{2}}\simeq -f'({x_{1}}){\frac {\Delta x^{2}}{2}}$
in the case of backward differences,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{i}})+h({x_{i}})(x-{x_{i}})\right)dx\approx \int _{a}^{b}f({x_{i}})dx=f({x_{i}})(b-a)=f({x_{i}})({x_{1}}-{x_{0}})=f({x_{i}})\Delta x$
$\int _{a}^{b}h({x_{i}})(x-{x_{i}})dx=h({x_{i}}){\frac {(x-{x_{i}})^{2}}{2}}|_{a}^{b}=h({x_{i}}){\frac {(b-{x_{i}})^{2}-(a-{x_{i}})^{2}}{2}}=h({x_{i}}){\frac {({x_{1}}-{x_{i}})^{2}-({x_{0}}-{x_{i}})^{2}}{2}}=h({x_{i}}){\frac {(\Delta x/2)^{2}-(-\Delta x/2)^{2}}{2}}=h({x_{i}}){\frac {\Delta x^{2}-\Delta x^{2}}{4}}=0$
in the case of central differences.
So, in the case of evaluating the integral with one single point, the value of it is always underestimated (overestimated) with forward (backward) differences if the value of the slope of the function at the evaluation point is positive, and underestimated (overestimated) with forward (backward) differences if the value of the slope of the function at the evaluation point is negative, being the error in the estimation directly proportional to the slope of the function at the evaluation point, and to one half of the square of the integration step. In the case of evaluating the integral with central differences, the value is exact for linear functions.
In a second approximation,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{0}})+h({x_{0}})(x-{x_{0}})^{2}\right)dx$
$\int _{a}^{b}f(x)dx\approx \int _{a}^{b}\left(f({x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{0}})\right)dx=f({x_{0}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}{\frac {({x_{1}}-{x_{0}})^{2}-({x_{0}}-{x_{0}})^{2}}{2}}$
$\int _{a}^{b}f(x)dx\approx f({x_{0}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}{\frac {({x_{1}}-{x_{0}})^{2}}{2}}=f({x_{0}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{2}}({x_{1}}-{x_{0}})={\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})={\frac {f({x_{1}})+f({x_{0}})}{2}}\Delta x$
$\int _{a}^{b}h({x_{0}})(x-{x_{0}})^{2}dx=h({x_{0}}){\frac {(x-{x_{0}})^{3}}{3}}|_{a}^{b}=h({x_{0}}){\frac {({x_{1}}-{x_{0}})^{3}-({x_{0}}-{x_{0}})^{3}}{3}}=h({x_{0}}){\frac {({x_{1}}-{x_{0}})^{3}}{3}}=h({x_{0}}){\frac {\Delta x^{3}}{3}}\simeq f''({x_{0}}){\frac {\Delta x^{3}}{3}}$
in the case of forward differences,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{1}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{1}})+h({x_{1}})(x-{x_{1}})^{2}\right)dx$
$\int _{a}^{b}f(x)dx\approx \int _{a}^{b}\left(f({x_{1}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{1}})\right)dx=f({x_{1}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}{\frac {({x_{1}}-{x_{1}})^{2}-({x_{0}}-{x_{1}})^{2}}{2}}$
$\int _{a}^{b}f(x)dx\approx f({x_{1}})({x_{1}}-{x_{0}})-{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}{\frac {({x_{1}}-{x_{0}})^{2}}{2}}=f({x_{1}})({x_{1}}-{x_{0}})-{\frac {f({x_{1}})-f({x_{0}})}{2}}({x_{1}}-{x_{0}})={\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})={\frac {f({x_{1}})+f({x_{0}})}{2}}\Delta x$
$\int _{a}^{b}h({x_{1}})(x-{x_{1}})^{2}dx=h({x_{1}}){\frac {(x-{x_{1}})^{3}}{3}}|_{a}^{b}=h({x_{1}}){\frac {({x_{1}}-{x_{1}})^{3}-({x_{0}}-{x_{1}})^{3}}{3}}=h({x_{1}}){\frac {({x_{1}}-{x_{0}})^{3}}{3}}=h({x_{1}}){\frac {\Delta x^{3}}{3}}\simeq f''({x_{1}}){\frac {\Delta x^{3}}{3}}$
in the case of backward differences,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{i}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{i}})+h({x_{i}})(x-{x_{i}})^{2}\right)dx$
$\int _{a}^{b}f(x)dx\approx \int _{a}^{b}\left(f({x_{i}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{i}})\right)dx=f({x_{i}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}{\frac {({x_{1}}-{x_{i}})^{2}-({x_{0}}-{x_{i}})^{2}}{2}}$
$\int _{a}^{b}f(x)dx\approx f({x_{i}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}{\frac {({x_{1}}-{x_{i}})^{2}-({x_{i}}-{x_{0}})^{2}}{2}}=f({x_{i}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}{\frac {({x_{1}}-{x_{0}})^{2}-({x_{1}}-{x_{0}})^{2}}{8}}=f({x_{i}})({x_{1}}-{x_{0}})=f({x_{i}})\Delta x$
$\int _{a}^{b}h({x_{i}})(x-{x_{i}})^{2}dx=h({x_{i}}){\frac {(x-{x_{i}})^{3}}{3}}|_{a}^{b}=h({x_{i}}){\frac {({x_{1}}-{x_{i}})^{3}-({x_{0}}-{x_{i}})^{3}}{3}}=h({x_{i}}){\frac {({x_{1}}-{x_{i}})^{3}+({x_{i}}-{x_{0}})^{3}}{3}}=h({x_{i}}){\frac {({x_{1}}-{x_{0}})^{3}}{12}}=h({x_{i}}){\frac {\Delta x^{3}}{12}}\simeq f''({x_{i}}){\frac {\Delta x^{3}}{12}}$
in the case of central differences.
So, in the case of evaluating the integral with a linear function, there is no difference between forward and backward differences, and the value of the integral is equal to the product of the mean of the values of the function at the beginning and at the end of the interval times the integration step, being the value so calculated underestimated (overestimated) for monotonically increasing (decreasing) functions with a positive (negative) second derivative, the error in the approximation being directly proportional to the second derivative of the function and to the cube of the integration step (i.e., as one increases the number of subintervals, one reduces the deviation proportional to the cube of the number of subintervals). In the case of central differences, the value of the integral is equal to the product of the value of the function in the middle of the interval times the integration step, as in the previous case, the error in the approximation being reduced by a factor of four with relation to the case of forward and backward differences.
In a third approximation,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{0}})^{2}+h({x_{0}})(x-{x_{0}})^{3}\right)dx$
$\int _{a}^{b}f(x)dx\approx \int _{a}^{b}\left(f({x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{0}})^{2}\right)dx$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{0}})^{3}-({x_{0}}-{x_{0}})^{3}}{3}}$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{0}})^{3}}{3}}$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{3}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {3f({x_{1}})+3f({x_{0}})+2f({x_{1}})-4f({x_{i}})+2f({x_{0}})}{6}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {5f({x_{0}})-4f({x_{i}})+5f({x_{1}})}{6}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}h({x_{0}})(x-{x_{0}})^{3}dx=h({x_{0}}){\frac {(x-{x_{0}})^{4}}{4}}|_{a}^{b}=h({x_{0}}){\frac {({x_{1}}-{x_{0}})^{4}-({x_{0}}-{x_{0}})^{4}}{4}}=h({x_{0}}){\frac {({x_{1}}-{x_{0}})^{4}}{4}}=h({x_{0}}){\frac {\Delta x^{4}}{4}}\simeq f'''({x_{0}}){\frac {\Delta x^{4}}{4}}$
in the case of forward differences,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{1}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{1}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{1}})^{2}+h({x_{1}})(x-{x_{1}})^{3}\right)dx$
$\int _{a}^{b}f(x)dx\approx \int _{a}^{b}\left(f({x_{1}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{1}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{1}})^{2}\right)dx$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{1}})^{3}-({x_{0}}-{x_{1}})^{3}}{3}}$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})-{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{0}})^{3}}{3}}$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})-{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{3}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {3f({x_{1}})+3f({x_{0}})-2f({x_{1}})+4f({x_{i}})-2f({x_{0}})}{6}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{0}})+4f({x_{i}})+f({x_{1}})}{6}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}h({x_{1}})(x-{x_{1}})^{3}dx=h({x_{1}}){\frac {(x-{x_{1}})^{4}}{4}}|_{a}^{b}=h({x_{1}}){\frac {({x_{1}}-{x_{1}})^{4}-({x_{0}}-{x_{1}})^{4}}{4}}=-h({x_{1}}){\frac {({x_{1}}-{x_{0}})^{4}}{4}}=-h({x_{1}}){\frac {\Delta x^{4}}{4}}\simeq -f'''({x_{1}}){\frac {\Delta x^{4}}{4}}$
in the case of backward differences,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{i}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{i}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{i}})^{2}+h({x_{i}})(x-{x_{i}})^{3}\right)dx$
$\int _{a}^{b}f(x)dx\approx \int _{a}^{b}\left(f({x_{i}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{i}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{i}})^{2}\right)dx$
$\int _{a}^{b}f(x)dx\approx f({x_{i}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{i}})^{3}-({x_{0}}-{x_{i}})^{3}}{3}}$
$\int _{a}^{b}f(x)dx\approx f({x_{i}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{0}})^{3}}{12}}$
$\int _{a}^{b}f(x)dx\approx f({x_{i}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{12}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {12f({x_{i}})+f({x_{1}})-2f({x_{i}})+f({x_{0}})}{12}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+10f({x_{i}})+f({x_{0}})}{12}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}h({x_{i}})(x-{x_{i}})^{3}dx=h({x_{i}}){\frac {(x-{x_{i}})^{4}}{4}}|_{a}^{b}=h({x_{i}}){\frac {({x_{1}}-{x_{i}})^{4}-({x_{0}}-{x_{i}})^{4}}{4}}=h({x_{i}}){\frac {({x_{1}}-{x_{0}})^{4}-({x_{1}}-{x_{0}})^{4}}{64}}=0$
in the case of central differences.
In a fourth approximation,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{0}})^{2}+{\frac {{\frac {f({x_{1}})-f({x_{i}})}{{x_{1}}-{x_{i}}}}-{\frac {f({x_{i}})-f({x_{0}})}{{x_{i}}-{x_{0}}}}}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{0}})^{3}+h({x_{0}})(x-{x_{0}})^{3}\right)dx$
$\int _{a}^{b}f(x)dx\approx \int _{a}^{b}\left(f({x_{0}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{0}})^{2}\right)dx$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{0}})^{3}-({x_{0}}-{x_{0}})^{3}}{3}}$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{0}})^{3}}{3}}$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{3}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {3f({x_{1}})+3f({x_{0}})+2f({x_{1}})-4f({x_{i}})+2f({x_{0}})}{6}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {5f({x_{0}})-4f({x_{i}})+5f({x_{1}})}{6}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}h({x_{0}})(x-{x_{0}})^{3}dx=h({x_{0}}){\frac {(x-{x_{0}})^{4}}{4}}|_{a}^{b}=h({x_{0}}){\frac {({x_{1}}-{x_{0}})^{4}-({x_{0}}-{x_{0}})^{4}}{4}}=h({x_{0}}){\frac {({x_{1}}-{x_{0}})^{4}}{4}}=h({x_{0}}){\frac {\Delta x^{4}}{4}}\simeq f'''({x_{0}}){\frac {\Delta x^{4}}{4}}$
in the case of forward differences,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{1}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{1}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{1}})^{2}+h({x_{1}})(x-{x_{1}})^{3}\right)dx$
$\int _{a}^{b}f(x)dx\approx \int _{a}^{b}\left(f({x_{1}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{1}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{1}})^{2}\right)dx$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{1}})^{3}-({x_{0}}-{x_{1}})^{3}}{3}}$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})-{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{0}})^{3}}{3}}$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+f({x_{0}})}{2}}({x_{1}}-{x_{0}})-{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{3}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {3f({x_{1}})+3f({x_{0}})-2f({x_{1}})+4f({x_{i}})-2f({x_{0}})}{6}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{0}})+4f({x_{i}})+f({x_{1}})}{6}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}h({x_{1}})(x-{x_{1}})^{3}dx=h({x_{1}}){\frac {(x-{x_{1}})^{4}}{4}}|_{a}^{b}=h({x_{1}}){\frac {({x_{1}}-{x_{1}})^{4}-({x_{0}}-{x_{1}})^{4}}{4}}=-h({x_{1}}){\frac {({x_{1}}-{x_{0}})^{4}}{4}}=-h({x_{1}}){\frac {\Delta x^{4}}{4}}\simeq -f'''({x_{1}}){\frac {\Delta x^{4}}{4}}$
in the case of backward differences,
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left(f({x_{i}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{i}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{i}})^{2}+h({x_{i}})(x-{x_{i}})^{3}\right)dx$
$\int _{a}^{b}f(x)dx\approx \int _{a}^{b}\left(f({x_{i}})+{\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}({x}-{x_{i}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}({x}-{x_{i}})^{2}\right)dx$
$\int _{a}^{b}f(x)dx\approx f({x_{i}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{i}})^{3}-({x_{0}}-{x_{i}})^{3}}{3}}$
$\int _{a}^{b}f(x)dx\approx f({x_{i}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{({x_{1}}-{x_{0}})^{2}}}{\frac {({x_{1}}-{x_{0}})^{3}}{12}}$
$\int _{a}^{b}f(x)dx\approx f({x_{i}})({x_{1}}-{x_{0}})+{\frac {f({x_{1}})-2f({x_{i}})+f({x_{0}})}{12}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {12f({x_{i}})+f({x_{1}})-2f({x_{i}})+f({x_{0}})}{12}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}f(x)dx\approx {\frac {f({x_{1}})+10f({x_{i}})+f({x_{0}})}{12}}({x_{1}}-{x_{0}})$
$\int _{a}^{b}h({x_{i}})(x-{x_{i}})^{3}dx=h({x_{i}}){\frac {(x-{x_{i}})^{4}}{4}}|_{a}^{b}=h({x_{i}}){\frac {({x_{1}}-{x_{i}})^{4}-({x_{0}}-{x_{i}})^{4}}{4}}=h({x_{i}}){\frac {({x_{1}}-{x_{0}})^{4}-({x_{1}}-{x_{0}})^{4}}{64}}=0$
in the case of central differences.
The divided differences are:
${\frac {df(x)}{dx}}\approx {\frac {f({x_{1}})-f({x_{0}})}{{x_{1}}-{x_{0}}}}$
${\frac {d^{2}f(x)}{dx^{2}}}\approx {\frac {{\frac {f({x_{1}})-f({x_{i}})}{{x_{1}}-{x_{i}}}}-{\frac {f({x_{i}})-f({x_{0}})}{{x_{i}}-{x_{0}}}}}{{x_{1}}-{x_{0}}}}={\frac {2(f({x_{1}})-2f({x_{i}})+f({x_{0}}))}{({x_{1}}-{x_{0}})^{2}}}$
${\frac {d^{3}f(x)}{dx^{3}}}\approx {\frac {{\frac {{\frac {f({x_{1}})-f(({x_{1}}+{x_{i}})/2)}{\frac {{x_{1}}-{x_{0}}}{4}}}-{\frac {f(({x_{1}}+{x_{i}})/2)-f({x_{i}})}{\frac {{x_{1}}-{x_{0}}}{4}}}}{\frac {{x_{1}}-{x_{0}}}{2}}}-{\frac {{\frac {f({x_{i}})-f(({x_{i}}+{x_{0}})/2)}{\frac {{x_{1}}-{x_{0}}}{4}}}-{\frac {f(({x_{i}}+{x_{0}})/2)-f({x_{0}})}{\frac {{x_{1}}-{x_{0}}}{4}}}}{\frac {{x_{1}}-{x_{0}}}{2}}}}{{x_{1}}-{x_{0}}}}={\frac {8(f({x_{1}})-2f(({x_{1}}+{x_{i}})/2)+2f(({x_{i}}+{x_{0}})/2)-f({x_{0}}))}{({x_{1}}-{x_{0}})^{3}}}$
${\frac {d^{4}f(x)}{dx^{4}}}\approx {\frac {{\frac {{\frac {{\frac {f({x_{1}})-f(({x_{1}}+{x_{i}})/4)}{\frac {{x_{1}}-{x_{0}}}{8}}}-{\frac {f({x_{1}})-f(({x_{1}}+{x_{i}})/4)}{\frac {{x_{1}}-{x_{0}}}{8}}}}{\frac {{x_{1}}-{x_{0}}}{4}}}-{\frac {f(({x_{1}}+{x_{i}})/2)-f({x_{i}})}{\frac {{x_{1}}-{x_{0}}}{4}}}}{\frac {{x_{1}}-{x_{0}}}{2}}}-{\frac {{\frac {f({x_{i}})-f(({x_{i}}+{x_{0}})/2)}{\frac {{x_{1}}-{x_{0}}}{4}}}-{\frac {f(({x_{i}}+{x_{0}})/2)-f({x_{0}})}{\frac {{x_{1}}-{x_{0}}}{4}}}}{\frac {{x_{1}}-{x_{0}}}{2}}}}{{x_{1}}-{x_{0}}}}={\frac {8(f({x_{1}})-2f(({x_{1}}+{x_{i}})/2)+2f(({x_{i}}+{x_{0}})/2)-f({x_{0}}))}{({x_{1}}-{x_{0}})^{3}}}$
Lagrange interpolation
One point:
$L_{1}(x_{0},x_{1})=f({\frac {x_{0}+x_{1}}{2}})=f(x_{i})$
Two points:
$L_{2}(x_{0},x_{1})={\frac {f(x_{0})}{(x_{0}-x_{1})}}(x-x_{1})+{\frac {f(x_{1})}{(x_{1}-x_{0})}}(x-x_{0})$
Three points:
$L_{3}(x_{0},x_{1})={\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}(x-x_{i})(x-x_{1})+{\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}(x-x_{0})(x-x_{1})+{\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{i})}}(x-x_{0})(x-x_{i})$
Four points:
$L_{4}(x_{0},x_{1})={\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}(x-x_{i})(x-x_{1})+{\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}(x-x_{0})(x-x_{1})+{\frac {f(x_{1})}{(x_{1}-x_{i})(x_{1}-x_{0})}}(x-x_{i})(x-x_{0})$
Five points:
$L_{5}(x_{0},x_{1})={\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}(x-x_{i})(x-x_{1})+{\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}(x-x_{0})(x-x_{1})+{\frac {f(x_{1})}{(x_{1}-x_{i})(x_{1}-x_{0})}}(x-x_{i})(x-x_{0})$
Six points:
$L_{6}(x_{0},x_{1})={\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}(x-x_{i})(x-x_{1})+{\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}(x-x_{0})(x-x_{1})+{\frac {f(x_{1})}{(x_{1}-x_{i})(x_{1}-x_{0})}}(x-x_{i})(x-x_{0})$
Seven points:
$L_{7}(x_{0},x_{1})={\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}(x-x_{i})(x-x_{1})+{\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}(x-x_{0})(x-x_{1})+{\frac {f(x_{1})}{(x_{1}-x_{i})(x_{1}-x_{0})}}(x-x_{i})(x-x_{0})$
One point:
$\int _{a}^{b}f(x)dx=\int _{a}^{b}(L_{1}(x)+h_{1}(x))dx=\int _{a}^{b}(f(x_{i})+1h_{1}(x-x_{i}))dx$
$\int _{a}^{b}f(x)dx=f(x_{i})(x_{1}-x_{0})+h_{1}{\frac {(x_{1}-x_{i})^{2}-(x_{0}-x_{i})^{2}}{2}}$
$\int _{a}^{b}f(x)dx=f(x_{i})(x_{1}-x_{0})$
$\int _{a}^{b}f(x)dx=f(x_{i})\Delta x$
Two points:
$\int _{a}^{b}f(x)dx=\int _{a}^{b}(L_{2}(x)+h_{2}(x))dx=\int _{a}^{b}\left({\frac {f(x_{0})}{(x_{0}-x_{1})}}(x-x_{1})+{\frac {f(x_{1})}{(x_{1}-x_{0})}}(x-x_{0})+2h_{2}(x-x_{i})^{2}\right)dx$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})}{(x_{0}-x_{1})}}{\frac {(x_{1}-x_{1})^{2}-(x_{0}-x_{1})^{2}}{2}}+{\frac {f(x_{1})}{(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{2}-(x_{0}-x_{0})^{2}}{2}}+2h_{2}{\frac {(x_{1}-x_{i})^{3}-(x_{0}-x_{i})^{3}}{3}}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})}{(x_{0}-x_{1})}}{\frac {-(x_{0}-x_{1})^{2}}{2}}+{\frac {f(x_{1})}{(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{2}}{2}}+2h_{2}{\frac {(x_{1}-x_{0})^{3}-(x_{0}-x_{1})^{3}}{24}}$
$\int _{a}^{b}f(x)dx={\frac {-f(x_{0})}{2}}(x_{0}-x_{1})+{\frac {f(x_{1})}{2}}(x_{1}-x_{0})+2h_{2}{\frac {(x_{1}-x_{0})^{3}+(x_{1}-x_{0})^{3}}{24}}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})}{2}}(x_{1}-x_{0})+{\frac {f(x_{1})}{2}}(x_{1}-x_{0})+4h_{2}{\frac {(x_{1}-x_{0})^{3}}{24}}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})+f(x_{1})}{2}}(x_{1}-x_{0})+h_{2}{\frac {(x_{1}-x_{0})^{3}}{6}}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})+f(x_{1})}{2}}\Delta x+h_{2}{\frac {\Delta x^{3}}{6}}$
$\int _{a}^{b}f(x)dx=(f(x_{0})+f(x_{1})){\frac {\Delta x}{2}}+h_{2}{\frac {\Delta x^{3}}{6}}$
Three points:
$\int _{a}^{b}f(x)dx=\int _{a}^{b}(L_{3}(x)+h_{3}(x))dx=\int _{a}^{b}(L_{3,1}(x)+L_{3,2}(x)+L_{3,3}(x)+h_{3}(x))dx$
${\begin{aligned}\int _{a}^{b}f(x)dx&=\int _{a}^{b}\left({\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}(x-x_{i})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}(x-x_{0})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{i})}}(x-x_{0})(x-x_{i})\right)dx\\&+\int _{a}^{b}h_{3}(x)(x-x_{i})^{3}dx\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&=\int _{a}^{b}\left({\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}(x^{2}-xx_{i}-xx_{1}+x_{i}x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}(x^{2}-xx_{0}-xx_{1}+x_{0}x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{i})}}(x^{2}-xx_{0}-xx_{i}+x_{0}x_{i})\right)dx\\&+\int _{a}^{b}h_{3}(x)(x-x_{i})^{3}dx\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&=\int _{a}^{b}\left({\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}(x^{2}-(x_{i}+x_{1})x+x_{i}x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}(x^{2}-(x_{0}+x_{1})x+x_{0}x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{i})}}(x^{2}-(x_{0}+x_{i})x+x_{0}x_{i})\right)dx\\&+\int _{a}^{b}h_{3}(x)(x-x_{i})^{3}dx\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-(x_{i}+x_{1}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+x_{i}x_{1}(x_{1}-x_{0}))\\&+{\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-(x_{0}+x_{1}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+x_{0}x_{1}(x_{1}-x_{0}))\\&+{\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{i})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-(x_{0}+x_{i}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+x_{0}x_{i}(x_{1}-x_{0}))\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-({\frac {x_{0}+x_{1}}{2}}+x_{1}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+{\frac {x_{0}+x_{1}}{2}}x_{1}(x_{1}-x_{0}))\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-(x_{0}+x_{1}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+x_{0}x_{1}(x_{1}-x_{0}))\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-(x_{0}+{\frac {x_{0}+x_{1}}{2}}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+x_{0}{\frac {x_{0}+x_{1}}{2}}(x_{1}-x_{0}))\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}+3x_{1}}{2}}{\frac {x_{1}^{2}-x_{0}^{2}}{2}}+{\frac {x_{1}^{2}-x_{0}^{2}}{2}}x_{1})\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}x_{1}^{2}-x_{0}^{3}+x_{1}^{3}-x_{1}x_{0}^{2}}{2}}+x_{0}x_{1}^{2}-x_{1}x_{0}^{2})\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {3x_{0}+x_{1}}{2}}{\frac {x_{1}^{2}-x_{0}^{2}}{2}}+{\frac {x_{1}^{2}-x_{0}^{2}}{2}}x_{0})\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-({\frac {x_{0}+3x_{1}}{2}}-x_{1}){\frac {x_{1}^{2}-x_{0}^{2}}{2}})\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}x_{1}^{2}-x_{0}^{3}+x_{1}^{3}-x_{1}x_{0}^{2}-2x_{0}x_{1}^{2}+2x_{1}x_{0}^{2}}{2}})\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-({\frac {3x_{0}+x_{1}}{2}}-x_{0}){\frac {x_{1}^{2}-x_{0}^{2}}{2}})\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}+x_{1}}{2}}{\frac {x_{1}^{2}-x_{0}^{2}}{2}})\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}{\frac {2x_{1}^{3}-2x_{0}^{3}-3x_{0}x_{1}^{2}+3x_{0}^{3}-3x_{1}^{3}+3x_{1}x_{0}^{2}+6x_{0}x_{1}^{2}-6x_{1}x_{0}^{2}}{6}}\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}+x_{1}}{2}}{\frac {x_{1}^{2}-x_{0}^{2}}{2}})\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}x_{1}^{2}-x_{0}^{3}+x_{1}^{3}-x_{1}x_{0}^{2}}{4}})\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}{\frac {-x_{1}^{3}+x_{0}^{3}+3x_{0}x_{1}^{2}-3x_{1}x_{0}^{2}}{6}}\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}x_{1}^{2}+x_{1}^{3}-x_{0}^{3}-x_{1}x_{0}^{2}}{4}})\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}{\frac {4x_{1}^{3}-4x_{0}^{3}-3x_{0}x_{1}^{2}+3x_{0}^{3}-3x_{1}^{3}+3x_{1}x_{0}^{2}}{12}}\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}{\frac {-x_{1}^{3}+3x_{0}x_{1}^{2}-3x_{1}x_{0}^{2}+x_{0}^{3}}{6}}\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {4x_{1}^{3}-4x_{0}^{3}-3x_{0}x_{1}^{2}-3x_{1}^{3}+3x_{0}^{3}+3x_{1}x_{0}^{2}}{12}})\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}{\frac {x_{1}^{3}-x_{0}^{3}-3x_{0}x_{1}^{2}+3x_{1}x_{0}^{2}}{12}}\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {x_{1}^{3}-3x_{0}x_{1}^{2}+3x_{1}x_{0}^{2}-x_{0}^{3}}{6}}\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}-3x_{0}x_{1}^{2}+3x_{1}x_{0}^{2}}{12}})\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}{\frac {x_{1}^{3}-3x_{0}x_{1}^{2}+3x_{1}x_{0}^{2}-x_{0}^{3}}{12}}\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{3}}{6}}\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {x_{1}^{3}-3x_{0}x_{1}^{2}+3x_{1}x_{0}^{2}-x_{0}^{3}}{12}}\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}{\frac {(x_{1}-x_{0})^{3}}{12}}\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{3}}{6}}\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{3}}{12}}\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{3}}{12}}\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{3}}{6}}\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{3}}{12}}\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {2f(x_{0})}{(x_{1}-x_{0})^{2}}}{\frac {(x_{1}-x_{0})^{3}}{12}}\\&+{\frac {4f(x_{i})}{(x_{1}-x_{0})^{2}}}{\frac {(x_{1}-x_{0})^{3}}{6}}\\&+{\frac {2f(x_{1})}{(x_{1}-x_{0})^{2}}}{\frac {(x_{1}-x_{0})^{3}}{12}}\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&={\frac {f(x_{0})}{6}}(x_{1}-x_{0})\\&+{\frac {4f(x_{i})}{6}}(x_{1}-x_{0})\\&+{\frac {f(x_{1})}{6}}(x_{1}-x_{0})\\&+h_{3}{\frac {(x_{1}-x_{i})^{4}-(x_{0}-x_{i})^{4}}{4}}\end{aligned}}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})}{6}}(x_{1}-x_{0})+{\frac {4f(x_{i})}{6}}(x_{1}-x_{0})+{\frac {f(x_{1})}{6}}(x_{1}-x_{0})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})+4f(x_{i})+f(x_{1})}{6}}(x_{1}-x_{0})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})+4f(x_{i})+f(x_{1})}{6}}\Delta x+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx=(f(x_{0})+4f(x_{i})+f(x_{1})){\frac {\Delta x}{6}}+3h_{3}(x-x_{i})^{3}$
Four points:
$\int _{a}^{b}f(x)dx=\int _{a}^{b}(L_{4}(x)+h_{4}(x))dx=\int _{a}^{b}(L_{4,1}(x)+L_{4,2}(x)+L_{4,3}(x)+L_{4,4}(x)+h_{4}(x))dx$
${\begin{aligned}\int _{a}^{b}f(x)dx&=\int _{a}^{b}\left({\frac {f(x_{0})}{(x_{0}-{x_{i}}_{1/3})(x_{0}-{x_{i}}_{2/3})(x_{0}-x_{1})}}(x-{x_{i}}_{1/3})(x-{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f({x_{i}}_{1/3})}{({x_{i}}_{1/3}-x_{0})({x_{i}}_{1/3}-{x_{i}}_{2/3})({x_{i}}_{1/3}-x_{1})}}(x-x_{0})(x-{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f({x_{i}}_{2/3})}{({x_{i}}_{2/3}-x_{0})({x_{i}}_{2/3}-{x_{i}}_{1/3})({x_{i}}_{2/3}-x_{1})}}(x-x_{0})(x-{x_{i}}_{1/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-{x_{i}}_{1/3})(x_{1}-{x_{i}}_{2/3})}}(x-x_{0})(x-{x_{i}}_{1/3})(x-{x_{i}}_{2/3})\right)dx\\&+\int _{a}^{b}4h_{4}(x-x_{i})^{4}dx\\\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&=\int _{a}^{b}\left({\frac {f(x_{0})}{{\frac {1}{3}}(x_{0}-x_{1}){\frac {2}{3}}(x_{0}-x_{1}){\frac {1}{1}}(x_{0}-x_{1})}}(x-{x_{i}}_{1/3})(x-{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f({x_{i}}_{1/3})}{{\frac {1}{3}}(x_{1}-x_{0}){\frac {1}{3}}(x_{0}-x_{1}){\frac {2}{3}}(x_{0}-x_{1})}}(x-x_{0})(x-{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f({x_{i}}_{2/3})}{{\frac {2}{3}}(x_{1}-x_{0}){\frac {1}{3}}(x_{1}-x_{0}){\frac {1}{3}}(x_{0}-x_{1})}}(x-x_{0})(x-{x_{i}}_{1/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{1})}{{\frac {1}{1}}(x_{1}-x_{0}){\frac {2}{3}}(x_{1}-x_{0}){\frac {1}{3}}(x_{1}-x_{0})}}(x-x_{0})(x-{x_{i}}_{1/3})(x-{x_{i}}_{2/3})\right)dx\\&+\int _{a}^{b}4h_{4}(x-x_{i})^{4}dx\\\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&=\int _{a}^{b}\left({\frac {9}{2}}{\frac {f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})(x_{0}-x_{1})}}(x-{x_{i}}_{1/3})(x-{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {27}{2}}{\frac {f({x_{i}}_{1/3})}{(x_{1}-x_{0})(x_{0}-x_{1})(x_{0}-x_{1})}}(x-x_{0})(x-{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {27}{2}}{\frac {f({x_{i}}_{2/3})}{(x_{1}-x_{0})(x_{1}-x_{0})(x_{0}-x_{1})}}(x-x_{0})(x-{x_{i}}_{1/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {9}{2}}{\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})(x_{1}-x_{0})}}(x-x_{0})(x-{x_{i}}_{1/3})(x-{x_{i}}_{2/3})\right)dx\\&+\int _{a}^{b}4h_{4}(x-x_{i})^{4}dx\\\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&=\int _{a}^{b}\left(-{\frac {9}{2}}{\frac {f(x_{0})}{(x_{1}-x_{0})^{3}}}(x-{x_{i}}_{1/3})(x-{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {27}{2}}{\frac {f({x_{i}}_{1/3})}{(x_{1}-x_{0})^{3}}}(x-x_{0})(x-{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left(-{\frac {27}{2}}{\frac {f({x_{i}}_{2/3})}{(x_{1}-x_{0})^{3}}}(x-x_{0})(x-{x_{i}}_{1/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {9}{2}}{\frac {f(x_{1})}{(x_{1}-x_{0})^{3}}}(x-x_{0})(x-{x_{i}}_{1/3})(x-{x_{i}}_{2/3})\right)dx\\&+\int _{a}^{b}4h_{4}(x-x_{i})^{4}dx\\\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx=&-{\frac {9}{2}}{\frac {f(x_{0})}{(x_{1}-x_{0})^{3}}}\int _{a}^{b}\left((x-{x_{i}}_{1/3})(x-{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+{\frac {27}{2}}{\frac {f({x_{i}}_{1/3})}{(x_{1}-x_{0})^{3}}}\int _{a}^{b}\left((x-x_{0})(x-{x_{i}}_{2/3})(x-x_{1})\right)dx\\&-{\frac {27}{2}}{\frac {f({x_{i}}_{2/3})}{(x_{1}-x_{0})^{3}}}\int _{a}^{b}\left((x-x_{0})(x-{x_{i}}_{1/3})(x-x_{1})\right)dx\\&+{\frac {9}{2}}{\frac {f(x_{1})}{(x_{1}-x_{0})^{3}}}\int _{a}^{b}\left((x-x_{0})(x-{x_{i}}_{1/3})(x-{x_{i}}_{2/3})\right)dx\\&+\int _{a}^{b}4h_{4}(x-x_{i})^{4}dx\\\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&=\int _{a}^{b}\left({\frac {f(x_{0})}{(x_{0}-{x_{i}}_{1/3})(x_{0}-{x_{i}}_{2/3})(x_{0}-x_{1})}}(x^{2}-({x_{i}}_{1/3}+{x_{i}}_{2/3})x+{x_{i}}_{1/3}{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f({x_{i}}_{1/3})}{({x_{i}}_{1/3}-x_{0})({x_{i}}_{1/3}-{x_{i}}_{2/3})({x_{i}}_{1/3}-x_{1})}}(x^{2}-(x_{0}+x_{1})x+x_{0}x_{1})(x-{x_{i}}_{2/3})\right)dx\\&+\int _{a}^{b}\left({\frac {f({x_{i}}_{2/3})}{({x_{i}}_{2/3}-x_{0})({x_{i}}_{2/3}-{x_{i}}_{1/3})({x_{i}}_{2/3}-x_{1})}}(x^{2}-(x_{0}+x_{1})x+x_{0}x_{1})(x-{x_{i}}_{1/3})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-{x_{i}}_{1/3})(x_{1}-{x_{i}}_{2/3})}}(x^{2}-({x_{i}}_{1/3}+{x_{i}}_{2/3})x+{x_{i}}_{1/3}{x_{i}}_{2/3})(x-x_{0})\right)dx\\&+\int _{a}^{b}4h_{4}(x-x_{i})^{4}dx\\\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&=\int _{a}^{b}\left({\frac {f(x_{0})}{(x_{0}-{x_{i}}_{1/3})(x_{0}-{x_{i}}_{2/3})(x_{0}-x_{1})}}(x^{2}-({x_{i}}_{1/3}+{x_{i}}_{2/3})x+{x_{i}}_{1/3}{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f({x_{i}}_{1/3})}{({x_{i}}_{1/3}-x_{0})({x_{i}}_{1/3}-{x_{i}}_{2/3})({x_{i}}_{1/3}-x_{1})}}(x^{2}-(x_{0}+x_{1})x+x_{0}x_{1})(x-{x_{i}}_{2/3})\right)dx\\&+\int _{a}^{b}\left({\frac {f({x_{i}}_{2/3})}{({x_{i}}_{2/3}-x_{0})({x_{i}}_{2/3}-{x_{i}}_{1/3})({x_{i}}_{2/3}-x_{1})}}(x^{2}-(x_{0}+x_{1})x+x_{0}x_{1})(x-{x_{i}}_{1/3})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-{x_{i}}_{1/3})(x_{1}-{x_{i}}_{2/3})}}(x^{2}-({x_{i}}_{1/3}+{x_{i}}_{2/3})x+{x_{i}}_{1/3}{x_{i}}_{2/3})(x-x_{0})\right)dx\\&+\int _{a}^{b}4h_{4}(x-x_{i})^{4}dx\\\end{aligned}}$
${\begin{aligned}\int _{a}^{b}f(x)dx&=\int _{a}^{b}\left({\frac {f(x_{0})}{(x_{0}-{x_{i}}_{1/3})(x_{0}-{x_{i}}_{2/3})(x_{0}-x_{1})}}(x^{2}-({x_{i}}_{1/3}+{x_{i}}_{2/3})x+{x_{i}}_{1/3}{x_{i}}_{2/3})(x-x_{1})\right)dx\\&+\int _{a}^{b}\left({\frac {f({x_{i}}_{1/3})}{({x_{i}}_{1/3}-x_{0})({x_{i}}_{1/3}-{x_{i}}_{2/3})({x_{i}}_{1/3}-x_{1})}}(x^{2}-(x_{0}+x_{1})x+x_{0}x_{1})(x-{x_{i}}_{2/3})\right)dx\\&+\int _{a}^{b}\left({\frac {f({x_{i}}_{2/3})}{({x_{i}}_{2/3}-x_{0})({x_{i}}_{2/3}-{x_{i}}_{1/3})({x_{i}}_{2/3}-x_{1})}}(x^{2}-(x_{0}+x_{1})x+x_{0}x_{1})(x-{x_{i}}_{1/3})\right)dx\\&+\int _{a}^{b}\left({\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-{x_{i}}_{1/3})(x_{1}-{x_{i}}_{2/3})}}(x^{2}-({x_{i}}_{1/3}+{x_{i}}_{2/3})x+{x_{i}}_{1/3}{x_{i}}_{2/3})(x-x_{0})\right)dx\\&+\int _{a}^{b}4h_{4}(x-x_{i})^{4}dx\\\end{aligned}}$
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left({\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}(x^{2}-xx_{i}-xx_{1}+x_{i}x_{1})+{\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}(x^{2}-xx_{0}-xx_{1}+x_{0}x_{1})+{\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{i})}}(x^{2}-xx_{0}-xx_{i}+x_{0}x_{i})+3h_{3}(x-x_{i})^{3}\right)dx$
$\int _{a}^{b}f(x)dx=\int _{a}^{b}\left({\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}(x^{2}-(x_{i}+x_{1})x+x_{i}x_{1})+{\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}(x^{2}-(x_{0}+x_{1})x+x_{0}x_{1})+{\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{i})}}(x^{2}-(x_{0}+x_{i})x+x_{0}x_{i})+3h_{3}(x-x_{i})^{3}\right)dx$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})}{(x_{0}-x_{i})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-(x_{i}+x_{1}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+x_{i}x_{1}(x_{1}-x_{0}))+{\frac {f(x_{i})}{(x_{i}-x_{0})(x_{i}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-(x_{0}+x_{1}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+x_{0}x_{1}(x_{1}-x_{0}))+{\frac {f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{i})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-(x_{0}+x_{i}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+x_{0}x_{i}(x_{1}-x_{0}))+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-({\frac {x_{0}+x_{1}}{2}}+x_{1}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+{\frac {x_{0}+x_{1}}{2}}x_{1}(x_{1}-x_{0}))+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-(x_{0}+x_{1}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+x_{0}x_{1}(x_{1}-x_{0}))+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-(x_{0}+{\frac {x_{0}+x_{1}}{2}}){\frac {x_{1}^{2}-x_{0}^{2}}{2}}+x_{0}{\frac {x_{0}+x_{1}}{2}}(x_{1}-x_{0}))+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}+3x_{1}}{2}}{\frac {x_{1}^{2}-x_{0}^{2}}{2}}+{\frac {x_{1}^{2}-x_{0}^{2}}{2}}x_{1})+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}x_{1}^{2}-x_{0}^{3}+x_{1}^{3}-x_{1}x_{0}^{2}}{2}}+x_{0}x_{1}^{2}-x_{1}x_{0}^{2})+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {3x_{0}+x_{1}}{2}}{\frac {x_{1}^{2}-x_{0}^{2}}{2}}+{\frac {x_{1}^{2}-x_{0}^{2}}{2}}x_{0})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-({\frac {x_{0}+3x_{1}}{2}}-x_{1}){\frac {x_{1}^{2}-x_{0}^{2}}{2}})+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}x_{1}^{2}-x_{0}^{3}+x_{1}^{3}-x_{1}x_{0}^{2}-2x_{0}x_{1}^{2}+2x_{1}x_{0}^{2}}{2}})+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-({\frac {3x_{0}+x_{1}}{2}}-x_{0}){\frac {x_{1}^{2}-x_{0}^{2}}{2}})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}+x_{1}}{2}}{\frac {x_{1}^{2}-x_{0}^{2}}{2}})+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}{\frac {2x_{1}^{3}-2x_{0}^{3}-3x_{0}x_{1}^{2}+3x_{0}^{3}-3x_{1}^{3}+3x_{1}x_{0}^{2}+6x_{0}x_{1}^{2}-6x_{1}x_{0}^{2}}{6}}+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}+x_{1}}{2}}{\frac {x_{1}^{2}-x_{0}^{2}}{2}})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}x_{1}^{2}-x_{0}^{3}+x_{1}^{3}-x_{1}x_{0}^{2}}{4}})+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}{\frac {-x_{1}^{3}+x_{0}^{3}+3x_{0}x_{1}^{2}-3x_{1}x_{0}^{2}}{6}}+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}}{3}}-{\frac {x_{0}x_{1}^{2}+x_{1}^{3}-x_{0}^{3}-x_{1}x_{0}^{2}}{4}})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}{\frac {4x_{1}^{3}-4x_{0}^{3}-3x_{0}x_{1}^{2}+3x_{0}^{3}-3x_{1}^{3}+3x_{1}x_{0}^{2}}{12}}+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{0}-x_{1})}}{\frac {-x_{1}^{3}+3x_{0}x_{1}^{2}-3x_{1}x_{0}^{2}+x_{0}^{3}}{6}}+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {4x_{1}^{3}-4x_{0}^{3}-3x_{0}x_{1}^{2}-3x_{1}^{3}+3x_{0}^{3}+3x_{1}x_{0}^{2}}{12}})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}{\frac {x_{1}^{3}-x_{0}^{3}-3x_{0}x_{1}^{2}+3x_{1}x_{0}^{2}}{12}}+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {x_{1}^{3}-3x_{0}x_{1}^{2}+3x_{1}x_{0}^{2}-x_{0}^{3}}{6}}+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-x_{0}^{3}-3x_{0}x_{1}^{2}+3x_{1}x_{0}^{2}}{12}})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}{\frac {x_{1}^{3}-3x_{0}x_{1}^{2}+3x_{1}x_{0}^{2}-x_{0}^{3}}{12}}+{\frac {4f(x_{i})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{3}}{6}}+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}({\frac {x_{1}^{3}-3x_{0}x_{1}^{2}+3x_{1}x_{0}^{2}-x_{0}^{3}}{12}})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {2f(x_{0})}{(x_{0}-x_{1})(x_{0}-x_{1})}}{\frac {(x_{1}-x_{0})^{3}}{12}}+{\frac {4f(x_{i})}{6}}(x_{1}-x_{0})+{\frac {2f(x_{1})}{(x_{1}-x_{0})(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{3}}{12}}+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})}{6}}(x_{1}-x_{0})+{\frac {4f(x_{i})}{6}}(x_{1}-x_{0})+{\frac {f(x_{1})}{6}}(x_{1}-x_{0})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})+4f(x_{i})+f(x_{1})}{6}}(x_{1}-x_{0})+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})+4f(x_{i})+f(x_{1})}{6}}\Delta x+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx=(f(x_{0})+4f(x_{i})+f(x_{1})){\frac {\Delta x}{6}}+3h_{3}(x-x_{i})^{3}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})}{(x_{0}-x_{1})}}{\frac {-(x_{0}-x_{1})^{2}}{2}}+{\frac {f(x_{1})}{(x_{1}-x_{0})}}{\frac {(x_{1}-x_{0})^{2}}{2}}+2h_{2}{\frac {(x_{1}-x_{0})^{3}-(x_{0}-x_{1})^{3}}{24}}$
$\int _{a}^{b}f(x)dx={\frac {-f(x_{0})}{2}}(x_{0}-x_{1})+{\frac {f(x_{1})}{2}}(x_{1}-x_{0})+2h_{2}{\frac {(x_{1}-x_{0})^{3}+(x_{1}-x_{0})^{3}}{24}}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})}{2}}(x_{1}-x_{0})+{\frac {f(x_{1})}{2}}(x_{1}-x_{0})+4h_{2}{\frac {(x_{1}-x_{0})^{3}}{24}}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})+f(x_{1})}{2}}(x_{1}-x_{0})+h_{2}{\frac {(x_{1}-x_{0})^{3}}{6}}$
$\int _{a}^{b}f(x)dx={\frac {f(x_{0})+f(x_{1})}{2}}\Delta x+h_{2}{\frac {\Delta x^{3}}{6}}$
$\int _{a}^{b}f(x)dx=f(x_{i})(x_{1}-x_{0})$
$\int _{a}^{b}f(x)dx=f(x_{i})\Delta x$
$\int _{a}^{b}f(x)dx\approx \int _{a}^{b}f(x_{i})dx$
S-Sum $S_{1}(x_{0},x_{1})=x_{i}1/2/1$
$S_{2}(x_{0},x_{1})=x_{i}1/3+x_{i}2/3/2$
$S_{1}(x_{0},x_{1})=x_{i}1/4+x_{i}2/4+x_{i}3/4/3$
Let us consider the integrals
$\int (x-c_{1})dx={\frac {x^{2}}{2}}-c_{1}x+c_{0}={\frac {1x^{2}-2c_{1}x+2c_{0}}{1\times 2}}$
$\int (x-c_{1})(x-c_{2})dx=\int (x^{2}-(c_{1}+c_{2})x+c_{1}c_{2})dx={\frac {x^{3}}{3}}-(c_{1}+c_{2}){\frac {x^{2}}{2}}+c_{1}c_{2}x+c_{0}={\frac {2x^{3}-3(c_{1}+c_{2})x+6c_{1}c_{2}x+6c_{0}}{1\times 2\times 3}}$
$\int (x-c_{1})(x-c_{2})(x-c_{3})dx=\int (x^{3}-(c_{1}+c_{2}+c_{3})x^{2}+(c_{1}c_{2}+c_{1}c_{3}+c_{2}c_{3})x+c_{1}c_{2}c_{3})dx={\frac {x^{4}}{4}}-(c_{1}+c_{2}+c_{3}){\frac {x^{3}}{3}}+(c_{1}c_{2}+c_{1}c_{3}+c_{2}c_{3}){\frac {x^{2}}{2}}+c_{1}c_{2}c_{3}x+c_{0}={\frac {2x^{3}-3(c_{1}+c_{2})x+6c_{1}c_{2}x+6c_{0}}{1\times 2\times 3}}$
An analytical method of calculation of the relative weights of the evaluations of the function $f(x)$ at the points ${x_{0}},{x_{i}}_{({x_{0}},{x_{1}})},{x_{1}},...$, consists in evaluating the integral of the function $f(x)$ as the integral of a polynomial approximation.
If one chooses the value of ${x_{k}}$ as ${x_{k}}={x_{j}}$, i.e., at the beginning of every subinterval, then the sum of products is equal to:
$\int _{a}^{b}f(x)dx\approx f({x_{0}}=a)({x_{1}}-{x_{0}})+f({x_{1}})({x_{2}}-{x_{1}})+...+f({x_{n-2}})({x_{n-1}}-{x_{n-2}})+f({x_{n-1}})({x_{n}}-{x_{n-1}})$,
If one chooses the value of ${x_{k}}$ as ${x_{k}}={x_{i}}$, i.e., at the beginning of every subinterval, then the sum of products is equal to:
$\int _{a}^{b}f(x)dx\approx f({x_{0}}=a)({x_{1}}-{x_{0}})+f({x_{1}})({x_{2}}-{x_{1}})+...+f({x_{n-2}})({x_{n-1}}-{x_{n-2}})+f({x_{n-1}})({x_{n}}-{x_{n-1}})$,
Let us consider the case of equally-spaced points (although this restriction can be easily lifted), according to the definition,
In the case of a semi-continuous function, i.e., a function which is continuous except for a finite numerable set of points in an interval $(a,d)$, the calculation of the definite integral can be defined as the sum of the definite integrals between the points of discontinuity, i.e.,
$\int _{a}^{d}f(x)dx=\int _{a}^{b^{-}}f(x)dx+\int _{b^{+}}^{c^{-}}f(x)dx+\int _{c^{+}}^{d}f(x)dx\approx \sum _{x=a}^{x={b^{-}}}f(x)\Delta x+\sum _{x={b^{+}}}^{x={c^{-}}}f(x)\Delta x+\sum _{x={c^{+}}}^{x=d}f(x)\Delta x$.