Simpson Method of Integral Approximation
Simpsons rule is basically just a technique to calculate the approximate value of a definite integral. We will use parabolas for estimating the area of the graph in Simpsons rule.
simpson's 1/3 rule is proved to e most efficient method of integral approximation because it is generally more accuarta then other methods of numberical solutions. In In Simpson method, the approximation of integral equality will be exact if a function f(x) is polynomial upto third degree which is also called simpson's 1/3 rule.
Simpsons Rule Formula
So Simpsons rule says if you want to approximate an integral of a function f(x) in an interval from [a,b], simpsons rule formula will be:
$$ \int_a^b \; \approx \; \frac{Δx}{3} \left[ f(x_0) \;+\; 4f(x_1) \;+\; 2f(x_2) \;+\; 4f(x_3) \;+\; ... \;+\; 2f(x_{n-2}) \;+\; 4f(x_{n-1}) \;+\; f(x_n) \right] $$
Like the trapezoid rule or midpoint rule, Δx will be same as it is the width of the each sub-interval.
$$ Δx \;=\; \frac{b-a}{n} $$
For simpson method of approximation you have to use an even number of intervals.
According to the definition of Simpson's rule, what we need to know is just like the trapezoid rule: the first one and the last one are y-values that do not multiply by any number.
Remaining all of the y values in the middle, if you notice the sequence, these will alternatively be multiplied by 4 and 2 one by one until the last y- value takes place.
So Simpson’s rule is pretty easy to use in fact but the only thing tedious is just that these computations of y-values are gonna be pretty obnoxious in general.
Simpson's Rule Example
So let's do one little problem here for understanding how to estimate integral using the simpsons rule.
So let's approximate the definite integral in an interval from [0,3] having 6 rectangles.
$$ \int_0^3 \frac{1}{1+x^5} \; dx \;\;\; n=6 $$
So, first of all we have to calculate Δx, as we have an interval of [0,3] and also we know number of subintervals, so it will be:
$$ Δx \;=\; \frac{b-a}{n} \;=\; \frac{3-0}{6} \;=\; 0.5 $$
So Δx is 0.5. Now what I like to do is create a number line from A to B in our case 0 to 3 and Δx is 0.5, which represents that the width of each sub-interval it's going to be 0.5.
So those are the y-values points which we see in our number line, and also we will use it in Simpsons rule formula :
Since Simpsons rule is given as:
$$ \int_0^3 \frac{1}{1+x^5} \; dx \; \approx \; \frac{Δx}{3} \left[ f(x_0) \;+\; 4f(x_1) \;+\; 2f(x_2) \;+\; 4f(x_3) \;+\; ... \;+\; 2f(x_{n-2}) \;+\; 4f(x_{n-1}) \;+\; f(x_n) \right] $$
Here, Δx = 0.5, but we still have to work for y-values,
$$ \int_0^3 \frac{1}{1+x^5} \; dx \; \approx \; \frac{0.5}{3} \left[ f(0) \;+\; 4f(0.5) \;+\; 2f(1) \;+\; 4f(1.5) \;+\; 2f(2.0) \;+\; 4f(2.5) \;+\; f(3) \right] $$
So keep that in mind the first and the last one do not multiply by any number but the middle ones will be multiplied alternatively by 4 and 2 in simpson's rule example.
So let’s simplify it
Since f(x) = 1/(1+x5)
So we can get values of function at Simpson’s points in a number line.
f(0) = 1 , f(0.5) = 0.969696 , f(1) = 0.5 , f(1.5) = 0.116363 , f(2.0) = 0.0303030 , f(2.5) = 0.010136 & f(3.0) = 0.004098
Now it’s just solved here,
$$ \int_0^3 \frac{1}{1+x^5} \; dx \; \approx \; \frac{0.5}{3} \left[ f(0) \;+\; 4f(0.5) \;+\; 2f(1) \;+\; 4f(1.5) \;+\; 2f(2.0) \;+\; 4f(2.5) \;+\; f(3) \right] $$ $$ \int_0^3 \frac{1}{1+x^5} \; dx \; \approx \; (0.1667) \left[ 1 \;+\; 4(0.969696) \;+\; 2(0.5) \;+\; 4(0.116363) \;+\; 2(0.0303030) \;+\; 4(0.010136) \;+\; (0.004080) \right] $$ $$ \implies \int_0^3 \frac{1}{1+x^5} \; dx \; \approx \; 1.074915 $$
So, this is an approximate integral value of our function by using Simpson method of integration.
If we calculate it by evaluation of integrals method then the answer will 1.06588 which is very close to our estimation obtained by Simpson's rule i.e. 1.074915