Degree of Chebyshev polynomial off by one

According to Wikipedia pages Chebyshev polynomials and Chebyshev nodes a Chebyshev polynomial of the first kind of degree n has n roots.
However, in BarycentricInterpolation.jl I get:

using BarycentricInterpolation

nodes(Chebyshev1{2}())
3-element Vector{Float64}:
 -0.8660254037844386
  0.0
  0.8660254037844387

Which is one root more than I expected.
I observed the same for other degrees.

According to the first Wikipedia page:

T_2(x)=2x^2-1.

This should have two roots.

Am I missing or misinterpreting something?
@dawbarton and @stevengj could you comment on this?

I think in that package, the “degree” of the polynomial refers to the degree of the interpolant, not of the polynomial whose nodes you are using. With N+1 points you can interpolate a polynomial of degree N.

So, to interpolate a degree 2 polynomial, you need 3 points, which for Chebyshev1 you get from the roots of the degree-3 first-kind Chebyshev polynomial T_3(x) = 4x^3 - 3x, which has roots x=0 and x = \pm \sqrt{3}/2 \approx \pm 0.866\cdots.

2 Likes

This is somewhat confusing in the README which talks about N being the degree of the polynomial.
Maybe it can be updated to be more explicit about what N really refers to.

In short, it follows the conventions of the paper referenced at the start of the README (https://doi.org/10.1137/S0036144502417715). But yes, it should probably be clarified in the README.

1 Like

(post deleted by author)

Now fixed in the README.