In numerical analysis, Simpson’s 1/3 rule is a method for numerical approximation of definite integrals. Specifically, it is the following approximation:
In Simpson’s 1/3 Rule, we use parabolas to approximate each part of the curve.We divide
the area into n equal segments of width Δx.
Simpson’s rule can be derived by approximating the integrand f (x) (in blue)
by the quadratic interpolant P(x) (in red).
In order to integrate any function f(x) in the interval (a, b), follow the steps given below:
1.Select a value for n, which is the number of parts the interval is divided into.
2.Calculate the width, h = (b-a)/n
3.Calculate the values of x0 to xn as x0 = a, x1 = x0 + h, …..xn-1 = xn-2 + h, xn = b.
Consider y = f(x). Now find the values of y(y0 to yn) for the corresponding x(x0 to xn) values.
4.Substitute all the above found values in the Simpson’s Rule Formula to calculate the integral value.
Approximate value of the integral can be given by Simpson’s Rule:
Note : In this rule, n must be EVEN.
It is used when it is very difficult to solve the given integral mathematically.
This rule gives approximation easily without actually knowing the integration rules.
Evaluate logx dx within limit 4 to 5.2. First we will divide interval into six equal parts as number of interval should be even. x : 4 4.2 4.4 4.6 4.8 5.0 5.2 logx : 1.38 1.43 1.48 1.52 1.56 1.60 1.64 Now we can calculate approximate value of integral using above formula: = h/3[( 1.38 + 1.64) + 4 * (1.43 + 1.52 + 1.60 ) +2 *(1.48 + 1.56)] = 1.84 Hence the approximation of above integral is 1.827 using Simpson's 1/3 rule.
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.
- Program to implement Simpson's 3/8 rule
- Program for finding the Integral of a given function using Boole's Rule
- Finding Integreand using Weedle's Rule
- Trapezoidal Rule for Approximate Value of Definite Integral
- System of Linear Equations in three variables using Cramer's Rule
- Program to find value of 1^k + 2^k + 3^k + ... + n^k
- C program to calculate the value of nPr
- Program to calculate value of nCr
- Program to compare m^n and n^m
- Program to add two polynomials
- Program to add two fractions
- Program for sum of cos(x) series
- Program for n-th even number
- Program for n-th odd number
- Program to find sum of 1 + x/2! + x^2/3! +...+x^n/(n+1)!
- Program to find the Depreciation of Value
- Program for Mobius Function | Set 2
- Program for Identity Matrix
- Program to add two integers of given base
- Program to find the sum of a Series (1*1) + (2*2) + (3*3) + (4*4) + (5*5) + ... + (n*n)
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.
Improved By : jit_t