Main Content

jacobiP

Jacobi polynomials

Description

example

jacobiP(n,a,b,x) returns the nth degree Jacobi polynomial with parameters a and b at x.

Examples

Find Jacobi Polynomials for Numeric and Symbolic Inputs

Find the Jacobi polynomial of degree 2 for numeric inputs.

jacobiP(2,0.5,-3,6)
ans =
    7.3438

Find the Jacobi polynomial for symbolic inputs.

syms n a b x
jacobiP(n,a,b,x)
ans =
jacobiP(n, a, b, x)

If the degree of the Jacobi polynomial is not specified, jacobiP cannot find the polynomial and returns the function call.

Specify the degree of the Jacobi polynomial as 1 to return the form of the polynomial.

J = jacobiP(1,a,b,x)
J =
a/2 - b/2 + x*(a/2 + b/2 + 1)

To find the numeric value of a Jacobi polynomial, call jacobiP with the numeric values directly. Do not substitute into the symbolic polynomial because the result can be inaccurate due to round-off. Test this by using subs to substitute into the symbolic polynomial, and compare the result with a numeric call.

J = jacobiP(300, -1/2, -1/2, x);
subs(J,x,vpa(1/2))
jacobiP(300, -1/2, -1/2, vpa(1/2))
ans =
101573673381249394050.64541318209
ans =
0.032559931334979678350422392588404

When subs is used to substitute into the symbolic polynomial, the numeric result is subject to round-off error. The direct numerical call to jacobiP is accurate.

Find Jacobi Polynomial with Vector and Matrix Inputs

Find the Jacobi polynomials of degrees 1 and 2 by setting n = [1 2] for a = 3 and b = 1.

syms x
jacobiP([1 2],3,1,x)
ans =
[ 3*x + 1, 7*x^2 + (7*x)/2 - 1/2]

jacobiP acts on n element-wise to return a vector with two entries.

If multiple inputs are specified as a vector, matrix, or multidimensional array, these inputs must be the same size. Find the Jacobi polynomials for a = [1 2;3 1], b = [2 2;1 3], n = 1 and x.

a = [1 2;3 1];
b = [2 2;1 3];
J = jacobiP(1,a,b,x)
J =
[ (5*x)/2 - 1/2,     3*x]
[       3*x + 1, 3*x - 1]

jacobiP acts element-wise on a and b to return a matrix of the same size as a and b.

Visualize Zeros of Jacobi Polynomials

Plot Jacobi polynomials of degree 1, 2, and 3 for a = 3, b = 3, and -1<x<1. To better view the plot, set axis limits by using axis.

syms x
fplot(jacobiP(1:3,3,3,x))
axis([-1 1 -2 2])
grid on

ylabel('P_n^{(\alpha,\beta)}(x)')
title('Zeros of Jacobi polynomials of degree=1,2,3 with a=3 and b=3');
legend('1','2','3','Location','best')

Figure contains an axes object. The axes object with title Zeros of Jacobi polynomials of degree=1,2,3 with a=3 and b=3 contains 3 objects of type functionline. These objects represent 1, 2, 3.

Prove Orthogonality of Jacobi Polynomials with Respect to Weight Function

The Jacobi polynomials P(n,a,b,x) are orthogonal with respect to the weight function (1x)a(1x)b on the interval [-1,1].

Prove P(3,a,b,x) and P(5,a,b,x) are orthogonal with respect to the weight function (1x)a(1x)b by integrating their product over the interval [-1,1], where a = 3.5 and b = 7.2.

syms x
a = 3.5;
b = 7.2;
P3 = jacobiP(3, a, b, x);
P5 = jacobiP(5, a, b, x);
w = (1-x)^a*(1+x)^b;
int(P3*P5*w, x, -1, 1)
ans =
0

Input Arguments

collapse all

Degree of Jacobi polynomial, specified as a nonnegative integer, or a vector, matrix, or multidimensional array of nonnegative integers, or a symbolic nonnegative integer, variable, vector, matrix, function, expression, or multidimensional array.

Input, specified as a number, vector, matrix, multidimensional array, or a symbolic number, vector, matrix, function, expression, or multidimensional array.

Input, specified as a number, vector, matrix, multidimensional array, or a symbolic number, vector, matrix, function, expression, or multidimensional array.

Evaluation point, specified as a number, vector, matrix, multidimensional array, or a symbolic number, vector, matrix, function, expression, or multidimensional array.

More About

collapse all

Jacobi Polynomials

  • The Jacobi polynomials are given by the recursion formula

    2ncnc2n2P(n,a,b,x)=c2n1(c2n2c2nx+a2b2)P(n1,a,b,x)2(n1+a)(n1+b)c2nP(n2,a,b,x),wherecn=n+a+bP(0,a,b,x)=1P(1,a,b,x)=ab2+(1+a+b2)x.

  • For fixed real a > -1 and b > -1, the Jacobi polynomials are orthogonal on the interval [-1,1] with respect to the weight function w(x)=(1x)a(1+x)b.

    11P(n,a,b,x)P(m,a,b,x)(1x)a(1+x)bdx={0if nm2a+b+12n+a+b+1Γ(n+a+1)Γ(n+b+1)Γ(n+a+b+1)n!if n=m.

  • For a = 0 and b = 0, the Jacobi polynomials P(n,0,0,x) reduce to the Legendre polynomials P(n, x).

  • The relation between Jacobi polynomials P(n,a,b,x) and Chebyshev polynomials of the first kind T(n,x) is

    T(n,x)=22n(n!)2(2n)!P(n,12,12,x).

  • The relation between Jacobi polynomials P(n,a,b,x) and Chebyshev polynomials of the second kind U(n,x) is

    U(n,x)=22nn!(n+1)!(2n+1)!P(n,12,12,x).

  • The relation between Jacobi polynomials P(n,a,b,x) and Gegenbauer polynomials G(n,a,x) is

    G(n,a,x)=Γ(a+12)Γ(n+2a)Γ(2a)Γ(n+a+12)P(n,a12,a12,x).

Introduced in R2014b