InfyCalculator
➗

Definite Integral Calculator (Trapezoidal Rule)

Approximate the definite integral of a quadratic with the composite trapezoidal rule and compare it against the exact value.

a (x² term)
b (x term)
c (constant)
Lower limit x₀
Upper limit x₁
Number of sub-intervals n
Loading calculator…

How it works

∫ ≈ h·[ ½f(x₀) + f(x₁) + f(x₂) + … + f(xₙ₋₁) + ½f(xₙ) ] · h = (x₁ − x₀) / n

The trapezoidal rule approximates the area under a curve by joining consecutive points with straight lines and summing the resulting trapezoids. Its error shrinks with the square of the step size, so doubling n roughly quarters the error. Because this calculator integrates a quadratic, it can also show the exact value from the antiderivative, letting you see how close the estimate lands.

Worked example

For f(x) = x² on [0, 1] with n = 100, the exact integral is 1/3 ≈ 0.333333. The trapezoidal rule slightly overestimates concave-up curves, returning about 0.333350 — an error near 1.7e-5.

Sources: Trapezoidal rule — Wikipedia

Frequently asked questions

Why does the trapezoidal rule overestimate x²?

x² is concave up, so the straight chord of each trapezoid sits above the curve. Every trapezoid therefore adds a little extra area, making the estimate slightly larger than the true integral. For concave-down functions it underestimates instead.

How many sub-intervals should I use?

The error falls like 1/n², so 100 intervals is already accurate to about five decimals for smooth functions. Going to 1,000 mostly matters when the function changes curvature sharply.

Is Simpson's rule more accurate?

Yes — Simpson's rule fits parabolas instead of lines and integrates any quadratic or cubic exactly. The trapezoidal rule is simpler and more robust, which is why it is the standard first tool for numeric integration.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.