chebypolypow

Power of Chebyshev polynomials.


Syntax
   f = chebypolypow(p, n, order4trunc)

Description
   f = chebypolypow(p, n) is a recursive application of chebypolyprod 
   funtion, to compute sum(p_i*T_i)^n. If
   P(x) = p(1)*T_0(x) + ... + p(m+1)*T_m(x), 
   then the result will be the vector of coefficients y such that
   P(x)^n = f(1)*T_0(x) + ... + f(m+n+1)*T_{m+n+1}(x).
   T (Chebyshev of first kind) can be U (Chebyshev of second kind).

Inputs
   p           = vector of coefficients in Chebyshev basis.
   n           = power degree.
   order4trunc = order for truncate, if necessary.

Output
   f           = vector of coefficients in Chebyshev basis (P(x)^n).

Example
   chebypolyprod(chebypolyprod(chebypolyprod( ...
   [1 2 3], [1 2 3]), [1 2 3]), [1 2 3]) - chebypolypow([1 2 3], 4)
   The result must be zeros.