Chapter VII · Additional theorems in the differential and integral calculus

Approximate integration: Simpson's rule

§169 40 min

The trapezium rule and Simpson's rule, their error formulae, and why Simpson's rule, exact for cubics, wins the race by a factor that grows with the work done.

Why this matters

Most definite integrals cannot be evaluated in closed form: ∫01e−x2 dx\int_0^1 e^{-x^2}\,dx has no elementary antiderivative, and even when one exists it may be clumsy. In practice integrals are computed numerically, from a few values of the integrand. §169 gives the two classical rules, the trapezium rule and Simpson’s rule, and, more importantly, exact formulae for their errors, so that an approximation comes with a guarantee. The proof for Simpson’s rule is a fine example of the Rolle-type argument behind Taylor’s theorem.

The idea

The trapezium rule replaces the curve between x=ax = a and x=bx = b by the straight chord, and the area by that of a trapezium: 12(b−a){f(a)+f(b)}\tfrac12(b-a)\{f(a) + f(b)\}. It is exact when ff is linear, and its error is governed by how much the graph bends, that is, by f′′f''.

Simpson’s rule uses one more value, at the midpoint, and replaces the curve by the parabola through three points:

∫abf(x) dx≈16(b−a){f(a)+4f ⁣(a+b2)+f(b)}.\int_a^b f(x)\,dx \approx \tfrac16(b - a)\left\{f(a) + 4f\!\left(\tfrac{a+b}{2}\right) + f(b)\right\}.

A parabola is exact for quadratics, as one would expect; the surprise is that Simpson’s rule is exact for cubics as well, because the symmetric placing of the three points makes the cubic term cancel. So its error is governed by f(4)f^{(4)}, and it is proportional to the fifth power of the interval length. Split [a,b][a, b] into nn panels and apply a rule to each: the total error falls like 1/n21/n^2 for the trapezium rule and like 1/n41/n^4 for Simpson’s. Doubling the work divides the errors by about 44 and 1616.

Explore Trapezium against Simpson

Try this. With exe^x, move the slider and read how much each doubling of the work divides each error. Then try 1/(1+x2)1/(1+x^2) and sin⁡x\sin x; then the cubic x3−xx^3 - x; and last x\sqrt x.

∫01ex dx=1.7182818\int_{0}^{1} e^x\,dx = 1.7182818: error against the number of function values used
ordinates (log scale)log₁₀|error|
  • trapezium rule
  • midpoint rule
  • Simpson’s rule
  • the row shown below
Integrand
With 99 ordinates: trapezium error 0.002240.00224, Simpson error 2.33×10−62.33 \times 10^{-6} (midpoint with 88 values: −0.00112-0.00112).
Doubling the work divided the trapezium error by 44 and the Simpson error by 15.915.9 (the formulae predict about 44 and 1616 for smooth integrands).
What to notice

For smooth integrands the points lie close to straight lines of slope about −2-2 (trapezium and midpoint) and −4-4 (Simpson), on these log scales, and the ratios settle near 44 and 1616. Simpson reaches the limit of machine accuracy with about a thousand function values; the trapezium rule would need several thousand times as many (millions of values) to reach the same accuracy. For the cubic, Simpson is exact from the start. For x\sqrt x, whose derivatives are infinite at 00, the error formulae do not apply, and all three rules crawl along at the same slow rate.

Precise statements

Theorem The trapezium rule Hardy: §169 (1); Examples LXVII, 2

If ff has a second derivative on [a,b][a, b] (and f′f' is continuous there), then for some ξ\xi in (a,b)(a, b)

∫abf(x) dx=12(b−a){f(a)+f(b)}−112(b−a)3f′′(ξ).\int_a^b f(x)\,dx = \tfrac12(b-a)\{f(a) + f(b)\} - \tfrac1{12}(b-a)^3 f''(\xi).
Theorem Simpson’s rule Hardy: §169 (2)

If ff has derivatives up to the fourth order on [a,b][a, b] (with f′′′f''' continuous there), then for some ξ\xi in (a,b)(a, b)

∫abf(x) dx=16(b−a){f(a)+4f ⁣(a+b2)+f(b)}−(b−a)52880f(4)(ξ).\int_a^b f(x)\,dx = \tfrac16(b-a)\left\{f(a) + 4f\!\left(\tfrac{a+b}{2}\right) + f(b)\right\} - \frac{(b-a)^5}{2880}f^{(4)}(\xi).

In particular Simpson’s rule is exact for every polynomial of degree at most 33.

Corollary Composite rules Hardy: §169

Divide [a,b][a, b] into nn equal panels of width H=(b−a)/nH = (b-a)/n and apply each rule to every panel. With f′′f'' (respectively f(4)f^{(4)}) continuous, the total errors are

−(b−a)H212f′′(ξ)(trapezium),−(b−a)H42880f(4)(ξ)(Simpson),-\frac{(b-a)H^2}{12}f''(\xi) \quad\text{(trapezium)}, \qquad -\frac{(b-a)H^4}{2880}f^{(4)}(\xi) \quad\text{(Simpson)},

for some ξ\xi in (a,b)(a, b) in each case.

The composite errors come from adding the panel errors, −112H3∑f′′(ξi)-\tfrac1{12}H^3\sum f''(\xi_i), and noting that 1n∑f′′(ξi)\frac1n\sum f''(\xi_i) is an average of values of a continuous function, hence itself a value f′′(ξ)f''(\xi) (the intermediate value theorem). Simpson’s case is identical.

Proofs

Hardy’s proof works with a symmetric interval. Write cc for the midpoint and hh for the half-width, so that a=c−ha = c - h, b=c+hb = c + h, and Simpson’s rule reads 13h{f(c−h)+4f(c)+f(c+h)}\tfrac13 h\{f(c-h) + 4f(c) + f(c+h)\}.

Proof The error in Simpson’s rule
Strategy

Let the interval grow from nothing: let ψ(t)\psi(t) be the error of Simpson’s rule on [c−t,c+t][c - t, c + t]. It vanishes at t=0t = 0 together with its first two derivatives, and its third derivative is t2t^2 times a value of f(4)f^{(4)}. Subtract a multiple of t5t^5 chosen to vanish also at t=ht = h, and apply Rolle’s theorem three times, as in the proof of Taylor’s theorem.

The error as a function of the half-width

For 0≤t≤h0 \le t \le h let

ψ(t)=∫c−tc+tf(x) dx−13t {f(c+t)+4f(c)+f(c−t)}.\psi(t) = \int_{c-t}^{c+t} f(x)\,dx - \tfrac13 t\,\{f(c+t) + 4f(c) + f(c-t)\}.

We want ψ(h)\psi(h). Clearly ψ(0)=0\psi(0) = 0.

Differentiate three times

By the fundamental theorem, ddt∫c−tc+tf=f(c+t)+f(c−t)\frac{d}{dt}\int_{c-t}^{c+t}f = f(c+t) + f(c-t). Differentiating and simplifying,

ψ′(t)=23{f(c+t)−2f(c)+f(c−t)}−13t{f′(c+t)−f′(c−t)},\psi'(t) = \tfrac23\{f(c+t) - 2f(c) + f(c-t)\} - \tfrac13 t\{f'(c+t) - f'(c-t)\},ψ′′(t)=13{f′(c+t)−f′(c−t)}−13t{f′′(c+t)+f′′(c−t)},ψ′′′(t)=−13t{f′′′(c+t)−f′′′(c−t)}.\psi''(t) = \tfrac13\{f'(c+t) - f'(c-t)\} - \tfrac13 t\{f''(c+t) + f''(c-t)\}, \qquad \psi'''(t) = -\tfrac13 t\{f'''(c+t) - f'''(c-t)\}.

So ψ(0)=ψ′(0)=ψ′′(0)=0\psi(0) = \psi'(0) = \psi''(0) = 0.

Use the mean value theorem on f′′′f'''

f′′′(c+t)−f′′′(c−t)=2t f(4)(ξ)f'''(c+t) - f'''(c-t) = 2t\,f^{(4)}(\xi) for some ξ\xi between c−tc - t and c+tc + t. Hence ψ′′′(t)=−23t2f(4)(ξ)\psi'''(t) = -\tfrac23 t^2 f^{(4)}(\xi), where ξ\xi depends on tt.

An auxiliary function that vanishes at both ends

Let ϕ(t)=ψ(t)−(t/h)5ψ(h)\phi(t) = \psi(t) - (t/h)^5\psi(h). Then ϕ(0)=ϕ(h)=0\phi(0) = \phi(h) = 0, ϕ′(0)=ϕ′′(0)=0\phi'(0) = \phi''(0) = 0, and

ϕ′′′(t)=ψ′′′(t)−60t2h5ψ(h)=−23t2{f(4)(ξ)+90h5ψ(h)}.\phi'''(t) = \psi'''(t) - \frac{60t^2}{h^5}\psi(h) = -\tfrac23 t^2\left\{f^{(4)}(\xi) + \frac{90}{h^5}\psi(h)\right\}.

Rolle three times

ϕ(0)=ϕ(h)=0\phi(0) = \phi(h) = 0, so ϕ′(t1)=0\phi'(t_1) = 0 for some t1t_1 in (0,h)(0, h). Then ϕ′(0)=ϕ′(t1)=0\phi'(0) = \phi'(t_1) = 0, so ϕ′′(t2)=0\phi''(t_2) = 0 for some t2t_2 in (0,t1)(0, t_1). Then ϕ′′(0)=ϕ′′(t2)=0\phi''(0) = \phi''(t_2) = 0, so ϕ′′′(t3)=0\phi'''(t_3) = 0 for some t3t_3 in (0,t2)(0, t_2).

Read off the error

Since t3≠0t_3 \ne 0, the bracket vanishes at t=t3t = t_3: ψ(h)=−h590f(4)(ξ)\psi(h) = -\frac{h^5}{90}f^{(4)}(\xi) with ξ\xi in (c−t3,c+t3)⊂(a,b)(c - t_3, c + t_3) \subset (a, b). With h=12(b−a)h = \tfrac12(b - a), h5/90=(b−a)5/2880h^5/90 = (b-a)^5/2880, which is the formula. If ff is a cubic then f(4)=0f^{(4)} = 0 and the rule is exact.

The trapezium rule is proved the same way (Examples LXVII, 2): with ψ(t)=∫c−tc+tf−t{f(c+t)+f(c−t)}\psi(t) = \int_{c-t}^{c+t} f - t\{f(c+t) + f(c-t)\} and ϕ(t)=ψ(t)−(t/h)3ψ(h)\phi(t) = \psi(t) - (t/h)^3\psi(h), one application of Rolle’s theorem and one of the mean value theorem give an error −23h3f′′(ξ)=−112(b−a)3f′′(ξ)-\tfrac23 h^3 f''(\xi) = -\tfrac1{12}(b-a)^3f''(\xi).

Here are the parabolas themselves, panel by panel.

Explore Chords and parabolas

Try this. Switch between the trapezium rule and Simpson’s rule with n=1n = 1 and n=2n = 2 panels, and compare the errors in the read-out.

∫01ex dx\int_{0}^{1} e^x\,dx, trapezoid rule with n=1n = 1
xy
  • y = f(x)
  • pieces above the axis count +
  • below the axis count −
Rule
Trapezoid sum S1=1.85914S_{1} = 1.85914; exact value 1.718281.71828; error 0.1410.141 (refine and watch how fast it shrinks).
What to notice

With a single panel the chord misses the curve visibly, while the parabola through the ends and the midpoint is hard to tell from it. The trapezium error is about −112f′′-\tfrac1{12}f'' times the cube of the width; Simpson’s is smaller by a large factor and shrinks much faster as nn grows.

Worked examples and exercises

Exercise Computing π\pi ●○○ Hardy: Examples LXVII, 4

Apply Simpson’s rule to 14π=∫01dx1+x2\tfrac14\pi = \int_0^1\frac{dx}{1+x^2}, first with the single panel [0,1][0, 1], then with the two panels [0,12][0, \tfrac12] and [12,1][\tfrac12, 1].

Hint
The values you need: f(0)=1f(0) = 1, f(14)=1617f(\tfrac14) = \tfrac{16}{17}, f(12)=45f(\tfrac12) = \tfrac45, f(34)=1625f(\tfrac34) = \tfrac{16}{25}, f(1)=12f(1) = \tfrac12.

Solution

One panel: 16{1+4⋅45+12}=4.76=0.78333…\tfrac16\{1 + 4\cdot\tfrac45 + \tfrac12\} = \tfrac{4.7}{6} = 0.78333\ldots

Two panels, each of width 12\tfrac12:

112{1+6417+45}+112{45+6425+12}=0.4637255+0.3216667=0.7853922…\tfrac1{12}\left\{1 + \tfrac{64}{17} + \tfrac45\right\} + \tfrac1{12}\left\{\tfrac45 + \tfrac{64}{25} + \tfrac12\right\} = 0.4637255 + 0.3216667 = 0.7853922\ldots

The true value is 14π=0.7853982…\tfrac14\pi = 0.7853982\ldots (Hardy prints 0.78539160.7853916 for the two-panel value; the arithmetic above gives 0.78539220.7853922). Halving the panel width reduced the error from 0.00210.0021 to 0.00000600.0000060, a factor of about 340340, much more than 1616: the asymptotic factor 1616 is only reached once the panels are small, and the first panel here is wide for this function.

Exercise The second difference ●●○ Hardy: Examples LXVII, 1

Prove that if ff has a second derivative, then f(x+h)−2f(x)+f(x−h)=h2f′′(ξ)f(x+h) - 2f(x) + f(x-h) = h^2f''(\xi) for some ξ\xi between x−hx - h and x+hx + h.

Hint
Use Hardy’s auxiliary function ϕ(t)=f(x+t)−2f(x)+f(x−t)−(t/h)2{f(x+h)−2f(x)+f(x−h)}\phi(t) = f(x+t) - 2f(x) + f(x-t) - (t/h)^2\{f(x+h) - 2f(x) + f(x-h)\}, for 0≤t≤h0 \le t \le h.
Hint
ϕ(0)=ϕ(h)=0\phi(0) = \phi(h) = 0 and ϕ′(0)=0\phi'(0) = 0.

Solution

Let D=f(x+h)−2f(x)+f(x−h)D = f(x+h) - 2f(x) + f(x-h) and take ϕ\phi as in the hint (with h>0h > 0; the case h<0h < 0 is the same with −h-h). Then ϕ(0)=0\phi(0) = 0, ϕ(h)=D−D=0\phi(h) = D - D = 0, and ϕ′(t)=f′(x+t)−f′(x−t)−2tD/h2\phi'(t) = f'(x+t) - f'(x-t) - 2tD/h^2, so ϕ′(0)=0\phi'(0) = 0. By Rolle, ϕ′(t1)=0\phi'(t_1) = 0 for some t1t_1 in (0,h)(0, h); then, applying the mean value theorem to f′f' on [x−t1,x+t1][x - t_1, x + t_1],

0=ϕ′(t1)=2t1f′′(ξ)−2t1Dh20 = \phi'(t_1) = 2t_1 f''(\xi) - \frac{2t_1D}{h^2}

for some ξ\xi in (x−t1,x+t1)(x - t_1, x + t_1). Dividing by 2t1≠02t_1 \ne 0 gives D=h2f′′(ξ)D = h^2f''(\xi). This is the case n=2n = 2 of Misc. Ex. 5, and it is the reason why {f(x+h)−2f(x)+f(x−h)}/h2→f′′(x)\{f(x+h) - 2f(x) + f(x-h)\}/h^2 \to f''(x) when f′′f'' is continuous.

Exercise The midpoint rule ●●○ Hardy: Examples LXVII, 3

Prove that ∫abf(x) dx=(b−a)f ⁣(a+b2)+124(b−a)3f′′(ξ)\int_a^b f(x)\,dx = (b-a)f\!\left(\tfrac{a+b}{2}\right) + \tfrac1{24}(b-a)^3f''(\xi) for some ξ\xi in (a,b)(a, b), if f′′f'' exists and f′f' is continuous. Compare with the trapezium rule, and deduce a combination of the two that is exact for cubics.

Hint
Use ψ(t)=∫c−tc+tf−2tf(c)\psi(t) = \int_{c-t}^{c+t}f - 2tf(c) and the same device: ϕ(t)=ψ(t)−(t/h)3ψ(h)\phi(t) = \psi(t) - (t/h)^3\psi(h).
Hint
The trapezium error is −2×-2\times the midpoint error (to leading order). Weight them to cancel.

Solution

With c=12(a+b)c = \tfrac12(a+b), h=12(b−a)h = \tfrac12(b-a) and ψ\psi as in the hint, ψ(0)=0\psi(0) = 0, ψ′(t)=f(c+t)+f(c−t)−2f(c)\psi'(t) = f(c+t) + f(c-t) - 2f(c), so ψ′(0)=0\psi'(0) = 0, and ψ′′(t)=f′(c+t)−f′(c−t)\psi''(t) = f'(c+t) - f'(c-t). With ϕ(t)=ψ(t)−(t/h)3ψ(h)\phi(t) = \psi(t) - (t/h)^3\psi(h): ϕ(0)=ϕ(h)=0\phi(0) = \phi(h) = 0 and ϕ′(0)=0\phi'(0) = 0. Rolle gives ϕ′(t1)=0\phi'(t_1) = 0, then ϕ′′(t2)=0\phi''(t_2) = 0 with 0<t2<t1<h0 < t_2 < t_1 < h. Now ϕ′′(t)=f′(c+t)−f′(c−t)−6tψ(h)/h3=2tf′′(ξ)−6tψ(h)/h3\phi''(t) = f'(c+t) - f'(c-t) - 6t\psi(h)/h^3 = 2t f''(\xi) - 6t\psi(h)/h^3 by the mean value theorem, so ψ(h)=13h3f′′(ξ)=124(b−a)3f′′(ξ)\psi(h) = \tfrac13 h^3 f''(\xi) = \tfrac1{24}(b-a)^3f''(\xi).

The midpoint error is +124(b−a)3f′′+\tfrac1{24}(b-a)^3f'', the trapezium error −112(b−a)3f′′-\tfrac1{12}(b-a)^3f'': opposite signs, the trapezium one twice as large. So 23(midpoint)+13(trapezium)\tfrac23(\text{midpoint}) + \tfrac13(\text{trapezium}) cancels the f′′f'' term, and

23(b−a)f(c)+13⋅12(b−a){f(a)+f(b)}=16(b−a){f(a)+4f(c)+f(b)},\tfrac23(b-a)f(c) + \tfrac13\cdot\tfrac12(b-a)\{f(a) + f(b)\} = \tfrac16(b-a)\{f(a) + 4f(c) + f(b)\},

which is Simpson’s rule. (In the widget, the midpoint and trapezium errors have opposite signs and ratio about −12-\tfrac12.)

Exercise When the error formula does not apply ●●○ Hardy: Examples LXVII, 6

Apply Simpson’s rule with five ordinates (two panels) to ∫12x−1/x dx\int_1^2\sqrt{x - 1/x}\,dx. The true value is 0.85422…0.85422\ldots. Why is the result so much worse than for ∫01dx1+x2\int_0^1\frac{dx}{1+x^2}?

Hint
The ordinates at x=1,1.25,1.5,1.75,2x = 1, 1.25, 1.5, 1.75, 2 are 00, 0.670820.67082, 0.912870.91287, 1.085621.08562, 1.224741.22474.
Hint
What is the derivative of x−1/x\sqrt{x - 1/x} at x=1x = 1?

Solution

With panels [1,1.5][1, 1.5] and [1.5,2][1.5, 2]:

0.253{0+4(0.67082)+2(0.91287)+4(1.08562)+1.22474}=0.253×10.07625=0.83969.\tfrac{0.25}{3}\{0 + 4(0.67082) + 2(0.91287) + 4(1.08562) + 1.22474\} = \tfrac{0.25}{3}\times 10.07625 = 0.83969 .

The error is about 0.0150.015, which is large for five ordinates (compare 0.0000060.000006 for π/4\pi/4). The reason: near x=1x = 1, x−1/x≈2(x−1)x - 1/x \approx 2(x - 1), so the integrand behaves like 2(x−1)\sqrt{2(x-1)} and its derivative is infinite at x=1x = 1. The error formula needs a bounded fourth derivative on the whole interval, and there is none here: it is the x\sqrt x case of the widget. A cure is a substitution that removes the square-root behaviour, for instance x=1+u2x = 1 + u^2, after which the integrand is smooth.

Exercise ●●○ Hardy: Examples LXVII, 7

Show that ∫04x34x−x2 dx=28π≈88\int_0^4 x^3\sqrt{4x - x^2}\,dx = 28\pi \approx 88.

Hint
4x−x2=4−(x−2)24x - x^2 = 4 - (x-2)^2. Put x=2+2sin⁡θx = 2 + 2\sin\theta.

Solution

With x=2+2sin⁡θx = 2 + 2\sin\theta, θ\theta from −12π-\tfrac12\pi to 12π\tfrac12\pi, we have 4x−x2=2cos⁡θ\sqrt{4x - x^2} = 2\cos\theta and dx=2cos⁡θ dθdx = 2\cos\theta\,d\theta. The integral becomes

∫−π/2π/28(1+sin⁡θ)3⋅4cos⁡2θ dθ=32∫−π/2π/2(1+3sin⁡θ+3sin⁡2θ+sin⁡3θ)cos⁡2θ dθ.\int_{-\pi/2}^{\pi/2} 8(1+\sin\theta)^3\cdot4\cos^2\theta\,d\theta = 32\int_{-\pi/2}^{\pi/2}(1 + 3\sin\theta + 3\sin^2\theta + \sin^3\theta)\cos^2\theta\,d\theta .

The odd powers of sin⁡θ\sin\theta integrate to 00 over the symmetric interval. ∫cos⁡2θ=12π\int\cos^2\theta = \tfrac12\pi and ∫sin⁡2θcos⁡2θ=18π\int\sin^2\theta\cos^2\theta = \tfrac18\pi over [−12π,12π][-\tfrac12\pi, \tfrac12\pi]. So the value is 32(12π+38π)=28π=87.96…32(\tfrac12\pi + \tfrac38\pi) = 28\pi = 87.96\ldots. (Simpson with five ordinates gives only about 7575: the integrand has square-root behaviour at both ends, as in the previous exercise.)

Check yourself

Check yourself Enter a number

For a smooth integrand, by roughly what factor does the error of composite Simpson’s rule fall when the number of panels is doubled?

Why

The composite error is −(b−a)H42880f(4)(ξ)-\frac{(b-a)H^4}{2880}f^{(4)}(\xi); halving HH divides H4H^4 by 1616. (For the trapezium rule, H2H^2 gives 44.)

Check yourself Choose one

For which of these is Simpson’s rule (one panel) exact on every interval?

Why

The error is a multiple of f(4)(ξ)f^{(4)}(\xi), which vanishes for cubics. The parabola through the three points is not the cubic, but the difference between them is a multiple of (x−a)(x−c)(x−b)(x-a)(x-c)(x-b), an odd function about cc whose integral over [a,b][a, b] is 00. For x4x^4 on [0,1][0,1] the rule gives 16(0+416+1)=524\tfrac16(0 + \tfrac4{16} + 1) = \tfrac5{24}, not 15\tfrac15.

Check yourself True or false?

Since Simpson’s error is O(H4)O(H^4), doubling the number of panels always divides the error by about 1616.

Why

False. The error formula assumes a fourth derivative on the closed interval. For x\sqrt x on [0,1][0, 1] the derivatives are infinite at 00, and the error falls only like H3/2H^{3/2} for every one of the rules (the widget’s last integrand).

Check yourself Enter a number

Simpson’s rule with a single panel for ∫01dx1+x2\int_0^1\frac{dx}{1+x^2} gives what value?

Why

16{f(0)+4f(12)+f(1)}=16(1+3.2+0.5)=0.78333\tfrac16\{f(0) + 4f(\tfrac12) + f(1)\} = \tfrac16(1 + 3.2 + 0.5) = 0.78333. The true value is 0.785400.78540.

Hardy’s language

In practice again we divide the range of integration into pieces and apply the rule to each.

— G. H. Hardy, §169

Summary

Summary
  • Trapezium: ∫abf=12(b−a){f(a)+f(b)}−112(b−a)3f′′(ξ)\int_a^b f = \tfrac12(b-a)\{f(a)+f(b)\} - \tfrac1{12}(b-a)^3f''(\xi); exact for linear ff.
  • Simpson: ∫abf=16(b−a){f(a)+4f(a+b2)+f(b)}−12880(b−a)5f(4)(ξ)\int_a^b f = \tfrac16(b-a)\{f(a)+4f(\tfrac{a+b}2)+f(b)\} - \tfrac1{2880}(b-a)^5f^{(4)}(\xi); exact for cubics.
  • The proof: the error on [c−t,c+t][c-t, c+t] as a function of tt, corrected by a multiple of t5t^5, and Rolle’s theorem three times.
  • Composite rules: errors fall like H2H^2 and H4H^4; doubling the work gains factors 44 and 1616, but only for integrands with bounded derivatives of the relevant order.