#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · STEP BY STEP

Trapezoidal Rule Calculator: Numerical Integration With Every Step

Enter f(x), the limits and n strips to integrate with the trapezoidal rule.

  • 📐 Any n
  • 📋 Ordinates table
  • 🎯 Error shown

How to use the Trapezoidal Rule Calculator

  1. 1. Type f(x)Enter the function, for example 1/(1+x^2) or exp(-x^2).
  2. 2. Set a, b and nEnter the limits and the number of strips.
  3. 3. Read the integralSee h, the ordinates, the weighted sum and the final value.

The trapezoidal rule

Split [a, b] into n strips of width h = (b − a)/n and join neighbouring points with straight lines. The area under those trapeziums is

∫ ≈ (h/2)[y₀ + 2(y₁ + y₂ + … + yₙ₋₁) + yₙ]

The first and last ordinates have weight 1, every inside ordinate has weight 2. The rule works for any n, odd or even, and is exact for straight lines.

Worked example

Evaluate ∫₀¹ 1/(1 + x²) dx with n = 6, so h = 1/6. The ordinates are y₀ = 1, y₁ = 0.972973, y₂ = 0.9, y₃ = 0.8, y₄ = 0.692308, y₅ = 0.590164 and y₆ = 0.5.

Sum = 1 + 2(0.972973 + 0.9 + 0.8 + 0.692308 + 0.590164) + 0.5 = 9.410889. Multiply by h/2 = 1/12 to get 0.784241. The exact answer is π/4 = 0.785398, so the error is about 0.00116, much bigger than Simpson's rule with the same n.

How the error behaves

The trapezoidal rule's error falls like h², so doubling n cuts the error about four times. For curves that bend a lot, use more strips or switch to the Simpson's rule calculator, whose error falls like h⁴. The trapezoidal rule is still very good for periodic functions over a full period and for tabulated data with uneven curvature.

Frequently asked questions

Does n have to be even?

No. The trapezoidal rule works with any whole number of strips.

Why is my answer slightly too big or too small?

For a curve that bends downwards, trapeziums sit under the curve and underestimate; for one that bends upwards, they overestimate.

Can I use pi in the limits?

Yes. Type pi, pi/2 or 2*pi in the limit boxes.

Is this calculator free?

Yes. You enter your name and WhatsApp number once when you see your result, and other Uncodemy tools then open without the form.

More free tools

See all free tools