Given a function, f(x), tabulated at points equally spaced by such that
- …..and so on
The upper and lower limits a, b correspond to which the integral needs to be found, the task is to find the integral value of the given equation f(x).
Input: a = 0, b = 4,
Integral of (1 / (1 + x)) is 4ln(|1 + x|)0 + c.
On substituting the limits, ln(|5|) + ln(|1|) = 1.6178.
Input: a = 0.2, b = 0.6,
Approach: In this article, Boole’s rule is discussed to compute the approximate integral value of the given function f(x).
Boole’s rule is a numerical integration technique to find the approximate value of the integral. It is named after a largely self-taught mathematician, philosopher and logician George Boole. The idea of the Boole’s technique is to approximate the integral using the values of ‘fk‘ at some equally spaced values(h in the given image). The following illustration shows how various fk’s are considered:
The integral value of the Boole’s rule is given by the formula:
- In the above formula, an error term which comes when integration is of the order 6. The error term is .
- are the values of f(x) at their respective intervals of x.
- Therefore, the following steps can be followed to compute the integral of some function f(x) in the interval (a, b):
- The value of n=6, which is the number of parts the interval is divided into.
- Calculate the width, h = (b – a)/4.
- Calculate the values of x1 to x5 as
Consider y = f(x). Now find the values of for the corresponding values.
- Substitute all the values in the Boole’s rule to calculate the integral value.
Below is the implementation of the above approach:
f(x) = 1.6178
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Trapezoidal Rule for Approximate Value of Definite Integral
- Finding Integreand using Weedle's Rule
- Find integral points with minimum distance from given set of integers using BFS
- Find the integral roots of a given Cubic equation
- Program for Simpson's 1/3 Rule
- Program to implement Simpson's 3/8 rule
- System of Linear Equations in three variables using Cramer's Rule
- Count Integral points inside a Triangle
- Number of Integral Points between Two Points
- Number of non-negative integral solutions of a + b + c = n
- Number of integral solutions of the equation x1 + x2 +.... + xN = k
- Number of non-negative integral solutions of sum equation
- Number of integral solutions for equation x = b*(sumofdigits(x)^a)+c
- Count of integral coordinates that lies inside a Square
- Probability that an arbitrary positive divisor of 10^X is an integral multiple of 10^Y
- Find initial integral solution of Linear Diophantine equation if finite solution exists
- Generate all integral points lying inside a rectangle
- Finding LCM of more than two (or array) numbers without using GCD
- Finding number of days between two dates using StringStream
- Finding Median of unsorted Array in linear time using C++ STL
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.