# # Numerical Mathematics and Computing, Fifth Edition # Ward Cheney & David Kincaid # Brooks/Cole Publ. Co. # (c) 2003 # # file: runge_fun # # This is the degree-8 interpolating polynomial for 1/(1+x^2) # on the interval [-5,5], using chebyshev nodes. with(linalg): x := evalf(vector(9, i-> 5.0*cos((i-1)*Pi/8.0))): y := evalf(vector(9, i->(1.0+x[i]^2)^(-1))): f := interp(x,y,t): plot1 := plot(f, t=-5..5): l := [[x[n], y[n]] $n=1..9]; plot2 := plot(l, t=-5..5, style = point, symbol= diamond, thickness = 3); plots [display]({plot1,plot2});