Skip to content
Calcrivo

Trapezoidal Rule Calculator

Approximate a definite integral using the composite trapezoidal rule with n subintervals.

Inputs

Integrand using x.

Approximate integral

0.7462107961

Step size h

0.10000000

Step by step

  1. Values used

    f(x) = exp(-x^2); Lower bound (a) = 0; Upper bound (b) = 1; Subintervals (n) = 10

  2. Trapezoidal rule

    ∫[a,b]f(x)dx ≈ h·[f(x₀)/2 + f(x₁) + f(x₂) + ... + f(xₙ)/2]

  3. Approximate integral

    = 0.7462107961

  4. Step size h

    = 0.10000000

How it works

The composite trapezoidal rule approximates ∫f(x)dx by connecting adjacent points with straight lines and summing the trapezoid areas. Error is O(h²), making it less accurate than Simpson's rule but simpler and applicable with any number of subintervals.

Formula

Trapezoidal rule

∫[a,b]f(x)dx ≈ h·[f(x₀)/2 + f(x₁) + f(x₂) + ... + f(xₙ)/2]

h
(b-a)/n
n
Number of subintervals

Frequently Asked Questions

When is the trapezoidal rule preferred?

For periodic functions integrated over a full period, the trapezoidal rule can be exponentially accurate (superconvergence), outperforming even Simpson's rule.

How does error decrease with n?

Doubling n reduces error by a factor of 4 (quadratic convergence in n).

You might also need