- #1

confused_engineer

- 39

- 2

- TL;DR Summary
- I can't find a python function which provides me with the evaluation of a Chebishev polynomial of a concrete order at a concrete point

Hello everyone. I need to construct in python a function which returns the evaluation of a Chebishev polynomial of order k evaluated in x. I have tested the function chebval form these documents, but it doesn't provide what I look for, since I have tested the third one, 4t^3-3t and

does not return 4*(3)^3-3*3, but instead it returns 3. I have a code which does this but for Legendre polynomials, but I cannot reproduce it whith these because the recurrence relationship uses the last two terms, not the first two as Legendre's. The code is as follow.

So, if someone could tell me how to do this but with Chebishev's polynomials I would be most grateful.

Thanks for reading.

Python:

```
import numpy as np
import numpy.polynomial.chebyshev as cheb
gfg = cheb.chebval((3), (3))
```

Code:

```
import numpy as np
import numpy.polynomial.chebyshev as cheb
gfg = cheb.chebval((3), (3))
print(gfg)
x=5
K=2
pn2 = 2*(x)**K+3print(pn2)
```

So, if someone could tell me how to do this but with Chebishev's polynomials I would be most grateful.

Thanks for reading.

Last edited: