Método do Trapézio
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
trapézio
About this calculator
The Trapezoidal Rule calculator approximates the definite integral of a function f(x) between limits a and b. It divides the area under the curve into trapezoids instead of rectangles, using the formula (f(a)+f(b))/2 * h, where h = b - a. For greater accuracy, the interval can be split into subintervals, applying the composite rule.
Usage is simple: enter the function f(x), limits a and b, and the number of subintervals n. The calculator computes h = (b-a)/n and applies the composite trapezoidal rule: h/2 * [f(a) + 2*sum_{i=1}^{n-1} f(a+i*h) + f(b)]. The result is a numerical approximation of the integral.
Use this calculator when you need a quick estimate of the area under a curve, especially for functions without an elementary antiderivative. It is useful in engineering, physics, and economics for calculations of work, flux, or average value. For smooth functions, the method offers good accuracy with few subintervals.
Caution: the trapezoidal rule may underestimate or overestimate the integral if the function has sharp curvature. Increasing the number of subintervals improves accuracy but also increases computational cost. Ensure the function is continuous on the interval; discontinuities may invalidate the result.
Frequently asked questions
What is the difference between the simple and composite trapezoidal rule?
The simple rule uses a single trapezoid for the whole interval, resulting in lower accuracy. The composite rule divides the interval into several subintervals, applies the rule to each, and sums them, improving the approximation.
How many subintervals should I use for an accurate result?
It depends on the function. For smooth functions, 10 to 100 subintervals are usually enough. For rapidly varying functions, more may be needed. The calculator allows testing different values of n.
Does the trapezoidal rule work for discontinuous functions?
No, the method assumes the function is continuous on the interval. Discontinuities can invalidate the approximation. In such cases, split the interval at the discontinuity points and apply the method separately.
Can I use this calculator for improper integrals?
Not directly. Improper integrals require infinite limits or singular integrands. The trapezoidal rule requires finite limits and a continuous function. For improper integrals, use specific methods like transformations or limits.