Hardy’s Rule is an extension of Newton–Cotes formulas. Consider a function, f(x), tabulated at points equally spaced by such that
Given the following inputs
1. A function , whose integrand has to be computed.
2. The upper and lower limits
Hardy’s rule can be derived by approximating the integrand f(x)
The task is to find the integrand of the function using Hardy’s Rule
upper limit, b = 6, lower limit a = 0 .
Hardy’s Rule is a numerical integration technique to find the approximate value of the integral.
are the values of f(x) at their respective intervals of x.
In order to integrate any function f(x) in the interval (a, b), follow the steps given below:
1.the value of n=6, which is the number of parts the interval is divided into.
2.Calculate the width, h = (b-a)/6
3.Calculate the values of x0 to x6 as
Consider y = f(x). Now find the values of for the corresponding values.
4. Substitute all the above-found values in the Hardy’s rule to calculate the integral value.
Below is the implementation of the above approach:
f(x) = 1.9500
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Header files in C/C++ and its uses
- Introduction of Statistics and its Types
- Shearing in 2D Graphics
- C program to append content of one text file to another
- NULL undeclared error in C/C++ and how to resolve it
- Trigonometric Functions in Latex
- Relational Operators in LaTeX
- Logic Notations in LaTeX
- Brackets in Latex
- Set Notations in LaTeX
- Maths Commands in LaTeX
- Geometry Notations in LaTeX
- Volume of solid of revolution
- Average of Cubes of first N natural numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.