2

Does anyone know how one can do this in maple? find Newton divided difference interpolation polynomial for the function cos2x the points {1, 0.6, 0.3, 0.1, 0}

1 Answers1

0

If this is homework then you could show what you've accomplished on your own already.

If you just need the result then you could try the Student:-NumericalAnalysis package. Eg,

L:=[0, 0.1, 0.3, 0.6, 1]:

p:=Student:-NumericalAnalysis:-PolynomialInterpolation(
               [seq([x,cos(2*x)], x in L)],
               method=newton):

Student:-NumericalAnalysis:-DividedDifferenceTable(p);

  [           1.              0              0             0             0]
  [                                                                       ]
  [ 0.9800665778  -0.1993342220              0             0             0]
  [                                                                       ]
  [ 0.8253356149  -0.7736548145   -1.914401975             0             0]
  [                                                                       ]
  [ 0.3623577545   -1.543259535   -1.539209441  0.6253208900             0]
  [                                                                       ]
  [-0.4161468365   -1.946261478  -0.5757170614   1.070547088  0.4452261980]


interpol:=Student:-NumericalAnalysis:-Interpolant(p,independentvar=x);

      interpol := 1. - 0.1993342220 x - 1.914401975 x (x - 0.1)

         + 0.6253208900 x (x - 0.1) (x - 0.3)

         + 0.4452261980 x (x - 0.1) (x - 0.3) (x - 0.6)

plots:-dualaxisplot(plot([cos(2*x),interpol],x=0..1),
                    plot([cos(2*x)-interpol],x=0..1,legend=`abs. error`));

Programming questions on Maple are often better asked on stackoverflow, unless your central question is about the mathematics behind the algorithm.

acer
  • 5,293