Compose two polynomials
Syntax
r = polycompose(p,q)
Description
r = polycompose(p,q), returns the coefficients of the polynomial r (in MATLAB® polynomial form) that results from composing polynomial p with polynomial q(x), i.e., p(q(x)), where p and q are row vectors whose elements are the coefficients of the polynomials in MATLAB® polynomial form.
Examples
Example 1 − The shifted Legendre polynomials:
The so-called shifted Legendre polynomials (orthogonal on the interval ) can be defined by the polynomial composition , where are the standard Legendre polynomials (orthogonal on the interval ) and is the affine transformation , which bijectively maps the interval to the interval . The third-degree shifted Legendre polynomial, for example, can be computed by obtaining the standard third-degree Legendre polynomial,
p = polyLegendre(3)
defining the affine transformation in MATLAB® polynomial form,
q = [2,-1];
and then taking p composed with q, i.e.,
r = polycompose(p,q)
Note that, in general, the composition of polynomials is not commutative, i.e., polycompose(p,q) ≠ polycompose(q,p), as verified in this case by computing
s = polycompose(q,p)
Commutativity is attained only by particular functions as demonstrated in the next example.
Example 2 − A function composed with its inverse:
A function composed with its inverse is equal to x. Consider, for example, taking the composition of the function with its inverse , i.e.
r = polycompose([2 3],[1/2 -3/2])
which is equal to x. In this case, the composition of the functions is commutative, i.e.,
s = polycompose([1/2 -3/2],[2 3])
which is equal to r.
This function is part of……..