Fitting the Runge Function

f(x)=1/(x2+1) on [-5, 5]


Case #1: Equally Spaced Points

The error at the ends gets worse and worse:

For degree 20 it is 58.3, by degree 25 it is 75.8, and by degree 28 it is over 1000!


Case #2: Unequally Spaced Points using Chebychev nodes -5*cos(iπ/n), i=0, 1, 2, ..., n