# How to write the shifted Chebyshev polynomials (the first kind) in mathematica?

Is it possible to write the shifted Chebyshev polynomials (the first kind) in Mathematica? The formula is:

$$P_n(x)=\sum_{k=0}^{\left\lfloor\tfrac{n}{2}\right\rfloor}(-1)^k 2^{n-2k-1}\frac{n}{n-k}\binom{n-k}{k}(2x-1)^{n-2k}$$

The output should be in a vector {..., ..., ..., ... etc.} Thanks!!

• By "vector", do you mean a vector of the first few polynomials? Apr 1, 2019 at 8:36
• yes please depend on n Apr 1, 2019 at 8:38

With[{m = 100},
ChebyshevT[Range[m], 2 x - 1] ==
Table[Sum[(-1)^k 2^(n - 2 k - 1) Binomial[n - k, k] (2 x - 1)^(n - 2 k) n/(n - k),
{k, 0, Quotient[n, 2]}], {n, m}] // Expand]
True


Comparing your formula with formula 22.3.6 in Abramowitz and Stegun, we find that all you need to do is

ChebyshevT[Range[0, m - 1], 2 x - 1]


if you need an entire pile of these shifted polynomials.

• Many thanks, put the output just word true not terms? I need few terms in vector depend on n, what about [n/2] is it greatest integer number? Apr 1, 2019 at 9:00
• The first snippet just shows that the simple expression is the same as your explicit sum. The second snippet is what you want for evaluation. Assign some positive integer to m and evaluate ChebyshevT[Range[0, m - 1], 2 x - 1] (e.g. ChebyshevT[Range[0, 100 - 1], 2 x - 1] to get a hundred of them). Apr 1, 2019 at 9:01
• Dear, 1) You mean I have to use ChebyshevT[Range[0, m - 1], 2 x - 1].?2) the first code With[{m = 100}, ChebyshevT[Range[m], 2 x - 1] == Table[Sum[(-1)^k 2^(n - 2 k - 1) Binomial[n - k, k] (2 x - 1)^(n - 2 k) n/(n - k), {k, 0, Quotient[n, 2]}], {n, m}] // Expand] for what then?3) [n/2] is it greatest integer number? Apr 1, 2019 at 9:09