For the following function, let x0=0, x1=0.6, and x2=0.9. Construct interpolation polynomials of degree at most one and at most two to approximate f(0.45), and find the actual error.
f(x)=cosx
There are many ways of doing this, what methods have you been shown?
My personal favourite is to construct an orthonormal basis of polynomials up to degree $\displaystyle 2$ on the set $\displaystyle \{0,1,2\}$ with respect to an appropriate inner product and norm and then expand $\displaystyle \cos(x)$ in terms of these.
.