I came across to this type of a question and I don't know how to solve it
let's say
f(x) = cosx and we are given x0 = 0, x1 = 0.6 and x2 = 0.9
In the question it is asked to construct interpolation polynomials of degree at most one and at most two.
The part I do not understand is that which points I am to choose out of these 3 points to construct a polynomial of degree 1. Thanks
$$f(x_0)=\cos(0)=1 \\ f(x_1)=\cos(0.6) \\ f(x_2)=\cos(0.9) $$
Now, it is easy to show that there exists a polynomial $g(x)=aX^2+bX+c$ which is not constant such that $$g(x_0)=f(x_0) \\ g(x_1)=f(x_1) \\ g(x_2)=f(x_2) \\$$
All you have to do to find $g$ is solve the following system for $a,b,c$ $$c=1 \\ a (0.6)^2+b(0.6)+c=\cos(0.6) \\ a (0.9)^2+b(0.9)+c=\cos(0.9) $$
This is what interpolation polynomial usually means.