 # Simpson's Rule Formula

## Simpson’s Rule Formula

Simpson’s rule is used for approximating the integral using quadratic polynomials where parabolic arcs are present in place of straight line segments used in trapezoidal rule. For approximating the polynomials up to cubic degrees, Simpson’s rule gives the definite result. We do have trapezoidal formula that would take the shape under a curve and find out the area of those area. However to make it more precise and better approximation, Simpson’s rule came to rescue. Through Simpson’s rule parabolas are used to find parts of curve.

The approximate area under the curve are given by the following formula:

Simpson’s one-third rule formula is:

$$\begin{array}{l}\large \int_{a}^{b}f(x)dx=\frac{h}{3}[(y_{0}+y_{n})+4(y_{1}+y_{3}+….+y_{n-1})+2(y_{2}+y_{4}+…+y_{n-2})]\end{array}$$

Simpson’s three-eighths rule formula is:

$$\begin{array}{l}\large \int_{a}^{b}f(x)dx=\frac{3h}{8}[(y_{0}+y_{n})+(y_{1}+y_{2}+y_{4}+….+y_{n-1})+2(y_{3}+y_{6}+…+y_{n-3})]\end{array}$$

### Solved example

Question: Calculate the integral of the function f(x) = 2x in the interval (0, 2)?

Solution:

Given,

A = 0

B = 2

Let n = 6

$$\begin{array}{l}h=\frac{b-a}{n}=\frac{2-0}{6}=\frac{1}{3}\end{array}$$
$$\begin{array}{l}x_{0}=a=0\end{array}$$
$$\begin{array}{l}x_{1}=x_{0}+h=0=\frac{1}{3}=\frac{1}{3}\end{array}$$
$$\begin{array}{l}x_{1}+h=\frac{1}{3}+\frac{1}{3}=\frac{2}{3}\end{array}$$
$$\begin{array}{l}x_{2}+h=\frac{2}{3}+\frac{1}{3}=\frac{3}{3}=1\end{array}$$
$$\begin{array}{l}x_{3}+h=\frac{3}{3}+\frac{1}{3}=\frac{4}{3}\end{array}$$
$$\begin{array}{l}x_{4}+h=\frac{4}{3}+\frac{1}{3}=\frac{5}{3}\end{array}$$
$$\begin{array}{l}x_{5}+h=\frac{5}{3}+\frac{1}{3}=\frac{6}{3}=2\end{array}$$
$$\begin{array}{l}x_{6}+h=\frac{6}{3}+\frac{1}{3}=1\end{array}$$
$$\begin{array}{l}x_{7}=b=1\end{array}$$
$$\begin{array}{l}y_{0}=f(0)=2(0)=0\end{array}$$
$$\begin{array}{l}y_{1}=2(\frac{1}{3})=\frac{2}{3}\end{array}$$
$$\begin{array}{l}y_{2}=2(\frac{2}{3})=\frac{4}{3}\end{array}$$
$$\begin{array}{l}y_{3}=2(\frac{3}{3})=2\end{array}$$
$$\begin{array}{l}y_{4}=2(\frac{4}{3})=\frac{8}{3}\end{array}$$
$$\begin{array}{l}y_{5}=2(\frac{5}{3})=\frac{10}{3}\end{array}$$
$$\begin{array}{l}y_{6}=2(\frac{6}{3})=4\end{array}$$

According to the formula

$$\begin{array}{l}\int_{a}^{b}f(x)dx=\frac{h}{3}[(y_{0}+y_{n})+4(y_{1}+y_{3}+….+y_{n-1})+2(y_{2}+y_{4}+…+y_{n-2})]\end{array}$$
$$\begin{array}{l}f(x)dx=\frac{\frac{1}{3}}{3}[(0+4)+4(\frac{2}{3}+2+\frac{10}{3})+2(\frac{4}{3}+\frac{8}{3}+4)]\end{array}$$

=1/9[4 + 24 + 16]

=44/9

= 4.89