(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

##### 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 $\left( 1 - x\right) ^{a} \left( 1 + x\right) ^{b}$ on the interval [-1,1]. They satisfy the recurrence relation $$P\left( n, a, b, x\right) = \frac{2 n + a + b - 1}{2 n + a + b - 2} *$$ $$\frac{a ^{2} - b ^{2} + x \left( 2 n + a + b - 2\right) \left( n + a + b\right) }{2 n \left( n + a + b\right) } P\left( n - 1, a, b, x\right)$$ $$- \frac{\left( n + a - 1\right) \left( n + b - 1\right) \left( 2 n + a + b\right) }{n \left( n + a + b\right) \left( 2 n + a + b - 2\right) } P\left( n - 2, a, b, x\right)$$ for $n > 1$, with $P\left( 0, a, b, x\right) = 1$, $$P\left( 1, a, b, x\right) = \frac{a - b}{2} + x \left( 1 + \frac{a + b}{2} \right) .$$

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\left( n, x\right) = \left( 2 n - 1\right) \frac{x}{2 n} P\left( n - 1, x\right) - \frac{n - 1}{n} P\left( n - 2, x\right)$$ for $n > 1$, with $P\left( 0, x\right) = 1$, $P\left( 1, x\right) = 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

##### 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 \left( - \frac{x ^{2}}{2} \right)$ on the entire real axis. They satisfy the recurrence relation $$H\left( n, x\right) = 2 x H\left( n - 1, x\right) - 2 \left( n - 1\right) H\left( n - 2, x\right)$$ for $n > 1$, with $H\left( 0, x\right) = 1$, $H\left( 1, x\right) = 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

##### 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 $\left( 1 - x ^{2}\right) ^{a - \frac{1}{2} }$ on the interval [-1,1]. Hence they are connected to the Jacobi polynomials via $$G\left( n, a, x\right) = P\left( n, a - \frac{1}{2} , a - \frac{1}{2} , x\right) .$$ They satisfy the recurrence relation $$G\left( n, a, x\right) = 2 \left( 1 + \frac{a - 1}{n} \right) x G\left( n - 1, a, x\right)$$ $$- \left( 1 + 2 \frac{a - 2}{n} \right) G\left( n - 2, a, x\right)$$ for $n > 1$, with $G\left( 0, a, x\right) = 1$, $G\left( 1, a, x\right) = 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

##### 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 \left( - x\right)$ on the positive real axis. They satisfy the recurrence relation $$L\left( n, a, x\right) = \left( 2 + \frac{a - 1 - x}{n} \right) L\left( n - 1, a, x\right)$$ $$- \left( 1 - \frac{a - 1}{n} \right) L\left( n - 2, a, x\right)$$ for $n > 1$, with $L\left( 0, a, x\right) = 1$, $L\left( 1, a, x\right) = 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 .

### OrthoU -- Chebyshev polynomials

##### 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\left( n, x\right)$ and of the second kind $U\left( n, x\right)$, 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 $\left( 1 - x ^{2}\right) ^{ - \frac{1}{2} }$. Hence they are a special case of the Gegenbauer polynomials $G\left( n, a, x\right)$, with $a = 0$. They satisfy the recurrence relations $$T\left( n, x\right) = 2 x T\left( n - 1, x\right) - T\left( n - 2, x\right) ,$$ $$U\left( n, x\right) = 2 x U\left( n - 1, x\right) - U\left( n - 2, x\right)$$ for $n > 1$, with $T\left( 0, x\right) = 1$, $T\left( 1, x\right) = x$, $U\left( 0, x\right) = 1$, $U\left( 1, x\right) = 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 .

### OrthoUSum -- sums of series of orthogonal polynomials

##### 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

##### 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} = \left( A + B x\right) 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

##### 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 .