MATH 661.FA23 Midterm Examination 2

Solve the problems for your appropriate course track. Problems probe understanding of the definitions and results from the module on function approximation through linear combination. Formulate your answers clearly, cogently, and include a concise description of your approach. Each question is meant to be completely answered within ten minutes. Allowed test time is 75 minutes.

1Track 1

  1. Construct the polynomial interpolant of data 𝒟={(-1,-6),(0,-1),(1,-2),(2,-3)} in Lagrange form.

    Solution. With 𝒙=[ -1 0 1 2 ]T, 𝒚=[ -6 -1 -2 -3 ]T, the cubic Lagrange polynomial interplant is

    p3(t)=k=14ykk(t),

    1(t)=(t-x2)(t-x3)(t-x4)(x1-x2)(x1-x3)(x1-x4)=t(t-1)(t-2)(-1)(-2)(-3) 2(t)=(t-x2)(t-x3)(t-x4)(x1-x2)(x1-x3)(x1-x4)=(t+1)t(t-1)(1)(-1)(-2) 3(t)=(t-x1)(t-x2)(t-x4)(x3-x1)(x3-x2)(x3-x4)=(t+1)t(t-2)(2)(1)(-1) 4(t)=(t-x1)(t-x2)(t-x3)(x4-x1)(x4-x2)(x4-x3)=(t+1)t(t-1)(3)(2)(1)

  2. Construct the Newton form of the polynomial interpolant of the above data set, presenting the table of divided differences.

    Solution. Table of divided differences

    i xi yi [yi,yi-1] [yi,yi-1,yi-2] [yi,yi-1,yi-2,yi-3] 1 -1 -6 - - - 2 0 -1 5 - - 3 1 -2 -1 -3 - 4 2 -3 -1 0 1 ,

    leads to Newton interpolant

    p3(t)=-6+5(t+1)-3(t+1)t+(t-1)(t+1)t.

    Verify: p3(-1)=-6,p3(0)=-1,p3(1)=-2,p3(2)=-3.?

  3. Efficiently evaluate the Newton form of the polynomial interpolant determined above at t=2, using Horner's scheme. Present a pseudo-code algorithm.

    Solution. For known divided differences 𝒅=[ y0 [y1,y0] .. [yn,..,y1,y0] ] on the diagonal of the table, an 𝒪(n) scheme is

    Algorithm

    Input: n,t,x,d

    p=dn+1

    for j=n downto 1

    p=p(t-xj)+dj

    end

    return p

  4. Replace the sampling points xi=-1+i, i=0,..,3 in the data set 𝒟 so as to minimize the interpolation error over the interval [-1,2].

    Solution. The error is minized for the Chebyshev points, i.e., roots of T4(z)=0, scaled to cover the interval [-1,2] by x(z)=32(z+1)-1. Roots of T4(θ)=cos(4θ)=0 are θj=π4(12+jπ), for j=0,1,2,3, with zj=cosθj, xj=32(zj+1)-1.

2Track 2

  1. Construct the Hermite interpolant of data 𝒟={(xi,yi=f(xi),yi'=f'(xi)),i=0,1}={(-1,-6,10),(0,-1,1)} in Newton form.

    Solution. The table of divided differences with repetitions

    i xi yi [yi,yi-1] [yi,yi-1,yi-2] [yi,yi-1,yi-2,yi-3] 0 -1 y0=-6 - - - 0 -1 -6 y0'=10 - - 1 0 y1=-1 5 -5 - 1 0 -1 y1'=1 -4 1 ,

    leads to the cubic polynomial

    p3(t)=-6+10(t+1)-5(t+1)2+(t+1)2t.

    Verify

    p3(-1)=-6,p3(0)=-6+10-5=-1,?
    p3'(t)=10-10(t+1)+(t+1)2+2(t+1)t,

    p3'(-1)=10,p3'(0)=10-10+1=1.?

  2. Construct the Hermite interpolant of the above data in the Lagrange form

    p(t)=i=0n[ai(t)yi+bi(t)yi'],

    where ai(xj)=δij, ai'(xj)=0, bi'(xj)=δij, bi(xj)=0.

    Solution. Repeat the divided difference table with symbols for function, derivative values

    i xi yi [yi,yi-1] [yi,yi-1,yi-2] [yi,yi-1,yi-2,yi-3] 0 -1 y0 - - - 0 -1 y0 y0' - - 1 0 y1 y1-y0 y1-y0-y0' - 1 0 y1 y1' y1'-(y1-y0) y1'-2(y1-y0)+y0' ,

    giving

    p3(t)=y0+y0'(t+1)+(y1-y0-y0')(t+1)2+(y1'-2(y1-y0)+y0')(t+1)2t.

    Gather terms

    p3(t)=[1-(t+1)2+2(t+1)2t]y0+[(t+1)2-2(t+1)2t]y1+[(t+1)-(t+1)2+(t+1)2t]y0'+(t+1)2ty1'.

    Identify and verify conditions

    a0(t)=(t+1)2(2t-1)+1, a0(-1)=1, a0(0)=0, ? a0'(t)=2(t+1)2+2(t+1)(2t-1), a0'(-1)=0, a0'(0)=0, ? a1(t)=(t+1)2(1-2t), a1(-1)=0, a1(0)=1, ? a1'(t)=2(t+1)(1-2t)-2(t+1)2, a1'(-1)=0, a1'(0)=0, ? b0(t)=t+1+(t-1)(t+1)2, b0(-1)=0, b0(0)=0, ? b0'(t)=1+(t+1)2+2(t2-1), b0'(-1)=1, b1'(0)=0, ? b1(t)=(t+1)2t, b1(-1)=0, b1(0)=0, ? b1'(t)=(t+1)2+2(t+1)t, b1'(-1)=0, b1'(0)=1 ?

  3. Present a spline interpolant S of data set 𝒟={(xi=ih,yi=f(xi)),i=0,..,n}, h=1/n, where the restriction of S to interval [xi-1,xi] is of the form

    Si(t)=ai+biet+cie-t.

    Solution. Impose interpolation conditions in function values

    Si(xi-1)=ai+bie(i-1)h+cie-(i-1)h=yi-1,i=1,2,..,n
    Si(xi)=ai+bieih+cie-ih=yi-1,i=1,2,..,n.

    The above specify 2n conditions for 3n parameters. Impose continuity of function derivative

    Si'(xi)=Si+1'(xi)bieih+cie-ih=bi+1eih+ci+1e-ih,i=1,2,,n-1,

    for a total of 3n-1 condition. One additional condition is required, e.g., S1'(x0)=S'(x1) or Sn'(xn)=Sn'(xn-1) (derivative extrapolation).

  4. Find the best inf-norm approximants of f:[0,π/2], f(t)=cost by polynomials of degree n=0,1,2.

    Solution. For n=0, f(t)p0(t)=a, f(t)-p0(t) is monotone on [0,π/2] and error extrema e0(t)=f(t)-p0(t) are obtained at endpoints of compact interval [0,π/2]. By equioscillation theorem, 1-a=aa=1/2.

    For n=1, error e1(t)=cost-at-b has two extrema 1-b,aπ/2+b at endpoints and a local extremum where e1'(ξ)=0-sinξ=aξ=-arcsina. Impose equioscillation conditions

    b-1=aπ/2+b=cosξ-aξ-b,

    giving a=-2/π and b=12[1-a2+aarcsina+1].

    For n=2, error e2(t)=cost-at2-bt-c has two extrema 1-c,-a(π/2)2-b(π/2)-c at endpoints. The local extremum condition e'(t)=-sint-2at-b=0 is satisfied at two roots ξ,η (consider best approximant of sint by a polynomial of degree 1 with similar solutions as that for cost). Apply equioscillation theorem

    1-c=a(π/2)2+b(π/2)+c=-(cosξ-aξ2-bξ-c)=cosη-aη2-bη-c.

    The above requires a numerical solution.