# Learn Simpson's Rule

learn Simpson's rule applications: .It is extremely difficult or even impossible to evaluate a definite integral `int_a^bf(x)dx` even if f is continuous on [ a, b ]. In such cases we take a set of numerical values of the integrand f in the interval [ a, b ] and evaluate the definite integral `int_a^bf(x)dx` approximately. This process of finding the approximate value of a definite integral is called Numerical Integration. If the integrand is a function of single variable, then this process is known as Quadrature.

In Numerical Integration, first we approximate the integrand f by a polynomial p and then find `int_a^bp(x)dx` . Then `int_a^bf(x)dx` is approximately equal to `int_a^bp(x)dx` . The absolute difference `| ` `int_a^bf(x)dx`  - `int_a^bp(x)dx`   `|` = `|` `int_a^b[ f(x) - p(x) ]dx` `|`

## Simpson's rule learn

Let P = { x0 = a,  x1 = x0 + h,  x2 = x0 + 2h, .................xn = x0 + nh = b } where h = ( b - a ) / n , be a partition of [ a, b ] dividing [ a, b ] into even number n of equal parts. Let y0, y1, y2................yn be the values of y = f ( x ) at x = x0, x1, x2, .................xn respectively.

Simpson's rule is given by

`int_a^bf(x)dx`      `~=` ( h / 3 ) [ ( y0 + yn ) + 4( y1 + y3 + ..............+ yn-1 ) + 2( y2 + y4 +................. + yn-2 ) ]

= ( h / 3 ) [ Sum of the first and last ordinates + 4(Sum of the ordinates whose suffixes are odd) + 2(Sum of the ordinates whose suffixes are even excluding the first and last ordinates) ]

This is known as the Simpson's one-third rule or simply Simpson's rule which is commonly used.

## Working rule for Simpson's one-third rule:-

• Note down a,b and n, observe that n is even
• Calculate h = ( b - a ) / n
• For x = a, a + h, a + 2h, .....................a + nh. compute the values y = f ( x ) and denote them by y0, y1, y2....................yn respectively.
• Write down Simpson's rule for the divisions specified in the question and substitute the values obtained in above step in the formula and simplify.

Example:-

Dividing [ 0, 6 ] into 6 equal parts, evaluate `int_0^6`  x3 dx approximately by using Simpson's rule.

Solution:- Since a = 0, b = 6 and n = 6

then h = ( b - a ) / n

h = ( 6 - 0 ) / 6

h = 1

Hence  P = { x0 = a = 0,  x1 = 1,  x2 = 2, x3 = 3, x4 = 4, x5 = 5, x6 = 6 }

Now we have to find the y =f ( x )

given that f ( x ) = x3

we have the following tables of values

 x 0 1 2 3 4 5 6 f ( x ) 0 1 8 27 64 125 216

`int_0^6` x3 dx = ( h / 3 ) [ ( y0 + y6 ) + 4( y1 + y3 + y5 ) + 2(y2 + y4) ]

= ( 1 / 3 ) [ ( 0 + 216 ) + 4 ( 1 + 27 + 125 ) + 2 ( 8 + 64 ) ]

= ( 1 / 3 ) [ 216 + 4(153) + 2(72) ]

= ( 1 / 3 ) [ 216 + 612 + 144 ]

= 324.

`:.` `int_0^6` x3 dx = 324.