Trapezoidal Rule

The Trapezoidal Rule approximates definite integrals by summing trapezoid areas, useful when exact antiderivatives are difficult or impossible to find.

abf(x)dxΔx2[f0+2f1++2fn1+fn]\int_a^b f(x)\,dx \approx \frac{\Delta x}{2}\big[f_0 + 2f_1 + \cdots + 2f_{n-1} + f_n\big]

Solve a problem with Trapezoidal Rule

Type the problem. The solver will use Trapezoidal Rule where Trapezoidal Rule is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Trapezoidal Rule takes
ff
aa
bb
nn
xx
Trapezoidal Rule
SymbolMeaning
ffThe function being integrated; if you use the wrong function, the Trapezoidal Rule approximates the integral of the wrong problem.
aaThe lower bound of the integration interval; aa must be less than bb, and swapping aa and bb negates your answer.
bbThe upper bound of the integration interval; bb must be greater than aa, and changing bb changes which slice of the curve you are measuring.
nnThe number of subintervals (trapezoids) used in the approximation; larger nn gives better accuracy, but too small nn means your approximation is very coarse.
xxThe variable of integration (the independent variable); if you confuse xx with nn or integrate with respect to the wrong variable, the formula loses its meaning.

When to use it

Use the Trapezoidal Rule when you need to approximate a definite integral but cannot find an exact antiderivative or your function is defined only by data points.

Level

Usually taught in: Calculus I

Worked examples

1. Approximate a simple linear function with clean integers

Problem

Approximate 04(2x+1)dx\int_0^4 (2x+1) \, dx using the Trapezoidal Rule with n=4n = 4 subintervals.
  1. Δx=404=1\Delta x = \frac{4-0}{4} = 1

    Calculate the width of each subinterval using Δx=ban\Delta x = \frac{b-a}{n}.

  2. f(0)=1,f(1)=3,f(2)=5,f(3)=7,f(4)=9f(0) = 1, f(1) = 3, f(2) = 5, f(3) = 7, f(4) = 9

    Evaluate f(x)=2x+1f(x) = 2x+1 at each of the five endpoints.

  3. 12[1+2(3)+2(5)+2(7)+9]\frac{1}{2}[1 + 2(3) + 2(5) + 2(7) + 9]

    Substitute into the Trapezoidal Rule formula with endpoint coefficients of 1 and interior coefficients of 2.

  4. 12[1+6+10+14+9]=12(40)=20\frac{1}{2}[1 + 6 + 10 + 14 + 9] = \frac{1}{2}(40) = 20

    Add the terms in brackets, then multiply by 12\frac{1}{2}.

Answer: 2020

This is a linear function, so the Trapezoidal Rule gives the exact answer. We can verify: the exact integral is 04(2x+1)dx=[x2+x]04=200=20\int_0^4 (2x+1) \, dx = [x^2 + x]_0^4 = 20 - 0 = 20.

2. Approximate a quadratic with fractional intervals

Problem

Approximate 13x2dx\int_1^3 x^2 \, dx using the Trapezoidal Rule with n=4n = 4 subintervals.
  1. Δx=314=12\Delta x = \frac{3-1}{4} = \frac{1}{2}

    Calculate the width of each subinterval.

  2. f(1)=1,f(1.5)=2.25,f(2)=4,f(2.5)=6.25,f(3)=9f(1) = 1, f(1.5) = 2.25, f(2) = 4, f(2.5) = 6.25, f(3) = 9

    Evaluate f(x)=x2f(x) = x^2 at the five points: 1,1.5,2,2.5,31, 1.5, 2, 2.5, 3.

  3. 1/22[1+2(2.25)+2(4)+2(6.25)+9]\frac{1/2}{2}[1 + 2(2.25) + 2(4) + 2(6.25) + 9]

    Substitute into the Trapezoidal Rule formula with Δx=12\Delta x = \frac{1}{2}.

  4. 14[1+4.5+8+12.5+9]=14(35)=8.75\frac{1}{4}[1 + 4.5 + 8 + 12.5 + 9] = \frac{1}{4}(35) = 8.75

    Simplify by adding the bracketed terms, then divide by 4.

Answer: 354 or 8.75\frac{35}{4} \text{ or } 8.75

The exact value is [x33]13=913=2638.67[\frac{x^3}{3}]_1^3 = 9 - \frac{1}{3} = \frac{26}{3} \approx 8.67. Our approximation of 8.758.75 is slightly high because the parabola is concave up; the trapezoids overestimate the area.

3. Temperature data from a cooling experiment

Problem

A laboratory measures the temperature (in °C) of a cooling liquid at hourly intervals over 4 hours. The readings are: T(0)=80T(0) = 80, T(1)=65T(1) = 65, T(2)=55T(2) = 55, T(3)=48T(3) = 48, T(4)=45T(4) = 45. Approximate 04T(t)dt\int_0^4 T(t) \, dt, the total thermal energy released.
  1. Δt=1 hour\Delta t = 1 \text{ hour}

    The measurements are taken at equal hourly intervals, so Δt=1\Delta t = 1.

  2. T0=80,T1=65,T2=55,T3=48,T4=45T_0 = 80, T_1 = 65, T_2 = 55, T_3 = 48, T_4 = 45

    List the five temperature readings as given in the problem.

  3. 12[80+2(65)+2(55)+2(48)+45]\frac{1}{2}[80 + 2(65) + 2(55) + 2(48) + 45]

    Substitute the temperature values into the Trapezoidal Rule formula.

  4. 12[80+130+110+96+45]=12(461)=230.5\frac{1}{2}[80 + 130 + 110 + 96 + 45] = \frac{1}{2}(461) = 230.5

    Add the bracketed terms and multiply by 12\frac{1}{2}.

Answer: 230.5 °C⋅hours230.5 \text{ °C·hours}

With real experimental data, we cannot find an exact antiderivative, so the Trapezoidal Rule is the perfect tool. The result represents the area under the temperature curve, which is proportional to the total thermal energy dissipated over the 4-hour cooling period.

Common mistakes

Where Trapezoidal Rule usually goes wrong
Answer came out wrong
Using f0+f1+f2+f3+f4f_0 + f_1 + f_2 + f_3 + f_4 instead of f0+2f1+2f2+2f3+f4f_0 + 2f_1 + 2f_2 + 2f_3 + f_4 in the formula.
Always use the pattern: first and last terms get coefficient 1, all interior terms get coefficient 2.
Using Δx=ba\Delta x = b - a instead of Δx=ban\Delta x = \frac{b-a}{n} in the formula.
Always divide the total interval length by the number of subintervals: Δx=ban\Delta x = \frac{b-a}{n}.
Forgetting to divide by 2 at the end, computing Δx[f0+2f1+2f2+2f3+f4]\Delta x[f_0 + 2f_1 + 2f_2 + 2f_3 + f_4] instead of Δx2[f0+2f1+2f2+2f3+f4]\frac{\Delta x}{2}[f_0 + 2f_1 + 2f_2 + 2f_3 + f_4].
Do not skip the factor 12\frac{1}{2} in front; it is essential to every Trapezoidal Rule problem.
The mistakeWhy it is wrongThe fix
Using f0+f1+f2+f3+f4f_0 + f_1 + f_2 + f_3 + f_4 instead of f0+2f1+2f2+2f3+f4f_0 + 2f_1 + 2f_2 + 2f_3 + f_4 in the formula.Each interior trapezoid shares edges with its neighbors, so the interior function values are counted twice (once for each adjacent trapezoid), while the endpoints are counted only once.Always use the pattern: first and last terms get coefficient 1, all interior terms get coefficient 2.
Using Δx=ba\Delta x = b - a instead of Δx=ban\Delta x = \frac{b-a}{n} in the formula.bab - a is the total width of the interval, but Δx\Delta x must be the width of each single subinterval; using the full width makes all function values contribute too much and inflates your answer.Always divide the total interval length by the number of subintervals: Δx=ban\Delta x = \frac{b-a}{n}.
Forgetting to divide by 2 at the end, computing Δx[f0+2f1+2f2+2f3+f4]\Delta x[f_0 + 2f_1 + 2f_2 + 2f_3 + f_4] instead of Δx2[f0+2f1+2f2+2f3+f4]\frac{\Delta x}{2}[f_0 + 2f_1 + 2f_2 + 2f_3 + f_4].The formula averages the two parallel sides (heights) of each trapezoid, and the division by 2 is part of the trapezoid area formula Area=12(b1+b2)×h\text{Area} = \frac{1}{2}(b_1 + b_2) \times h; omitting it gives you twice the correct answer.Do not skip the factor 12\frac{1}{2} in front; it is essential to every Trapezoidal Rule problem.

Tips and when to use something else

  • The more subintervals you use, the better your approximation — but you pay for it with more arithmetic. Start with n=4n = 4 or n=8n = 8 for a reasonable balance.
  • For linear functions like f(x)=ax+bf(x) = ax + b, the Trapezoidal Rule is exact because the trapezoids fit perfectly under the line.
  • If your function curves upward (concave up), the trapezoids overestimate the area; if it curves downward (concave down), they underestimate. This helps you judge whether your answer is reasonable.
  • When you cannot find an antiderivative or work with data points, the Trapezoidal Rule is ideal — but for smooth functions where higher accuracy matters, Simpson's Rule usually gives better results with the same effort.

Frequently asked questions

Is the Trapezoidal Rule exact?
No, not in general—it is an approximation. However, it is exact for linear functions because the trapezoids fit perfectly under the line. For curved functions, increasing nn makes the approximation better.
How do I know if my approximation is reasonable?
Check the concavity of your function. If ff is concave up, your answer should be larger than the exact integral; if concave down, it should be smaller. You can also try recomputing with a different nn and see if the answers are converging.
Can I use the Trapezoidal Rule if I only have data points?
Yes, that is one of its greatest strengths. If you have equally spaced measurements of a function (like hourly temperature readings), you can apply the formula directly without needing to know the function's formula.
Why does the formula divide by 2?
The division by 2 comes from trapezoid geometry: the area of a trapezoid is 12(b1+b2)×h\frac{1}{2}(b_1 + b_2) \times h, where b1b_1 and b2b_2 are the two parallel sides (the function heights at the endpoints). The Trapezoidal Rule sums these trapezoids, and the 12\frac{1}{2} factor accounts for averaging the heights.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18