(* 
      This notebook illustrates the determination of the interpolating  *) 
 (* 
      polynomial from a set of data points for a function f[
          x]          *) 

f[x_] := 1/(1 + (x^2));

myplot1 = 
      Plot[f[x], {x, -5, 5}, PlotStyle -> Hue[0.3]]

points = Table[{-5  + i, f[-5 + i]}, {i, 0, 10}]

myplot = ListPlot[points, PlotStyle -> Hue[0]]

Show[myplot, myplot1]

poly := Fit[points, Table[(x^i), {i, 0, 10}], x]

poly

polyplot = 
      Plot[1.0000000000000062` - 
          9.288634919095806`*^-15 x - 0.6742081447963939` (x^2) + 
          1.2994730771455212`*^-14 (x^3) + 0.19737556561086675` (x^4) - 
          2.418589364613642`*^-15 (x^5) - 0.02441176470588344` (x^6) + 
          1.4462690133388053`*^-16 (x^7) + 0.0012669683257919206` (x^8) - 
          2.7423423158833`*^-18 (x^9) - 
          0.00002262443438914155` (x^10), {x, -5, 5}, 
        PlotStyle -> Hue[0.7]]

Show[myplot, myplot1, polyplot]

points = 
      Table[{5 Cos[(Pi/22) (1 + 2 i)], 
          f[5 Cos[(Pi/22) (1 + 2 i)]]}, {i, 0, 10}]

myplot = ListPlot[points, PlotStyle -> Hue[0]]

poly := Fit[points, Table[(x^i), {i, 0, 10}], x]

poly

polyplot = 
      Plot[0.9999999999999999` + 
          3.1679811389288397`*^-15 x - 0.4990604609713259` (x^2) - 
          1.1836804266466606`*^-15 (x^3) + 0.09830882974839011` (x^4) + 
          1.07123503213349`*^-16 (x^5) - 0.008540464354453207` (x^6) - 
          1.6090807277593554`*^-18 (x^7) + 0.00033307094700760827` (x^8) - 
          3.833935352686338`*^-20 (x^9) - 
          4.775210709786473`*^-6 (x^10), {x, -5, 5}, 
        PlotStyle -> Hue[0.7], PlotRange -> {0, 2}]

Show[myplot, myplot1, polyplot, PlotRange -> {0, 2}]