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

=Problem 2.10: Expression for {Ci}=

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

Given
Equations (2) and (3) on lecture slide [[media:nm1.s11.mtg10.djvu|10-2]]:


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



(10.1)
 * $$\displaystyle P_2 (x) = c_2x^2 + c_1x + c_0 $$
 * 
 * }
 * }


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



(10.2)
 * $$\displaystyle P_2 (x_i) = f(x_i) \, for \, i = 0, 1, 2 $$
 * 
 * }
 * }

Objectives
Use equations (10.1) and (10.2) to find an expression for {Ci} in terms of (xi,f(xi)) for i = 0, 1, 2.

Solution
From equation (4) on lecture slide [[media:nm1.s11.mtg10.djvu|10-2]] we know:


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



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

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


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



(10.4)
 * $$\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"



(10.5)
 * $$\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"



(10.6)
 * $$\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"



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

Using equation (10.3) we get:


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



(10.8)
 * $$\displaystyle P_2 (x) = \frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}f(x_0) + \frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)}f(x_1) + \frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)}f(x_2) $$
 * 
 * }
 * }

Combining terms of $$ x^2 $$  and  $$ x $$ we get:


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



(10.9)
 * $$\displaystyle P_2 (x) = \Big(\frac{f(x_0)}{(x_0-x_1)(x_0-x_2)} + \frac{f(x_1)}{(x_1-x_0)(x_1-x_2)} + \frac{f(x_2)}{(x_2-x_0)(x_2-x_1)}\Big)x^2 $$
 * 
 * }
 * }


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




 * $$\displaystyle - \Big(\frac{(x_1+x_2)f(x_0)}{(x_0-x_1)(x_0-x_2)} + \frac{(x_0+x_2)f(x_1)}{(x_1-x_0)(x_1-x_2)} + \frac{(x_0+x_1)f(x_2)}{(x_2-x_0)(x_2-x_1)}\Big)x $$


 * }
 * }


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




 * $$\displaystyle + \frac{(x_1x_2)f(x_0)}{(x_0-x_1)(x_0-x_2)} + \frac{(x_0x_2)f(x_1)}{(x_1-x_0)(x_1-x_2)} + \frac{(x_0x_1)f(x_2)}{(x_2-x_0)(x_2-x_1)} $$


 * }
 * }

After setting equation (10.1) equal to (10.9) we get:


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



(10.10)
 * $$\displaystyle C_2 = \frac{f(x_0)}{(x_0-x_1)(x_0-x_2)} + \frac{f(x_1)}{(x_1-x_0)(x_1-x_2)} + \frac{f(x_2)}{(x_2-x_0)(x_2-x_1)} $$
 * 
 * }
 * }


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



(10.11)
 * $$\displaystyle C_1 = - \Big(\frac{(x_1+x_2)f(x_0)}{(x_0-x_1)(x_0-x_2)} + \frac{(x_0+x_2)f(x_1)}{(x_1-x_0)(x_1-x_2)} + \frac{(x_0+x_1)f(x_2)}{(x_2-x_0)(x_2-x_1)}\Big) $$
 * 
 * }
 * }


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



(10.12)
 * $$\displaystyle C_0 = \frac{(x_1x_2)f(x_0)}{(x_0-x_1)(x_0-x_2)} + \frac{(x_0x_2)f(x_1)}{(x_1-x_0)(x_1-x_2)} + \frac{(x_0x_1)f(x_2)}{(x_2-x_0)(x_2-x_1)} $$
 * 
 * }
 * }