User:Egm6341.s11.team3/sub4

= 4.1 Verify the accuracy of Simpson's rule =

Given: a generic 3rd order polynomial

 * {| style="width:100%" border="0"

$$f(x) = p_3(x) = c_0 + c_1x + c_2x^2 + c_3x^3\ $$ $$(Eq.4.1.1) \ $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

with


 * {| style="width:100%" border="0"

$$c_0=1,\ c_1=3,\ c_2=-9,\ c_3=12$$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Find: approximate and exact solutions
$$I\ $$ the exact integration on $$[-2,\ 1] $$

$$I_2\ $$ the numerical integration using simple Simpson's rule on $$[-2,\ 1] $$

Solution

 * Exact solution


 * {| style="width:100%" border="0"

$$I=\int_{-2}^{1} f(x) = \int_{-2}^{1} (c_0 + c_1x + c_2x^2 + c_3x^3) dx= [c_0 x]_{-2}^{1}+\left[\frac{c_1}{2}x^2\right]_{-2}^{1}+\left[\frac{c_2}{3}x^3\right]_{-2}^{1}+\left[\frac{c_3}{4}x^4\right]_{-2}^{1}=-73.5\ $$ $$ (Eq.4.1.2) \ $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * Numerical solution:


 * {| style="width:100%" border="0"

$$f_0=f(-2)=c_0-2c_1+4c_2-8c_3=-137\ $$ $$ (Eq.4.1.3) \ $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$f_1=f(-0.5)=c_0-0.5c_1+0.25c_2-0.125c_3=-4.25\ $$ $$ (Eq.4.1.4) \ $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$f_0=f(1)=c_0+c_1+c_2+c_3=7\ $$ $$ (Eq.4.1.5) \ $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$h=\dfrac{1-(-2)}{2}=1.5\ $$ $$ (Eq.4.1.6) \ $$ Using simple Simpson's rule 
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$I_2=\dfrac{h}{3}(f_0+4f_1+f_2)=-73.5=I\ $$ $$ (Eq.4.1.7) \ $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Egm6341.s11.team3.ren 19:23, 1 March 2011 (UTC)