Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Trapezoidal rule
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Numerical integration method}} {{About|a rule for approximating integrals|the trapezoidal rule used for initial value problems|Trapezoidal rule (differential equations)|and|Heun's method}} [[File:Trapezoidal rule illustration.svg|right|thumb|The function ''f''(''x'') (in blue) is approximated by a linear function (in red).]] In [[calculus]], the '''trapezoidal rule''' (or '''trapezium rule''' in [[British English]]){{efn|See [[Trapezoid]] for more information on terminology.}} is a technique for [[numerical integration]], i.e., approximating the [[integral|definite integral]]: <math display="block">\int_a^b f(x) \, dx.</math> The trapezoidal rule works by approximating the region under the graph of the function <math>f(x)</math> as a [[trapezoid]] and calculating its area. It follows that <math display="block">\int_{a}^{b} f(x) \, dx \approx (b-a) \cdot \tfrac{1}{2}(f(a)+f(b)).</math> [[File:WikiTrap.gif|thumb|right|An animation that shows what the trapezoidal rule is and how the error in approximation decreases as the step size decreases]] The integral can be even better approximated by [[Partition of an interval|partitioning the integration interval]], applying the trapezoidal rule to each subinterval, and summing the results. In practice, this "chained" (or "composite") trapezoidal rule is usually what is meant by "integrating with the trapezoidal rule". Let <math>\{x_k\}</math> be a partition of <math>[a,b]</math> such that <math>a=x_0 < x_1 < \cdots < x_{N-1} < x_N = b</math> and <math>\Delta x_k</math> be the length of the <math>k</math>-th subinterval (that is, <math>\Delta x_k = x_k - x_{k-1}</math>), then <math display="block">\int_a^b f(x) \, dx \approx \sum_{k=1}^N \frac{f(x_{k-1}) + f(x_k)}{2} \Delta x_k.</math> The trapezoidal rule may be viewed as the result obtained by averaging the [[Riemann sum#Types of Riemann sums|left and right Riemann sums]], and is sometimes defined this way. The approximation becomes more accurate as the resolution of the partition increases (that is, for larger <math>N</math>, all <math>\Delta x_k</math> decrease). When the partition has a regular spacing, as is often the case, that is, when all the <math>\Delta x_k</math> have the same value <math>\Delta x,</math> the formula can be simplified for calculation efficiency by factoring <math>\Delta x</math> out:. <math display="block">\int_a^b f(x) \, dx \approx \Delta x \left(\frac{f(x_0) + f(x_N)} 2 + \sum_{k=1}^{n-1} f(x_k) \right).</math> As discussed below, it is also possible to place error bounds on the accuracy of the value of a definite integral estimated using a trapezoidal rule. [[File:Integration num trapezes notation.svg|thumb|Illustration of "chained trapezoidal rule" used on an irregularly-spaced partition of <math>[a,b]</math>.]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)