orthopolyprod

Product of orthogonal polynomials.


Syntax
   y = orthopolyprod(p, q, a, b, c)

Description
   y = orthopolyprod(p, q) returns the coefficients of product p*q, where
   p and q are both the vector of coefficients in orthogonal basis, i.e. 
   P(x) = p(1)*P_0(x) + ... + p(m+1)*P_m(x) and
   Q(t) = q(1)*P_0(x) + ... + q(n+1)*P_n(x).
   Then, the result will be the vector of coefficients y such that
   P(x)*Q(x) = f(1)*P_0(x) + ... + f(m+n+1)*P_{m+n+1}(x).

Inputs
   p = vector of coefficients in orthogonal basis.
   q = vector of coefficients in orthogonal basis.
   a, b and c =  are the coeficients related with three terms recurrece:
              xP_i = a(i)P_{i+1}+b(i)P_i+c(i)P_{i-1}, P_{-1} = 0, P_1 = 1.

Input (optional)
   order4trunc = order for truncate the result.

Output
   f = vector of coefficients in orthogonal basis (P(x)*Q(x)).

Example
   p = [7/4, 11/2, -7/4, -1/2]; q = p; 
   a = (1:8)./(2:4:30); b = ones(1, 8)/2; c = (0:7)./(2:4:30);
   orthopolyprod(p, q, a, b, c)

See also
  chebypolyprod and legpolyprod.