HP Forums

Full Version: (49g 50g) Chebyshev U Polynomials
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This program returns the value of the nth Chebyshev U polynomial at x. Note that the built-in function TCHEBYCHEFF returns the nth Chebyshev T polynomial. Chebyshev T polynomials are also known as Chebyshev polynomials of the first kind, and the U polynomials as Chebyshev polynomials of the second kind. Note also that there are many spellings of Chebyshev!

To use the program, n should be on level 2 and should be an integer. x should be on level 1; if x is an integer the result will be an integer. If x PEVAL in line 6 is removed the program will return the coefficients of the nth polynomials as a list.


\<< SWAP I\->R
  IF DUP 1. >
  THEN \-> x n
    \<< { 1 } { 2 0 } 2. n
      START { 0 0 } ROT + OVER 2 * 0 + SWAP -
  ELSE 1. SAME { 2 * } { DROP 1 } IFTE
Reference URL's