

The aim of this lab is to write a function to compute the coefficients for a Hermite polynomial interpolating function using divided differences and then to use the coefficients to compute the Hermite interpolating polynomial. The algorithm for the divided difference formulas for the Hermite polynomial coefficients is: INPUT X=(x0?,…,xn?),Y=(f(x0?),…,f(xn?)),YP=(f?(x0?),…,f?(xn?)) OUTPUT Qi,j?, the appropriate divided differences, where the Hermite interpolating polynomial is H2n+1?(x)=Q0,0?+i=1?2n+1?Qi,i?j=0?i?1?(z?zj?) and z2i?=xi?,z2i+1?=xi? for i=0,…,n STEP 1. For i=0,1,…n z2i?=xi?z2i+1?=xi?Q2i0?=f(xi?)Q2i+1,0?=f(xi?)Q2i+1?=f?(xi?)? If i?=0 then Q2,1?=z21??z2j?1?Q2i,0??Q2i?10?? End If End STEP 2. For i=2,3,…,2n+1 For j=2,3,…,i Qi,j?=zi??zi?j?Qi,?1??Qi?1,?1?? End End STEP 3. OUTPUT Qi,j? STOP
(1). Write a matlab routine called main.m that calls a function that you write to compute the generalized divided differences given above. (2). Use a Hermite polynomial to interpolate the function f(x)=e0.1x2 given below in tabular form, at the point x=1.25. Use H5?(1.25) with nodes x0?,x1?,x2? and H3?(1.25), with nodes x0?,x1?. (3). What is your estimate of the errors? Justify your answer. Find error bounds for these approximations.