VOOZH about

URL: https://www.geeksforgeeks.org/dsa/trapezoidal-rule-for-approximate-value-of-definite-integral/

⇱ Trapezoidal Rule for Approximate Value of Definite Integral - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Trapezoidal Rule for Approximate Value of Definite Integral

Last Updated : 23 Jul, 2025

In the field of numerical analysis, Trapezoidal rule is used to find the approximation of a definite integral. The basic idea in Trapezoidal rule is to assume the region under the graph of the given function to be a trapezoid and calculate its area. 
It follows that:

For more accurate results the domain of the graph is divided into n segments of equal size as shown below: 

👁 trapezoidalrule2


Grid spacing or segment size h = (b-a) / n. 
Therefore, approximate value of the integral can be given by: 

Output: 

Value of integral is 0.7842


References:
https://en.wikipedia.org/wiki/Trapezoidal_rule


Comment
Article Tags:
Article Tags: