Special polynomials

(directly go to documentation on : OrthoP, OrthoH, OrthoG, OrthoL, OrthoT, OrthoU, OrthoPSum, OrthoHSum, OrthoLSum, OrthoGSum, OrthoTSum, OrthoUSum, OrthoPoly, OrthoPolySum. )

# 20. Special polynomials

OrthoP | Legendre and Jacobi orthogonal polynomials
OrthoH | Hermite orthogonal polynomials
OrthoG | Gegenbauer orthogonal polynomials
OrthoL | Laguerre orthogonal polynomials
OrthoT | Chebyshev polynomials
OrthoU | Chebyshev polynomials
OrthoPSum | sums of series of orthogonal polynomials
OrthoHSum | sums of series of orthogonal polynomials
OrthoLSum | sums of series of orthogonal polynomials
OrthoGSum | sums of series of orthogonal polynomials
OrthoTSum | sums of series of orthogonal polynomials
OrthoUSum | sums of series of orthogonal polynomials
OrthoPoly | internal function for constructing orthogonal polynomials
OrthoPolySum | internal function for computing series of orthogonal polynomials

###

OrthoP -- Legendre and Jacobi orthogonal polynomials

##### Standard library

##### Calling format:

    OrthoP(n, x);
    OrthoP(n, a, b, x);

##### Parameters:

`n` -- degree of polynomial

`x` -- point to evaluate polynomial at

`a`, `b` -- parameters for Jacobi polynomial

##### Description:

The first calling format with two arguments evaluates the Legendre polynomial of degree `n` at the point `x`. The second form does the same for the Jacobi polynomial with parameters `a` and `b`, which should be both greater than -1.

The Jacobi polynomials are orthogonal with respect to the weight function (1-x)^a*(1+x)^b on the interval [-1,1]. They satisfy the recurrence relation

P(n,a,b,x)=(2*n+a+b-1)/(2*n+a+b-2)*

(a^2-b^2+x*(2*n+a+b-2)*(n+a+b))/(2*n*(n+a+b))*P(n-1,a,b,x)

-((n+a-1)*(n+b-1)*(2*n+a+b))/(n*(n+a+b)*(2*n+a+b-2))*P(n-2,a,b,x)
for n>1, with P(0,a,b,x)=1,

P(1,a,b,x)=(a-b)/2+x*(1+(a+b)/2).

Legendre polynomials are a special case of Jacobi polynomials with the specific parameter values a=b=0. So they form an orthogonal system with respect to the weight function identically equal to 1 on the interval [-1,1], and they satisfy the recurrence relation

P(n,x)=(2*n-1)*x/(2*n)*P(n-1,x)-(n-1)/n*P(n-2,x)
for n>1, with P(0,x)=1, P(1,x)=x.

Most of the work is performed by the internal function `OrthoPoly`.

##### Examples:

    In> PrettyPrinter'Set("PrettyForm");

    True

    In> OrthoP(3, x);

        /      2     \
        | 5 * x    3 |
    x * | ------ - - |
        \   2      2 /

    In> OrthoP(3, 1, 2, x);

    1       /     / 21 * x   7 \   7 \
    - + x * | x * | ------ - - | - - |
    2       \     \   2      2 /   2 /

    In> Expand(%)

          3        2
    21 * x  - 7 * x  - 7 * x + 1
    ----------------------------
                 2

    In> OrthoP(3, 1, 2, 0.5);

    -0.8124999999

##### See also:

OrthoPSum , OrthoG , OrthoPoly .

###

OrthoH -- Hermite orthogonal polynomials

##### Standard library

##### Calling format:

    OrthoH(n, x);

##### Parameters:

`n` -- degree of polynomial

`x` -- point to evaluate polynomial at

##### Description:

This function evaluates the Hermite polynomial of degree `n` at the point `x`.

The Hermite polynomials are orthogonal with respect to the weight function Exp(-x^2/2) on the entire real axis. They satisfy the recurrence relation

H(n,x)=2*x*H(n-1,x)-2*(n-1)*H(n-2,x)
for n>1, with H(0,x)=1, H(1,x)=2*x.

Most of the work is performed by the internal function `OrthoPoly`.

##### Examples:

    In> OrthoH(3, x);
    Out> x*(8*x^2-12);
    In> OrthoH(6, 0.5);
    Out> 31;

##### See also:

OrthoHSum , OrthoPoly .

###

OrthoG -- Gegenbauer orthogonal polynomials

##### Standard library

##### Calling format:

    OrthoG(n, a, x);

##### Parameters:

`n` -- degree of polynomial

`a` -- parameter

`x` -- point to evaluate polynomial at

##### Description:

This function evaluates the Gegenbauer (or ultraspherical) polynomial with parameter `a` and degree `n` at the point `x`. The parameter `a` should be greater than -1/2.

The Gegenbauer polynomials are orthogonal with respect to the weight function (1-x^2)^(a-1/2) on the interval [-1,1]. Hence they are connected to the Jacobi polynomials via

G(n,a,x)=P(n,a-1/2,a-1/2,x).
They satisfy the recurrence relation

G(n,a,x)=2*(1+(a-1)/n)*x*G(n-1,a,x)

-(1+2*(a-2)/n)*G(n-2,a,x)
for n>1, with G(0,a,x)=1, G(1,a,x)=2*x.

Most of the work is performed by the internal function `OrthoPoly`.

##### Examples:

    In> OrthoG(5, 1, x);
    Out> x*((32*x^2-32)*x^2+6);
    In> OrthoG(5, 2, -0.5);
    Out> 2;

##### See also:

OrthoP , OrthoT , OrthoU , OrthoGSum , OrthoPoly .

###

OrthoL -- Laguerre orthogonal polynomials

##### Standard library

##### Calling format:

    OrthoL(n, a, x);

##### Parameters:

`n` -- degree of polynomial

`a` -- parameter

`x` -- point to evaluate polynomial at

##### Description:

This function evaluates the Laguerre polynomial with parameter `a` and degree `n` at the point `x`. The parameter `a` should be greater than -1.

The Laguerre polynomials are orthogonal with respect to the weight function x^a*Exp(-x) on the positive real axis. They satisfy the recurrence relation

L(n,a,x)=(2+(a-1-x)/n)*L(n-1,a,x)

-(1-(a-1)/n)*L(n-2,a,x)
for n>1, with L(0,a,x)=1, L(1,a,x)=a+1-x.

Most of the work is performed by the internal function `OrthoPoly`.

##### Examples:

    In> OrthoL(3, 1, x);
    Out> x*(x*(2-x/6)-6)+4;
    In> OrthoL(3, 1/2, 0.25);
    Out> 1.2005208334;

##### See also:

OrthoLSum , OrthoPoly .

###

OrthoT -- Chebyshev polynomials

###

OrthoU -- Chebyshev polynomials

##### Standard library

##### Calling format:

    OrthoT(n, x);
    OrthoU(n, x);

##### Parameters:

`n` -- degree of polynomial

`x` -- point to evaluate polynomial at

##### Description:

These functions evaluate the Chebyshev polynomials of the first kind T(n,x) and of the second kind U(n,x), of degree "n" at the point "x". (The name of this Russian mathematician is also sometimes spelled "Tschebyscheff".)

The Chebyshev polynomials are orthogonal with respect to the weight function (1-x^2)^(-1/2). Hence they are a special case of the Gegenbauer polynomials G(n,a,x), with a=0. They satisfy the recurrence relations

T(n,x)=2*x*T(n-1,x)-T(n-2,x),

U(n,x)=2*x*U(n-1,x)-U(n-2,x)
for n>1, with T(0,x)=1, T(1,x)=x, U(0,x)=1, U(1,x)=2*x.

##### Examples:

    In> OrthoT(3, x);
    Out> 2*x*(2*x^2-1)-x;
    In> OrthoT(10, 0.9);
    Out> -0.2007474688;
    In> OrthoU(3, x);
    Out> 4*x*(2*x^2-1);
    In> OrthoU(10, 0.9);
    Out> -2.2234571776;

##### See also:

OrthoG , OrthoTSum , OrthoUSum , OrthoPoly .

###

OrthoPSum -- sums of series of orthogonal polynomials

###

OrthoHSum -- sums of series of orthogonal polynomials

###

OrthoLSum -- sums of series of orthogonal polynomials

###

OrthoGSum -- sums of series of orthogonal polynomials

###

OrthoTSum -- sums of series of orthogonal polynomials

###

OrthoUSum -- sums of series of orthogonal polynomials

##### Standard library

##### Calling format:

    OrthoPSum(c, x);
    OrthoPSum(c, a, b, x);
    OrthoHSum(c, x);
    OrthoLSum(c, a, x);
    OrthoGSum(c, a, x);
    OrthoTSum(c, x);
    OrthoUSum(c, x);

##### Parameters:

`c` -- list of coefficients

`a`, `b` -- parameters of specific polynomials

`x` -- point to evaluate polynomial at

##### Description:

These functions evaluate the sum of series of orthogonal polynomials at the point `x`, with given list of coefficients `c` of the series and fixed polynomial parameters `a`, `b` (if applicable).

The list of coefficients starts with the lowest order, so that for example OrthoLSum(c, a, x) = c[1] L[0](a,x) + c[2] L[1](a,x) + ... + c[N] L[N-1](a,x).

See pages for specific orthogonal polynomials for more details on the parameters of the polynomials.

Most of the work is performed by the internal function `OrthoPolySum`. The individual polynomials entering the series are not computed, only the sum of the series.

##### Examples:

    In> Expand(OrthoPSum({1,0,0,1/7,1/8}, 3/2, \
      2/3, x));
    Out> (7068985*x^4)/3981312+(1648577*x^3)/995328+
    (-3502049*x^2)/4644864+(-4372969*x)/6967296
    +28292143/27869184;

##### See also:

OrthoP , OrthoG , OrthoH , OrthoL , OrthoT , OrthoU , OrthoPolySum .

###

OrthoPoly -- internal function for constructing orthogonal polynomials

##### Standard library

##### Calling format:

    OrthoPoly(name, n, par, x)

##### Parameters:

`name` -- string containing name of orthogonal family

`n` -- degree of the polynomial

`par` -- list of values for the parameters

`x` -- point to evaluate at

##### Description:

This function is used internally to construct orthogonal polynomials. It returns the `n`-th polynomial from the family `name` with parameters `par` at the point `x`.

All known families are stored in the association list returned by the function `KnownOrthoPoly()`. The name serves as key. At the moment the following names are known to Yacas: `"Jacobi"`, `"Gegenbauer"`, `"Laguerre"`, `"Hermite"`, `"Tscheb1"`, and `"Tscheb2"`. The value associated to the key is a pure function that takes two arguments: the order `n` and the extra parameters `p`, and returns a list of two lists: the first list contains the coefficients `A,B` of the n=1 polynomial, i.e. A+B*x; the second list contains the coefficients `A,B,C` in the recurrence relation, i.e. P[n]=(A+B*x)*P[n-1]+C*P[n-2]. (There are only 3 coefficients in the second list, because none of the polynomials use C+D*x instead of C in the recurrence relation. This is assumed in the implementation!)

If the argument `x` is numerical, the function `OrthoPolyNumeric` is called. Otherwise, the function `OrthoPolyCoeffs` computes a list of coefficients, and `EvaluateHornerScheme` converts this list into a polynomial expression.

##### See also:

OrthoP , OrthoG , OrthoH , OrthoL , OrthoT , OrthoU , OrthoPolySum .

###

OrthoPolySum -- internal function for computing series of orthogonal polynomials

##### Standard library

##### Calling format:

    OrthoPolySum(name, c, par, x)

##### Parameters:

`name` -- string containing name of orthogonal family

`c` -- list of coefficients

`par` -- list of values for the parameters

`x` -- point to evaluate at

##### Description:

This function is used internally to compute series of orthogonal polynomials. It is similar to the function `OrthoPoly` and returns the result of the summation of series of polynomials from the family `name` with parameters `par` at the point `x`, where `c` is the list of coefficients of the series.

The algorithm used to compute the series without first computing the individual polynomials is the Clenshaw-Smith recurrence scheme. (See the algorithms book for explanations.)

If the argument `x` is numerical, the function `OrthoPolySumNumeric` is called. Otherwise, the function `OrthoPolySumCoeffs` computes the list of coefficients of the resulting polynomial, and `EvaluateHornerScheme` converts this list into a polynomial expression.

##### See also:

OrthoPSum , OrthoGSum , OrthoHSum , OrthoLSum , OrthoTSum , OrthoUSum , OrthoPoly .