Boole's rule
Boole's rule is a method of numerical integration in mathematics. It is named after George Boole.
Formula
Simple Boole's Rule
It approximates an integral:by using the values of at five equally spaced points:
It is expressed thus in Abramowitz and Stegun's Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables:
where the error term is
for some number between and where.
It is sometimes erroneously referred to as Bode's rule, due to a typographical error that propagated from Abramowitz and Stegun.
The following constitutes a very simple implementation of the method in Common Lisp which ignores the error term:
| Example implementation in Common Lisp |
"Calculates the Boole's rule numerical integral of the function F in the closed interval extending from inclusive X1 to inclusive X5 without error term inclusion." ) ) )))) |
Composite Boole's Rule
In cases where the integration is permitted to extend over equidistant sections of the interval, the composite Boole's rule might be applied. Given divisions, where mod, the integrated value amounts to:where the error term is similar to above. The following Common Lisp code implements the aforementioned formula:
| Example implementation in Common Lisp |
"Calculates the composite Boole's rule numerical integral of the function F in the closed interval extending from inclusive A to inclusive B across N subintervals." ) ) ) ))) )) by 2 sum )) by 4 sum )) by 4 sum ))))))) |
| Example implementation in R |
booleQuad <- function |