User:Egm6341.s11.team4.fields/HW2.11

=Problem 2.11: Simple Simpson's Rule Derivation=

Refer to lecture slides [[media:nm1.s11.mtg10.djvu|10-2 and 10-4]] for the problem statement.

Given
Equation (4) on lecture slide [[media:nm1.s11.mtg10.djvu|10-2]]:


 * {| style="width:70%" border="0" align="center"



(11.1)
 * $$\displaystyle P_2 (x) = \sum_{i=0}^{2} l_{i,2}(x) f(x_i)$$
 * 
 * }
 * }

Simple Simpson's Rule given in equations (2) and (3) on lecture slide [[media:nm1.s11.mtg7.djvu|7-4]]:


 * {| style="width:70%" border="0" align="center"



(11.2)
 * $$\displaystyle \int_a^bf(x)dx \approx I_2 = \int_a^bP_2(x)dx = \frac{h}{3}[f(x_0) + 4f(x_1) +f(x_2)]$$
 * 
 * }
 * }

Where:
 * {| style="width:70%" border="0" align="center"



(11.3)
 * $$\displaystyle h = \frac{b-a}{2}$$
 * 
 * }
 * }

And:
 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle x_0 = a$$


 * }
 * }


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle x_1 = \frac{a+b}{2}$$


 * }
 * }


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle x_2 = b$$


 * }
 * }

Objectives
Use equation (11.1) to derive the Simple Simpson's Rule (11.2).

Solution
From equation (2) on lecture slide [[media:nm1.s11.mtg9.djvu|9-2]]:


 * {| style="width:70%" border="0" align="center"



(11.4)
 * $$\displaystyle \int_a^bP_2(x)dx = \sum_{i=0}^{2} \int_a^bl_{i,2}(x)dx f(x_i)$$
 * 
 * }
 * }

From equation (1) on lecture slide [[media:nm1.s11.mtg9.djvu|9-2]]:


 * {| style="width:70%" border="0" align="center"



(11.5)
 * $$\displaystyle l_{i,2}(x) = \prod_{j=0,j \ne i}^{n=2}\frac{x-x_j}{x_i-x_j} $$
 * 
 * }
 * }

Now we solve for $$ l_{0,2}(x),$$  $$l_{1,2}(x)$$  and  $$l_{2,2}(x) $$


 * {| style="width:70%" border="0" align="center"



(11.6)
 * $$\displaystyle l_{0,2}(x) = \frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)} $$
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"



(11.7)
 * $$\displaystyle l_{1,2}(x) = \frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)} $$
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"



(11.8)
 * $$\displaystyle l_{2,2}(x) = \frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)} $$
 * 
 * }
 * }

Using Wolfram Alpha to solve the following integrals we get:

WA


 * {| style="width:70%" border="0" align="center"



(11.9)
 * $$\displaystyle \int_a^b l_{0,2}(x)dx = \int_{a}^{b} \frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}dx = \frac{b-a}{6}$$
 * 
 * }
 * }

WA


 * {| style="width:70%" border="0" align="center"



(11.10)
 * $$\displaystyle \int_a^b l_{1,2}(x)dx = \int_{a}^{b} \frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)}dx = -\frac{2}{3}(a-b)$$
 * 
 * }
 * }

WA


 * {| style="width:70%" border="0" align="center"



(11.11)
 * $$\displaystyle \int_a^b l_{2,2}(x)dx = \int_{a}^{b} \frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)}dx = \frac{b-a}{6}$$
 * 
 * }
 * }

Using Equation (11.4) and the results of equations (11.9), (11.10) and (11.11) we get:


 * {| style="width:70%" border="0" align="center"



(11.12)
 * $$\displaystyle \int_a^bP_2(x)dx = \frac{b-a}{6}f(x_0) + \frac{2}{3}(b-a)f(x_1) + \frac{b-a}{6}f(x_2)$$
 * 
 * }
 * }

Simplifying equation (11.12) leaves us with the Simple Simpson's Rule:


 * {| style="width:70%" border="0" align="center"



(11.13)
 * $$\displaystyle I_2 = \int_a^bP_2(x)dx = \frac{b-a}{6}[f(x_0) + 4f(x_1) +f(x_2)] = \frac{h}{3}[f(x_0) + 4f(x_1) +f(x_2)]$$
 * 
 * }
 * }

Where:
 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle h = \frac{b-a}{2}$$


 * }
 * }