chder bug?


arghman
01-04-2006, 10:42 AM
Is there a bug in the derivative-of-chebyshev polynomials function chder in section 5.9?

The linear term appears to be off by a factor of 2.

If I put in a quadratic Chebyshev polynomial
p[0] = c, p[1] = b, p[2] = a
(meaning a*2*x*x-a + b*x + 1)

I get out
pd[0] = 2*b, pd[1] = 4*a, pd[2] = 0

The const. term of the derivative should be b, not 2b.

arghman
01-04-2006, 11:24 AM
similarly there appears to be a corresponding bug in chint;

if the input polynomial has c[0] = a, + other terms, the contribution of c[0] in the output appears to be a/2 in the linear term of the output.

(i'm using -1,1 as the ranges for a,b)

Bill Press
01-14-2006, 10:47 PM
Have a look at eqns. 5.8.8 and 5.8.9 in the book (2nd ed.).
You'll see that the coefficient c's in the Chebyshev
expansion are not quite just linear coefficients of Chebyshev
polynomials -- there's a correction to the constant term.
I think that's your problem.
Good luck!

Cheers,:)
Bill P.