Numerical Methods formula reference

Trapezoidal Rule

Approximates a definite integral with piecewise linear segments.

Open in editor
LaTeX\int_a^b f(x)dx\approx\frac{h}{2}\left[f(x_0)+2\sum_{i=1}^{n-1}f(x_i)+f(x_n)\right]

Variables

  • h=(b−a)/n: step width
  • x_i: grid point
  • n: number of subintervals

How to use this formula

Approximates a definite integral with piecewise linear segments.

Important notes

  • The composite rule assumes equal spacing.
  • Error decreases quadratically for sufficiently smooth functions.

Quick example

With one interval, the estimate is the trapezoid area (b−a)(f(a)+f(b))/2.

Applicability, worked calculation, and verification

Assumptions and domain checks

  • The composite rule assumes equal spacing.
  • For the Trapezoidal Rule, every denominator must be nonzero, and the numerator and denominator must remain correctly grouped.
  • For the Trapezoidal Rule, the index variable, lower bound, upper bound, and any empty-sum or empty-product convention must be clear.
  • Integration limits, the differential, and any constant of integration must be included where required.

Worked example

Input

Output

With one interval, the estimate is the trapezoid area (b−a)(f(a)+f(b))/2.

Common mistakes

  • When copying Trapezoidal Rule, keep the complete numerator and denominator grouped; a missing brace or parenthesis changes the result.
  • Do not report a numerical approximation without a tolerance, convergence check, and an estimate of rounding or truncation error.

Continue the workflow

Use Trapezoidal Rule in your own work

  1. Check the domainMatch the variables and assumptions to the problem before substituting values.
  2. Copy the exact notationPreserve grouping, signs, and exponents in \int_a^b f(x)dx\approx\frac{h}{2}\left[f(x_0)+2\sum_{i=1}^{n-1}f(x_i)+f(x_n)\right].
  3. Edit or convertOpen the expression in the LaTeX editor, then export it for your document or web page.

Review and verification

Last reviewed: 2026-07-23

Automated quality check: Kept noindex until the missing evidence is supplied.

Formula references

Frequently asked questions

What is the Trapezoidal Rule used for?

Approximates a definite integral with piecewise linear segments.

Can I copy this formula as LaTeX?

Yes. Copy \int_a^b f(x)dx\approx\frac{h}{2}\left[f(x_0)+2\sum_{i=1}^{n-1}f(x_i)+f(x_n)\right] or open it in the LaTeX editor.

What should I check before using it?

Confirm that each variable, unit, domain restriction, and assumption matches the problem.

Reuse, attribution, and correction

Share this reference without losing its source

Copy a citation, permanent link, Markdown link, or self-contained embed card. Each reusable format points readers back to the maintained canonical page.

Report an issue

Search the whole reference

Symbols, formulas, guides, tools and commands

Start typing to search.

move · Enter open · Esc close