(*Simple polynomial interpolation*)

(*First,try something really simple that will surely work to demonstrate the basic concept*)

(*EXAMPLE I*)

(*3 points on a parabola,{x0,f(x0)},{x1,f(x1)},{x2,f(x2)}*)
(*f(x)=x^2 in this example*)
(*Don't forget to uncomment the appropriate part*)

(*Example I comment begin.Uncomment begin and end,comment out other examples*)

 data={{-1,1},{0,0},{1,1}}; 
(* data = {{ 0, -5}, {1, -3}, {-1, -15}, {2, 39}, {-2, -9}} ; *) 
plotdata=ListPlot[data,PlotLabel->"Data points",PlotStyle->{PointSize[Large],Red}];

Poly[x_]=InterpolatingPolynomial[data,x]


Print[]
Print[]

Print["Interpolating polynomial Pn =   " Poly[x]]
Print[]
Print[" Or, in simplified form, Pn = " Simplify[Poly[x]]]

Print[]

plotfit = Plot[Poly[x],{x,-2,2}, DisplayFunction->Identity];

Show[plotdata, plotfit, PlotRange -> All]