HW FIVE

  1. 5.1

    (a) By using methods we learned in class, we obtain the polynomial of degree two:

    $\displaystyle y(x)=\frac{x+x^2}{2}.$

    (b) Using Lagrange interpolation for the two subintervals, we obtain

    $\displaystyle y(x) =
\begin{bmatrix}x, & 0\le x\le 1,\\
2 x-1, & \le x\le 2\end{bmatrix}$     (35)

    (c) by repeating calculations that we have done in class, we obtain


    $\displaystyle s(x) =
\begin{bmatrix}\frac{3}{4}x+ \frac{x^3}{4} &  0\le x\le 1 \\
1+\frac{3}{2}(x-1) + \frac{3}{4}(x-1)^2 - \frac{1}{4}(x-1)^3
\end{bmatrix}.$     (36)

  2. (5.4)

    (a) Lagrange Polynomial is

    $\displaystyle f(x) = 10(x-2.3)(x-2.6) - 20 *(x-2.1)(x-2.6) + (26/3)(x-2.1)(x-2.3).$

    This gives, for $ x = 2.4$,

    $\displaystyle f(2.4) = 1.26.$

    (b) Lagrange Polynomial is

    $\displaystyle f(x) =
-(5/3)(x-0.1)x + 5 ( x+0.2)(x-0.1) + (200/3) x (x+0.2),
$

    which gives, for $ x=-0.1$

    $\displaystyle f(-0.1) = -0.6.$

    (c) Lagrange Polynomial is

    $\displaystyle f(x) = - (50/12)(x-1.1)(x-1.2) - (50/3)(x-0.8)(x-1.2) + 25(x-0.8)(x-1.1),$

    which gives for $ x=1$,

    $\displaystyle f(1) = \frac{1}{12}.$

  3. 5.26

    (a)

    Global polynomial interpolation is

    $\displaystyle y(x) = \frac{10}{3}x - 3 x^2 +\frac{2}{3}x^3.$

    Then

    $\displaystyle y(1/2) = 1b.$

    (b)

    Writting spline as

    $\displaystyle s_1(x) = a_1+b_1 x + c_1 x^2 + d_1 x^3$      
    $\displaystyle s_2(x) = a_2 + b_2 (x-1) + c_2 (x-1)^2 + d_2(x-1)^3$      
    $\displaystyle s_3(x) = a_3 + b_3 (x-2)+ c_3(x-2)^2 +d_3 (x-2)^3$      

    and follwoing steps we discussed in class, we obtain system of equations
    $\displaystyle a_1=0,     c_1=0$      
    $\displaystyle b_1+d+1=0,    a_2=1,   1+b_2 + c_2 + d+2 = 0$      
    $\displaystyle a_2 = 1, 1+ b_2 +c_2 + d_2= 0, a_3 = 0,$      
    $\displaystyle b_3+c_3+d_3 = 1 , b_1 + 3 d_1 =b_2, 6 d_1=2c_2 ,$      
    $\displaystyle b_2 + 2 c_2 + 3 d_2 = b_3, 2 c_2 + 6 d_2 = 2 c_3,$      
    $\displaystyle 2c_3 + 6 d_3 = 0.$      

    We solve this system of equation to finally obtain that
    $\displaystyle s_1(x) = \frac{5}{3} x+ \frac{2}{3} x^3,$      
    $\displaystyle s_2(x) = 1-\frac{1}{3} (x-1) -2 (x-1)^2+\frac{5}{3}(x-1)^3,$      
    $\displaystyle s_3(x) = -\frac{1}{3} (x-2)+ 2 (x-2)^2 -\frac{2}{3}(x-2)^3.$      

    We therefore obtain

    $\displaystyle s_1(\frac{1}{2}) = \frac{11}{12}.$

    c

    Result of part (a) does indeed satisfies interpolation and smoothness condition, but result in part (a) is not a natural spline

    (d)To obtain result in (a) one would have to use clamped spline with

    $\displaystyle s_1'(0) = \frac{10}{3}= s_3'(3).$