The first derivative , the differential quotient, describes the change of a give function $y=f\left(x\right)$ in its dependence from the variable $x$. We can now ask the converse question:

Integral Is there a function $F\left(x\right)$ whose change is described by $f\left(x\right)$ and what properties does this function have? If such a function exists , it is called the anti-derivative of $f\left(x\right)$ or its indefinite integral. It is described by a very simple differential equation:

$$\begin{array}{c}{F}^{\prime}\left(x\right)=f\left(x\right),\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}f\text{given,}F\text{wanted}\hfill \\ F\left(x\right)=\text{Integral}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{of}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}f\left(x\right)=\int f\left(x\right)dx\hfill \\ \to \frac{d}{dx}\int f\left(x\right)dx=f\left(x\right)\hfill \\ \hfill \end{array}$$

The integral sign serves as a reminder, that the calculation proceeds via a summation and the notation $f\left(x\right)dx$ reminds us, that a limiting process takes place for the calculation for which the variable interval becomes infinitesimally small, that means $\Delta x\to dx$; we will visualize this soon.

This differential equations defines obviously a whole cohort of functions, that can differ by a constant value, because the derivative (change) of a constant vanishes. Thus the indefinite integral of a given function is known up to a constant.

$$\frac{d}{dx}\left(F\left(x\right)+C\right)=\frac{d}{dx}F\left(x\right)=f\left(x\right)$$

If the differential equation has a meaningful solution, i.e. if the function is integrable, the indefinite integral is in analogy to the differential quotient a function, that describes, up to a constant a local property of the integrated function $f\left(x\right)$.

What is the meaning of the integration constant? As long as we do not decide on the range of the variable $x$ it is simply an arbitrary number.

If we however start at a certain initial value ${x}_{1}$ and take into account, that $f\left(x\right)$ is the change ${F}^{\prime}\left(x\right)$ of the anti-derivative, then the anti-derivative describes the process of the changes in $F\left(x\right)$ given by $f\left(x\right)$ from the variable value ${x}_{1}$ onwards.

We now show this in a simple example from physics: we assume that $f\left(t\right)$ is the time dependent velocity of $v\left(t\right)$ of an object. The result of this time dependent velocity, which can also have negative values, is the distance traveled $F\left(t\right)$ i.e. $x\left(t\right)$. Thus $v\left(t\right)$ determines the distance from the initial point as a function of time.

The constant $C$ is the initial value $F\left({x}_{1}\right)$ of the integral for the variable ${x}_{1}$, in out example the position from which we start.

Provided the range of the variable is open , i.e. $x>{x}_{1}$, the definite integral defined in this way is a function of the variable $x$.

If we are interested in the behaviour of the anti-derivative in a closed interval ${x}_{1}\le x\le {x}_{2}$ the definite integral becomes a fixed value. The value at the end of the integration range is the result of the initial value and of all changes until the final value of $x$ and is given by the anti-derivative $F\left({x}_{2}\right)$. The change within the interval results from the difference to the initial value. Calculating this difference also gets rid of the unknown integration constant, if we repeat the same line of thought with for initial and final value with an arbitrary initial value outside of the interval:

$$\underset{{x}_{1}}{\overset{{x}_{2}}{\int}}f\left(x\right)dx=F\left({x}_{2}\right)+C-\left(F\left({x}_{1}\right)+C\right)=F\left({x}_{2}\right)-F\left({x}_{1}\right)$$

This relationship is known as main theorem of differential and integral calculus.

Thus, in order to calculate a definite integral we “only” need to know its anti-derivative. To determine the anti-derivative for an arbitrary function $f\left(x\right)$ is in general not as easily possible as for the derivative. Basic functions can be easily integrated via inverting the well known relations for their derivatives; for many complicated functions there are tables. There are also quite a few useful, general rules, that can help to find the anti-derivative, for example “integration by parts”. But there is unfortunately no rule that always succeeds.

Therefore numerical methods play an especially important role for integration, as we will discuss later.

In analogy to calculating the partial sums of a series one can define the integral as surface measure of the function value in an interval of the variable. It is obvious, that one can not simply calculate a sum of function values, since their number would be infinitely large. The factor to be used is analogous to the index difference for series and is equal to the width of the interval. If one multiplies this factor with a suitably chosen function value we obtain a measure for the surface under the function in the interval.

Since functions change in general when the variable changes, choosing an arbitrary function value from the interval (for example at the the beginning , in the middle or at the end) can only yield an approximation. In this case one decomposes a larger interval $\left[{x}_{1}\cdots {x}_{2}\right]$ into $n$ intervals chosen equal for expedience of width $\Delta x=\left({x}_{2}-{x}_{1}\right)\u2215n$ and sums over the approximate measures of the sub-intervals. Then the integral is defined as limit of this sum for a vanishingly small sub-interval.

The notation in the following three lines is somewhat inexact!!!

$$\begin{array}{c}\text{Measureofthesub-interval}\Delta x:\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}f\left({x}_{i}\right)\Delta x;\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}{x}_{i}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{in}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\Delta x\hfill \\ \text{Totalmeasureoftheregion}{x}_{2}x{x}_{1}:\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\sum _{{x}_{i}={x}_{1}}^{{x}_{2}}f\left({x}_{i}\right)\Delta x\hfill \\ \text{Integral:}\underset{{x}_{1}}{\overset{{x}_{2}}{\int}}f\left(x\right)dx=\underset{\Delta x\to 0}{lim}\sum _{{x}_{i}={x}_{1}}^{{x}_{2}}f\left({x}_{i}\right)\Delta x\hfill \\ \hfill \end{array}$$

The definite integral provides the area between the function $f\left(x\right)$ and the $x$-axis in the region of integration.

The limiting process is shown in the interactive simulation of Fig.5.10

The sine function to be integrated is drawn in blue, while the analytical integral function is drawn in red. The small blue point, that can be moved with the slider indicates the initial point for the integration and thus at the same time the zero point of the formal integral. The thick end point in magenta can be adjusted with the mouse. The second slide determines the number of sub-intervals .

The green rectangles represent the contribution for the individual interval, if the initial value of the function in the interval is assumed to be constant for the whole interval. The sum of the contributions for all intervals yields the big green point. With decreasing width of the intervals it approaches the analytically calculated integral. For a sufficiently large number of intervals this value runs along the integral curve when pulling the end point.

You will find further instructions for experiments in the description pages of the simulation.

We still require a criterion to decide, whether a function can be integrated at all in a given region. In the classical sense this is provided by the Integral definition of Riemann.

RiemannInt For this purpose we define for the intervals given by ${x}_{0}<...<{x}_{i}<...<{x}_{n}$ with interval widths ${x}_{i}-{x}_{i-1}=\Delta {x}_{i}$ two sums, namely the upper sum and the lower sum, of which the first one uses the largest function value, the supremum, in each interval and the second one uses the smallest function value, the infinum, in each interval. If both sums converge to the same value for $n\to \infty $, the one from above the other one from below, the function is considered as integrable in the Riemannian sense

an inexact notation again!!!

$$\begin{array}{c}\text{Firstmeasureforsub-interval}{\Delta}_{i}x:\text{}{\Delta}_{i}x\cdot supremum\text{of}f\left(x\right)\text{in}\left({\Delta}_{i}x\right)\hfill \\ \text{Secondmeasureforsub-interval}{\Delta}_{i}x:\text{}{\Delta}_{i}x\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\cdot \phantom{\rule{0em}{0ex}}infimum\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{of}f\left(x\right)\text{in}\left({\Delta}_{i}x\right)\hfill \\ \text{Firstsummeasureforregion}{x}_{2}x{x}_{1}:\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\sum _{i=1}^{n}{\Delta}_{i}x\cdot supremum\text{of}f\left(x\right)\text{in}\left({\Delta}_{i}x\right)\hfill \\ \text{Secondsummeasureforregion}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}{x}_{2}x{x}_{1}:\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\sum _{i=1}^{n}{\Delta}_{i}x\cdot infimum\text{of}f\left(x\right)\text{in}\left({\Delta}_{i}x\right)\hfill \\ \text{Riemann-integral}\underset{{x}_{1}}{\overset{{x}_{2}}{\int}}f\left(x\right)dx\text{exists,if}\hfill \\ \phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\underset{n\to \infty}{lim}\sum _{i=1}^{n}{\Delta}_{i}x\cdot supremum\text{of}f\left(x\right)\text{in}\left({\Delta}_{i}x\right)\stackrel{!}{=}\underset{n\to \infty}{lim}\sum _{i=1}^{n}{\Delta}_{i}x\cdot infimum\text{of}f\left(x\right)\text{in}\left({\Delta}_{i}x\right)\hfill \\ \hfill \end{array}$$

In the following interactive simulation shown in Fig.5.11 the construction of the Riemannian sums is demonstrated using the example of the sine function. In the left window the upper sum (supremum) is used and in the right window the lower sum (infinum). The width of all intervals is the same. The formal integral is shown in yellow. The initial and final $x$-values can again be adjusted as well as the number of intervals. With increasing resolution both sums tend to the same value.

The initial $x$-value can again be adjusted with a slider and the final $x$-value ( magenta coloured) can be pulled with the mouse. The number $n$ of sub-intervals in the integration region is adjusted with the second slider. The analytically determined integral is indicated in yellow. Its initial value is given by the initial ordinate of the integration region. The point that is surrounded by a square shows the sum of approximating intervals.

If it is known, that a function is Riemann-integrable, then any sum that uses as measure any value of the function in the sub-intervals converges against the integral. Thus one has a lot of freedom in the choice of numerical integration method. You are urged to compare the last two figures. The step-function approximation is neither equal to the approximation with the supremum nor to that via the infinum. but converges to the same limit.

As an example for a function, that can not be integrated in the Riemannian sense, the exotic function mentioned above can be considered:

$$\begin{array}{c}\begin{array}{cc}\hfill f\left(x\right)\phantom{\rule{0em}{0ex}}=\hfill & \hfill \left\{\begin{array}{c}1\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{for}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}x\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{irrational,}\hfill \\ 0\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{for}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}x\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{rational}\hfill \\ \hfill \end{array}\right\}\hfill \\ \hfill \hfill \end{array}\hfill \\ \text{Domainofdefinition:}0\le x\le 1\hfill \\ \hfill \end{array}$$

In its domain of definition it has obviously an upper sum 1 and a lower sum 0, since there are both rational and irrational numbers in every interval of an arbitrarily small length $\Delta x>0$, and thus there exist function values of $0$ and $1$. Thus the upper sum and the lower sum converge, but not to the same value and therefore the function is not Riemann-integrable.

The previous statement is not really satisfactory. The number of rational numbers is much smaller than that of the irrational ones, and therefore the function $f\left(x\right)$ has the value !$1$ for nearly all values of $x$. Therefore the integral of this function should be close to 1.

This question can be more easily answered with the alternative notion of the Lebesgue-integral. For this approach one subdivides the integration region in stripes parallel to the $x-$axis and asks for the limit of the sum over these intervals, each interval contributing the product of the function value in the interval and the corresponding Lebesgue-measure of the interval on the ordinate:

$$\mu \left(\Delta y\right)=\text{Measureofall}x\text{-values,whose}f\left(x\right)\text{liein}\Delta y.$$

In the exotic example the top stripe has the function value $1$ and the measure of its variable interval is (for the moment approximately) $1$, since nearly all numbers are irrational. the lowest strip has the function value $0$, independent of the measure for the variable interval.

The exotic function is therefore Lebesgue-integrable and the result is $1$.

The advantage of the integral definition of Lebesgue is, that using it , the integral notion can beyond the domain of numbers to sets in general, if these set can be decomposed in to subsets, which each can be measured in the sense of a finite area. The following holds: a function, that is Riemann-integrable is also Lebesgue-integrable but the converse is not true. Thus the Lebesgue integral is the more general notion.

For the following simple example we visualize the integration of a parabola on the left hand side using Riemann’s approach and on the right hand side with Lebesgue’s approach. For the Lebesgue integral the interval measure was calculated in such a way, that the measure is exact irrespective of the width of the interval. the

As for derivatives there a number of important and general rules (the integration constant we drop in the following for clarity).

$$\begin{array}{c}\int Cdt=C\int dt=Ct\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{constant}C\hfill \\ \text{with}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}g=g\left(t\right)\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{und}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}h=h\left(t\right)\hfill \\ \int \left(g\left(t\right)+h\left(t\right)\right)dt=\int g\left(t\right)dt+\int h\left(t\right)dt\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{Additivity}\hfill \\ \int gdh=gh-\int hdg\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{Integrationbyparts}\hfill \\ \int f\left(t\right)dt=\int f\left(g\left(x\right)\right){g}^{\prime}\left(x\right)dx\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{Introductionofanewvariable}x\text{via}t=g\left(x\right)\hfill \\ \hfill \end{array}$$

For the especially useful rules of partial integration and substitution of a new variable it is important, to find such functions that can be easily integrated, as for example the exponential function, powers of $x$ and the trigonometric functions.

The following formulas for basic functions without the integration constant follow very easily from the formulas given above for the first derivatives and therefore we only list those of the largest practical importance

$$\begin{array}{c}\int Cdt=Ct\hfill \\ \int {t}^{n}dt=\frac{{t}^{n+1}}{n+1}\hfill \\ \int {e}^{t}dt={e}^{t}\hfill \\ \int {a}^{t}dt=\int {e}^{tlna}=\frac{{a}^{t}}{lna}\hfill \\ \int \frac{1}{t}dt=lnt\hfill \\ \int sintdt=-cost\hfill \\ \int costdt=sint\hfill \\ \hfill \end{array}$$

The analytical integration of functions that can be integrated in principle and are possible rather complex is as a rule more tedious than the always easily achievable differentiation. Therefore there exist voluminous collections of integrals in the corresponding text books, manuals and on the internet. Numerical computer program such as Mathematica also have a wide range of formal integrals built in, that one can access as formulas if one enters the function to be integrated.

It is obvious that numerical integration methods play a very important role, since it does not matter for their application whether an integral of the function to be integrated is known analytically or not, and since one can even integrate functions, that are only known as discrete measured values ${f}_{i}$.

Integrals often have to be calculated numerically , if it is not possible to determine the anti-derivative analytically. In this case the sums obtained using step functions converge only relatively slowly when decreasing the interval widths; one would have to therefore subdivide the integration region into many sub-intervals to achieve a high accuracy.

Therefore one uses other approximations of the function $f\left(x\right)$ than the step functions in order to reach convergence faster. An obvious approximation when looking at the last figure consists of not taking the value $f\left({x}_{i}\right)$ at the beginning of the interval as constant for the interval (step-function approximation), but to use the mean value between initial and final value $\frac{1}{2}\left[f\left({x}_{i}\right)+f\left({x}_{i}+1\right)\right]$. This corresponds to a trapezoidal approximation , where one adds to the staircase the triangle leading to the next function value; the curve is now approximated via the initial value in the interval and the secant connecting the final and initial value with the slope $\frac{{y}_{i+1}-{y}_{i}}{\Delta x}$.

The approximation of the function becomes even more accurate if one uses a parabola

S Rule (Simpson’s/Kepler’s method), that is fixed via three consecutive function values. This now also takes the curvature (second derivative) in each interval into account approximately. Thus those regions of the function that possess like a parabola no turning points in the respective sub-intervals (${x}_{i},{x}_{i+1}$) are approximated well. One can continue is this manner if one uses polynomials of third or fourth degree which then also allow for the representation of turning points. However one then needs to use more and more intermediate points in each sub-interval. Therefore one usually restricts this approach to the parabola and chooses the interval sufficiently small.

All these methods have the advantage, that the approximation of the function in terms of constants, secants and parabolas can be quite easily integrated.

$$\begin{array}{c}\text{Rectangleapproximation:}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}y={y}_{i}\to \underset{{x}_{i}}{\overset{{x}_{i}+{\Delta}_{i}x}{\int}}ydx\approx \underset{{x}_{1}}{\overset{{x}_{1}+{\Delta}_{i}x}{\int}}{y}_{1}dx\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}=\phantom{\rule{0em}{0ex}}{\Delta}_{i}x\cdot {y}_{i}\hfill \\ \text{Trapezoidalapproximation:}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}y={y}_{i}+\frac{{y}_{i+1}-{y}_{i}}{{\Delta}_{i}x}\left(x-{x}_{i}\right)\hfill \\ \to \underset{{x}_{i}}{\overset{{x}_{i}+{\Delta}_{i}x}{\int}}ydx\approx {\Delta}_{i}x{y}_{i}+\frac{{y}_{i+1}-{y}_{i}}{{\Delta}_{i}x}\left[\frac{{\left(xi+{\Delta}_{i}x\right)}^{2}-{x}_{i}^{2}}{2}-{x}_{i}\left({x}_{i}+{\Delta}_{i}x-{x}_{i}\right)\right]\hfill \\ ={\Delta}_{i}x{y}_{i}+\frac{{\Delta}_{i}x}{2}\left({y}_{i+1}-{y}_{i}\right)\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}=\frac{{\Delta}_{i}x}{2}\left({y}_{i}+{y}_{i+1}\right)\hfill \\ \text{Parabolicapproximation:}\underset{{x}_{i}}{\overset{{x}_{i}+{\Delta}_{i}x}{\int}}ydx\approx \underset{{x}_{i}}{\overset{{x}_{i}+2{\Delta}_{i}x}{\int}}\left(a{x}^{2}+bx+c\right)dx=\frac{{\Delta}_{i}x}{3}\left({y}_{i}+4{y}_{i+1}+{y}_{i+2}\right)\hfill \\ \hfill \end{array}$$

The simulation in Fig.5.13 compares the three methods for two adjacent sub-intervals. As example we again consider the sine function(blue) with its analytical integral (red). Initial and end point of the integration region can be changed. The sum of both sub-intervals is shown as a green point. The Simulation shows the large superiority of the parabolic approximation, whose result agrees with the red curve even for a coarse subdivision of the interval.

It is a bit tedious to calculate the parameters of a parabola, that goes through three points, but this is only necessary, if as for this simulation the osculating curves are calculated. The following steps are required for the calculation in each sub-interval ${x}_{i}={x}_{1}\frac{1}{2}\left({x}_{i}+{x}_{i+1}\right)={x}_{2},{x}_{i+1}={x}_{3}$:

$\begin{array}{c}\text{coordinatesintheinterval}{x}_{1},{y}_{1}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}{x}_{2},{y}_{2}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}{x}_{3},{y}_{3}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}with\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}{x}_{2}-\phantom{\rule{0em}{0ex}}{x}_{1}={\Delta}_{i}x\u22152;\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}{x}_{3}-\phantom{\rule{0em}{0ex}}{x}_{2}={\Delta}_{i}x\u22152;\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}{\Delta}_{i}x={x}_{3}-{x}_{1}\hfill \\ \text{generalparabola}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}y=a{x}^{2}+bx+c\text{}\hfill \\ \text{theparameters}a,\text{}b,\text{}c\text{aredeterminedfromthefunctionvalues:}\hfill \\ 1\to {y}_{1}=a{x}_{1}^{2}+b{x}_{1}+c,\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}2\to {y}_{2}=a{x}_{2}^{2}+b{x}_{2}+c,\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}3\to {y}_{3}=a{x}_{3}^{2}+b{x}_{3}+c.\hfill \\ \text{Solution}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{for}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}a,\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}b,\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}c\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\text{yields}\hfill \\ a=\frac{2}{\Delta {x}^{2}}\left({y}_{1}-2{y}_{2}+{y}_{3}\right)\hfill \\ b=\frac{2}{\Delta x}\left({y}_{2}-{y}_{1}\right)-\left({x}_{1}+{x}_{2}\right)a=\frac{2}{\Delta x}\left({y}_{2}-{y}_{1}\right)-\frac{2}{\Delta {x}^{2}}\left({x}_{1}+{x}_{2}\right)\left({y}_{1}-2{y}_{2}+{y}_{3}\right)\hfill \\ c={y}_{1}-a{x}_{1}^{2}-b{x}_{1}=\hfill \\ {y}_{1}-{x}_{1}^{2}\frac{2}{\Delta {x}^{2}}\left({y}_{1}-2{y}_{2}+{y}_{3}\right)-{x}_{1}\left[\frac{2}{\Delta x}\left({y}_{2}-{y}_{1}\right)-\left({x}_{1}+{x}_{2}\right)\frac{2}{\Delta {x}^{2}}\left({y}_{1}-2{y}_{2}+{y}_{3}\right)\right]\hfill \\ \hfill \end{array}$

For the approximation to the integral over the sub-interval ${\Delta}_{ig}$ one obtains, using the parameters of the parabola and integrating a surprisingly simple formula, for which only the three function values and the width of the interval are required.

$$\text{parabolicapproximationof}\underset{{x}_{i}}{\overset{{x}_{i+1}}{\int}}f\left(x\right)dx\text{}\approx \underset{{x}_{i}}{\overset{{x}_{i+1}}{\int}}\left(a{x}^{2}+bx+c\right)dx\phantom{\rule{0em}{0ex}}=\frac{\Delta {x}_{i}}{6}\left({y}_{i}+4{y}_{i+\frac{1}{2}}+{y}_{i+1}\right)$$

To get an idea of the accuracy of the different integration methods, we expand the function in a Taylor series and use, assuming the interval is sufficiently small, the first neglected term as an estimate for the error. To simplify the notation, we expand the function in a Taylor series around $x=0$ up to 5th order:

$$\begin{array}{c}\text{}f\left(x\right)=y\left(x\right)=y\left(0\right)+{y}^{\prime}\left(0\right)x+{y}^{\u2033}\left(0\right)\frac{{x}^{2}}{2!}+{y}^{\u2034}\left(0\right)\frac{{x}^{3}}{3!}+{y}^{\left(4\right)}\left(0\right)\frac{{x}^{4}}{4!}+{y}^{\left(5\right)}\left(0\right)\frac{{x}^{5}}{5!}\hfill \\ 1\hfill \end{array})\underset{0}{\overset{\Delta x}{\int}}f\left(x\right)dx=y\left(0\right)\Delta x+\frac{{y}^{\prime}\left(0\right)}{2}\Delta {x}^{2}+\frac{{y}^{\u2033}\left(0\right)}{3\cdot 2!}\Delta {x}^{3}+\frac{{y}^{\u2034}\left(0\right)}{4\cdot 3!}\Delta {x}^{4}+\frac{{y}^{\left(4\right)}\left(0\right)}{5\cdot 4!}\Delta {x}^{5}+\frac{{y}^{\left(5\right)}\left(0\right)}{6\cdot 5!}\Delta {x}^{6}2)\underset{-\Delta x}{\overset{0}{\int}}f\left(x\right)dx=y\left(0\right)\Delta x-\frac{{y}^{\prime}\left(0\right)}{2}\Delta {x}^{2}+\frac{{y}^{\u2033}\left(0\right)}{3\cdot 2!}\Delta {x}^{3}-\frac{{y}^{\u2034}\left(0\right)}{4\cdot 3!}\Delta {x}^{4}+\frac{{y}^{\left(4\right)}\left(0\right)}{5\cdot 4!}\Delta {x}^{5}-\frac{{y}^{\left(5\right)}\left(0\right)}{6\cdot 5!}\Delta {x}^{6}\hfill \\ \hfill $$

$$\begin{array}{c}\text{}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\underset{-\Delta x}{\overset{\Delta x}{\int}}f\left(x\right)dx=\underset{0}{\overset{\Delta x}{\int}}f\left(x\right)dx+\underset{-\Delta x}{\overset{0}{\int}}f\left(x\right)dx=2\left[y\left(0\right)\Delta x+\frac{{y}^{\u2033}\left(0\right)}{3!}\Delta {x}^{3}+\frac{{y}^{\left(4\right)}\left(0\right)}{5!}\Delta {x}^{5}\right]\hfill \\ \phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\underset{-\Delta x\u22152}{\overset{\Delta x\u22152}{\int}}f\left(x\right)dx\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}\phantom{\rule{0em}{0ex}}=2\left[y\left(0\right)\frac{\Delta x}{2}+\frac{{y}^{\u2033}\left(0\right)}{3!}{\left(\frac{\Delta x}{2}\right)}^{3}+\frac{{y}^{\left(4\right)}\left(0\right)}{5!}{\left(\frac{\Delta x}{2}\right)}^{5}\right]\hfill \\ \hfill \end{array}$$

For the step-function method we use only the first term $y\left(0\right)$ in 1). The error for each interval is thus of the order $\Delta {x}^{2}$. If one wants know the error for the whole integration region, one has to sum over $L\u2215\Delta x$ interval. Thus the total error is proportional to $\Delta x$. Doubling the resolution leads to halving of the error or doubling of the accuracy.

For the trapezoidal method the first two terms are used in 1). The error then is proportional to $\Delta {x}^{3}$, thus the total error depends on $\Delta {x}^{2}$. Doubling the resolution leads to a improvement in the accuracy by a factor of $4$.

For the parabola method we expand the function from the middle of the double interval once to the right and once to the left and the integral over the whole interval is the sum over both sub-interval. The result then only contains odd powers of $\Delta x$. For the parabola we also take into account the curvature, i.e. ${y}^{\u2033}$. The error for each interval is then proportional to $\Delta {x}^{5}$, the total error is thus proportional to $\Delta {x}^{4}$; doubling the resolution leads to an increase of the accuracy by a factor of $16$. In addition the large factor $5!=120$ contributes to a small error.

Important hint: the approximating parabola used for the integration is not identical with the third partial sum of the Taylor series. This one only agrees with the function at the computation point, while the approximating parabola used for the integration is equal to the function at all three points.

The following figure compares the deviation from the analytic integral for the sine function in double logarithmic scale for the trapezoidal and parabolic methods as function of the resolution (number) of sub-intervals. The points represent the numerical integration results over a constant integration region, the lines represent the functions $a{n}^{-2}$ and $b{n}^{-4}$, with $a$ and $b$ chosen in such a way, that both lines coincide with the numerical error for the smallest number of intervals. The further behaviour of both functions and the points confirms the expected dependence on $n$.

This example should show demonstrate to you, how versatile the Taylor series of fifth order is, and therefore we have treated this in such depth.