# Thread: Integration - Simpsons Rule Problem

1. ## Integration - Simpsons Rule Problem

Hi again guys,

Working my way through some little problems and i'm totally baffled with this one.

Could anybody help me out with it? Give me some sort of idea what the graph will look like? - Are there any online graph plotting programmes?

2. Do you know how to calculate using Simpson's rule?.

Code:
                    endpoint           f(x)         mult.         result

0                      0                   3          1                3
1                     1/3                 1.65      4                6.605
2                     2/3                 1.235    2                 2.47
3                       1                  1.406    4                5.624
4                      4/3                1.986     2               3.972
5                      5/3                2.885     4               11.54
6                       2                  4.055     1               4.055
-----------
37.266

Use $\displaystyle \frac{b-a}{3n}=\frac{2-0}{3(6)}=\frac{1}{9}$

37.266/9=4.141

3. Originally Posted by c00ky
Hi again guys,

Working my way through some little problems and i'm totally baffled with this one.

Could anybody help me out with it? Give me some sort of idea what the graph will look like? - Are there any online graph plotting programmes?

The number of partition needs to be an even number in this case $\displaystyle n=6$. On the interval of $\displaystyle [2,0]$. Therefore, the size of each partition is,
$\displaystyle \Delta x=\frac{2-0}{6}=\frac{1}{3}$
Thus, by Homer's Rule,
$\displaystyle \int_0^2 x^2+3e^{-2x}dx\approx$$\displaystyle \frac{1}{3} [ f(0)+4f(\Delta x)+2f(2\Delta x)+$$\displaystyle 4f(3\Delta x)+2(4\Delta x)+4(5\Delta x)+f(2)]\Delta x$
Since,
$\displaystyle \Delta x=\frac{1}{3}$
We can write,
$\displaystyle \int_0^2 x^2+3e^{-2x}dx\approx$$\displaystyle \frac{1}{9} [ f(0)+4f(1/3)+2f(2/3)+$$\displaystyle 4f(3/3)+2(4/3)+4(5/3)+f(2)]$
Now, create a table of values,
$\displaystyle \left\{ \begin{array}{cc}x&x^2-3e^{-2x}\\ 0/3&3.0000\\ 1/3&1.6514\\ 2/3&1.2352\\ 3/3&1.4060\\ 4/3&1.9862\\ 5/3&2.8848\\ 6/3&4.0549$
Now substitute their values into your Homer's approximation,
$\displaystyle \frac{1}{9}( 3+4(1.6514)+$$\displaystyle 2(1.2352)+4(1.4060)+2(1.9862)+4(2.8848)+4.0549) Thus, calculate, \displaystyle \frac{1}{9}(3+6.6056+2.4704+5.624$$\displaystyle +3.9724+11.5392+4.0549)$
Again,
$\displaystyle \frac{1}{9}(37.2665)$
Again,
$\displaystyle \approx 4.141$
Now the actual value is,
$\displaystyle \int_0^2 x^2+3e^{-2x}dx=\frac{1}{3}x^3-\frac{3}{2}e^{-2x} \big|^2_0$
$\displaystyle =\frac{8}{3}+\frac{3}{2}e^{-4}+\frac{3}{2}e^0=4.1392....$

Note very accurate to the approximation.