Loading [MathJax]/jax/output/HTML-CSS/jax.js

You are here

Servois' 1817 "Memoir on Quadratures" – Student Exercises on The Trapezoidal Rule and Kramp's Algorithm

Author(s): 
Robert E. Bradley (Adelphi University) and Salvatore J. Petrilli, Jr. (Adelphi University)

 

In this section and the next, we provide suggestions for student exercises related to Servois' memoir on numerical integration. We begin with some additional detail about Kramp's notation and algorithm which forms the basis of the exercises at the end of this section.

The Composite Trapezoidal Rule (or just the Trapezoidal Rule) gives an approximate value of a definite integral

baf(x)dx.

To apply the rule, we let Δx=ban and define xi=a+kΔx for 0in. Then

Δx2[f(x0)+2f(x1)+2f(x2)++2f(xn1)+f(xn)](XI)

provides an approximate value of the definite integral, with better and better approximations as the value of n increases.

In his article [Kramp 1815a], Christian Kramp presented an algorithm that takes a few such approximate values of a definite integral, for different small values of n, and uses an extrapolation procedure to produce a new estimate that is much more accurate than those given by the Trapezoidal Rule.

Let's illustrate Kramp's algorithm by applying it to the definite integral

211xdx.

Kramp chose this example because we can compare the approximations to the exact value of the integral, which is ln2=0.69314718.

The first approximation comes from taking n=1. This gives

S4=12[f(1)+f(2)]=34=0.75.

The second approximation is given by n=2:

S2=122[f(1)+2f(32)+f(2)]=1724=0.708¯3.

We take one more approximation, this time with n=4:

S1=142[f(1)+2f(54)+2f(32)+2f(74)+f(2)]=117116800.697023810.

Let's pause to make some comments about the subscripts, which seem to be wrong. The first observation is that Kramp actually used this notation. In the 1810s some mathematicians used subscripts, which were then a recent invention, but many others did not. Nowhere in his “Memoir on Quadratures” [Servois 1817], nor in any of his other works, did Servois make use of subscripts. None of the great mathematicians of the 17th and 18th centuries had access to this useful notational device.

As for the case in point, Kramp took the smallest value of Δx=14 as a sort of unit for all of the approximations. Let's call it ω. Then the first approximation above, with n=1, comes from taking Δx=4ω, and so he denoted it S4. The second approximation has Δx=2ω, so it is called S2. Finally, the last and most accurate estimate uses Δx=1ω, so it is called S1. The larger n is, the smaller Δx is and the more accurate the approximation is. So intuitively, the value of S0, which may be thought of as a limit as Δx goes to zero, should be the value of the integral. The problem then is to use S4, S2 and S1 to estimate S0.

We let S(x) be the function that gives the values of Sn (Kramp used F for this function). Kramp assumed that the function S was an even function, although he didn't explain why, other than to say that he wanted S(0)=0. Therefore the MacLaurin series for S is

S(x)=A+Bx2+Cx4+Dx6+.

We then expect that S(0)=A should be the value of the definite integral, or at least a good estimate to it.

In the current example, we only have three estimates, so we can only get the approximate values of the first three coefficients of the the MacLaurin series. In other words, we'll fit our three data points to the equation

Sn=A+Bn2+Cn4.

This gives a 3×3 linear system:

A+B+C=11711680A+4B+16C=1724A+16B+256C=34

This system is small enough to solve by hand. The solution gives the value

A=436763000.693174603,

 which is very close to ln2. The absolute error of the approximation is |Aln2|0.0000274, which is less than .004% of the actual value of the integral. This compares with an absolute error of about 0.00388 in the estimate S4, more than 100 times bigger.

Kramp's Algorithm

Let N be a natural number, preferably a composite number with many factors. Let m=σ(N), the number of factors of N. We estimate the integral

I=baf(x)dx

by m different applications of the Trapezoidal Rule. Let ω=baN.

Now for each factor n of N, let k=Nn and let Sk be the Trapezoidal Rule approximation of the integral I with Δx=kω given by formula (XI).

Suppose that

S(x)=A0+A1x2+Amx2(m1)

and fit the values of Sk to this equation. This gives an m×m linear system

A0+A1++Am=S1A0+2A1++22(m1)Am=S2A0+kA1++k2(m1)Am=SkA0+NA1++N2(m1)Am=SN.

(Here we implicitly assumed that N is even. More generally, the second equation corresponds to the smallest proper factor k>1 of N.)

This linear system is solved and the value of A0 is used to estimate the definite integral I.

In his paper [Kramp 1815a], Kramp used N=12, so that S(x) was a polynomial of degree 10

and the estimates S1, S2, S3, S4, S6 and S12 were fitted to the curve; see figure 7. This gave him an estimate

211xdx0.69314806,

which has an absolute error of about 8.8×107, a little more than one part in a million of the true value. This is an impressively accurate estimate!

Figure 7: Kramp's Algorithm for N=12

Exercises for Students

  1.  Use Kramp's algorithm to estimate 1011+x2dx=π4 with N=4. The steps are the same as in the first example above: calculate S4, S2, and S1, then fit the data to the curve S(x)=A+Bx2+Cx4, and use the value of A to approximate the integral.
    You should find the approximate value to be 66778500. You don't need to use rational number arithmetic—floating point is just fine, but be sure to use plenty of digits of accuracy, say 8 at least. What is the absolute error in this estimate?
  2. The integral in the exercise #1 is not the only way to estimate the value of π4. Repeat the steps of exercise #1 to estimate the definite integral  101x2dx. Of course, it's not possible to do this using rational number arithmetic, so floating point calculations are the only reasonable option. Which of these two estimates of π4 is more accurate?
    (Although Kramp himself estimated the integral in exercise #1 in [Kramp 1815a], he did not consider expression in this exercise. Since he had to do all of his calculations by hand, the appearance of a square root would have made the problem an order of magnitude more difficult.)
  3. Here is one more definite integral whose exact value involves π. 1011x2dx.=arcsin(1)=π2 Can Kramp's algorithm be used to estimate this integral? What about the integral  12011x2dx.=arcsin(1)=π6?
  4. Use Kramp's algorithm to give an estimate of  211xdx  with N=6. This will give you values of S6 when Δx=1, S3 when Δx=12, S2 when Δx=13, and S1 when Δx=16. You will fit four data points to the equation  S(x)=A+Bx2+Cx4+Dx6 and use the value of A to estimate the integral. You will probably want to use some sort of software package to solve the resulting 4×4 linear system.
  5. Repeat exercise #1 with N=6.
  6.  Repeat exercise #2 with N=6.
  7. Repeat exercise #4 with N=10. Intuitively, this might be expected to give about the same level of accuracy as N=6, because it also involves four estimates: S10, S5, S2 and S1. On the other hand, we expect S1 to be more accurate in this case because it uses n=10 subintervals instead of only 6. Which estimate is more accurate?
  8. Repeat exercise #1 with N=10.
  9. Repeat exercise #2 with N=10.
  10. As a challenge problem, repeat exercises #4 and #1 with N=12. These are the results given by Kramp in his paper [Kramp 1815a]. His results were 0.69314806 and 0.78539271, respectively.

Robert E. Bradley (Adelphi University) and Salvatore J. Petrilli, Jr. (Adelphi University), "Servois' 1817 "Memoir on Quadratures" – Student Exercises on The Trapezoidal Rule and Kramp's Algorithm," Convergence (May 2019)