Error Bound Calculator (Simpsons Rule)
Simpson’s rule approximates a definite integral with parabolas, but the answer is never exact. The error bound tells you how far off it can possibly be, from just three things: the interval, the number of subintervals, and the maximum of the fourth derivative. This calculator bounds the error for Simpson’s rule and for the trapezoidal rule, shows the step size and a plain accuracy assessment, and works backwards from any tolerance you set to the number of subintervals you need, rounding up to an even count for Simpson’s rule as the method requires.
Both tabs are pre-filled with the verified worked examples explained below, so you can click Calculate and watch a bound being built before entering your own interval and derivative maximum. What the calculator never asks for is the function itself: the bound depends on the derivative maximum K, not on the individual function values, and finding K remains your job, with the derivative hints built into the tool to help.
Error bound
Quick Answer
Simpson’s rule: |E| ≤ (b − a)5 × K ÷ (180 × n4), with K = max |f′′′′(x)| and n even. On [0, 2] with n = 4 and K = 24, the bound is 1.666667e-2 at step size h = 0.5, and a tolerance of 1e-6 requires n = 46. Trapezoidal rule: |E| ≤ (b − a)3 × K ÷ (12 × n2), with K = max |f′′(x)|. On [0, 2] with n = 10 and K = 4, the bound is 2.666667e-2 at h = 0.2.
How the calculation works
For Simpson’s rule the error bound is |E| ≤ (b − a)5 × K / (180 × n4), where K is the maximum of the absolute fourth derivative on [a, b] and n must be even. For the trapezoidal rule it is |E| ≤ (b − a)3 × K / (12 × n2), where K is the maximum of the absolute second derivative and n can be any positive count. These are the standard textbook bounds: the OpenStax calculus text states them in exactly this form, and they are the same formulas used when the reverse process, finding an antiderivative in closed form, is impossible and numerical integration has to carry the work, as it does in the antidifferentiation calculator problems where no elementary antiderivative exists.
The bound is a guarantee, not an estimate of the likely error: the true error cannot exceed it, provided K really is the maximum on the whole interval. The calculator also reports the step size h = (b − a) / n, because h is what you actually choose when you set up a numerical integration, and an accuracy assessment that translates the bound into words, from Excellent below 1e-10 through to Poor at 0.1 and above.
The tolerance solver inverts each formula. For Simpson’s rule: n ≥ ((b − a)5 × K / (180 × tolerance))1/4, rounded up, and then up again to the next even integer if the ceiling lands on an odd number. For the trapezoidal rule: n ≥ sqrt((b − a)3 × K / (12 × tolerance)), rounded up to the next whole number. The tool then recomputes the actual bound at the chosen n and reports it, so you can confirm the guarantee really does meet your tolerance instead of trusting the inversion blindly.
Worked examples, verified against the tool
Simpson’s rule. Take the interval [0, 2], n = 4 and K = 24, which is the fourth derivative of x4 and a standard classroom case. The bound is 25 × 24 / (180 × 44) = 768 / 46,080 = 1.666667e-2, with step size h = 2 / 4 = 0.50000000. The tool rates that Fair: a noticeable bound. Now add the pre-filled tolerance of 1e-6. The solver computes n ≥ 45.4488, rounds up to 46, the next even number, and confirms the actual bound at n = 46 is 9.529221e-7, inside the tolerance. Notice how much work the fourth power does: multiplying n by more than eleven shrank the bound by a factor of about 17,500.
Trapezoidal rule. On the same interval [0, 2], with n = 10 and K = 4, the bound is 23 × 4 / (12 × 102) = 32 / 1,200 = 2.666667e-2, with h = 0.20000000. With the pre-filled tolerance of 1e-4, the solver finds n ≥ 163.2993, rounds up to 164, and confirms an actual bound of 9.914733e-5. The two examples side by side make the practical point of this page: for the same interval, Simpson’s rule reached a tolerance a hundred times tighter with fewer than a third of the subintervals.
Key takeaways
1. The bound is only as honest as K: underestimate the derivative maximum and the guarantee is void, so round K up, never down.
2. Simpson’s rule converts subintervals into accuracy four times as fast per doubling: its bound falls by 16, the trapezoidal bound by 4.
3. Always read the recomputed bound at the solver’s n, not just the n itself: that figure is the guarantee you are actually claiming.
Simpson vs trapezoidal convergence
Doubling n cuts the Simpson bound by a factor of 16, because n appears to the fourth power in the denominator, but cuts the trapezoidal bound by only a factor of 4, because n appears squared. The table shows both worked examples as n doubles, using the values the formulas produce:
| Rule and setup | First n | Bound | Doubled n | Bound | Doubled again | Bound |
|---|---|---|---|---|---|---|
| Simpson, [0, 2], K = 24 | 4 | 1.666667e-2 | 8 | 1.041667e-3 | 16 | 6.510417e-5 |
| Trapezoidal, [0, 2], K = 4 | 10 | 2.666667e-2 | 20 | 6.666667e-3 | 40 | 1.666667e-3 |
The trade for that speed is a stronger smoothness demand. The Simpson bound needs the fourth derivative to exist and stay bounded on the whole interval; the trapezoidal bound needs only the second derivative. A function with a corner, a cusp or a singularity inside the interval can invalidate the Simpson guarantee while leaving the trapezoidal one intact, which is why this page keeps both rules instead of declaring a winner. These are also the bounds that sit underneath applied problems such as the area trapped between two curves in the area between two functions calculator and arc length approximations in the arc length calculator, where the integral often has no closed form and a defensible n is the whole question.
Finding the maximum derivative, K
K is the hardest input, and the one students most often get wrong. The process is mechanical: differentiate four times for Simpson’s rule, or twice for the trapezoidal rule, then find the largest absolute value of that derivative on [a, b]. For a monotone derivative the maximum sits at an endpoint. For oscillating derivatives such as sine and cosine it is bounded by the amplitude. For decreasing derivatives such as 1/x families it sits at the left endpoint. The function type selector in the calculator shows the pattern for five common families:
| Family | Fourth derivative pattern | Second derivative pattern |
|---|---|---|
| Polynomial xn | n(n − 1)(n − 2)(n − 3) xn − 4 | n(n − 1) xn − 2 |
| Exponential eax | a4 eax | a2 eax |
| Trigonometric sin x, cos x | Repeats the original function, so max |.| ≤ 1 | Negated original function, so max |.| ≤ 1 |
| Logarithmic ln x | −6 / x4 | −1 / x2 |
| Rational 1/x | 24 / x5 | 2 / x3 |
| Rational 1/x2 | 120 / x6 | 6 / x4 |
Two practical rules protect the guarantee. First, K must bound the derivative on the entire closed interval, including endpoints: checking only interior critical points misses endpoint maxima, which are the common case for the exponential and rational families. Second, when in doubt, overestimate K. The bound stays valid, just looser; an underestimated K produces a confident looking number that guarantees nothing. If your background is the derivative as a rate, the average slope calculator is a useful refresher on how slope behaviour over an interval relates to the derivative values K is built from.
What this calculator does not do
It does not evaluate your function, compute a Simpson or trapezoidal approximation, or find K for you: there is no function input at all, deliberately, because the bound formulas need only a, b, n and K. It does not handle the midpoint rule, whose bound uses the same second derivative with a denominator of 24 instead of 12. In trapezoidal mode it checks only that n is positive: it will accept a fractional entry such as 2.5 and apply the formula to it, even though a real partition needs a whole number of subintervals, so enter whole numbers there. And it treats the tolerance solver’s output as a starting n to verify: the recomputed bound it prints alongside is the figure to quote.
Frequently asked questions
Simpson’s rule fits a parabola through each consecutive pair of subintervals, using three points at a time. Pairs only tile the interval exactly when the number of subintervals is even, so the calculator rejects an odd n in Simpson mode and the tolerance solver always rounds its answer up to the next even number.
Simpson’s rule is exact for polynomials up to degree three, because a parabola can reproduce them perfectly. The first thing it cannot capture is the fourth derivative term in the Taylor expansion, so the worst case error is governed by the largest value of the absolute fourth derivative on the interval, which is the K you enter in Simpson mode.
Yes, usually much smaller. The bound assumes the fourth or second derivative sits at its maximum value everywhere on the interval, which is rarely true. Treat the bound as a guarantee you can defend, not as a prediction of the error you will actually get.
Use Simpson’s rule when the function has a bounded fourth derivative and you want fast convergence: doubling n divides its bound by 16. Use the trapezoidal rule when the function is only twice differentiable, when you only know the second derivative bound, or when you are checking work that was done with trapezoids. This calculator runs both so you can compare the guarantees on the same problem.
Differentiate the function the required number of times, four for Simpson and two for trapezoidal, then find the largest absolute value of that derivative on your interval. The function type selector above gives the derivative pattern for polynomial, exponential, trigonometric, logarithmic and rational families. If you are unsure, overestimate K: the bound stays valid, it just becomes more conservative.
No. It never evaluates your function and it does not return a Simpson or trapezoidal approximation. It works only from the interval, the subinterval count and your derivative bound K, and returns the error guarantee, the step size, an accuracy assessment and, if you give a tolerance, the number of subintervals needed to meet it.
It means the rule is exact for your function. If the fourth derivative is zero everywhere, the function is a polynomial of degree three or less and Simpson’s rule reproduces it perfectly. The same logic applies in trapezoidal mode when the second derivative is zero, which is a straight line function.
Add This Calculator to Your Website
Embed the live error bound calculator on your own site with this snippet. The embedded version stays in step with the tool on this page, including both rule tabs and the tolerance solver.
Powered by Calculator Zilo
References
- OpenStax, Calculus Volume 2, section 7.6 Numerical Integration, via LibreTexts: Numerical Integration: key equations for the trapezoidal and Simpson error bounds, stating the trapezoidal bound as M(b − a)3 / (12n2) and the Simpson bound as M(b − a)5 / (180n4), exactly as coded here.
- Stewart, Calculus, Approximate Integration (section 7.1 in the Stewart numbering used in the excerpt): Approximate Integration: Trapezoid Rule and Simpson’s Rule (PDF), including the error estimates and the worked example of choosing n to guarantee a stated accuracy.
- LibreTexts, Calculus II lecture notes (Simpson), section on Numerical Integration: Numerical Integration: theorems for the midpoint, trapezoidal and Simpson error bounds, an independent statement of the same two formulas and of the requirement that n be even for Simpson’s rule.
