LegendreP - Maple Help

LegendreP, LegendreQ

Legendre functions and associated Legendre functions of the first and second kinds

 Calling Sequence LegendreP(v, x) LegendreQ(v, x) LegendreP(v, u, x) LegendreQ(v, u, x)

Parameters

 v - algebraic expression (degree) u - algebraic expression (order) x - algebraic expression (argument)

Description

 • LegendreP(v, x) and LegendreP(v, u, x) are the Legendre and associated Legendre functions of the first kind. LegendreQ(v, x) and LegendreQ(v, u, x) are the Legendre and associated Legendre functions of the second kind. They satisfy the differential equation:

$\left(-{x}^{2}+1\right)y\mathrm{\text{'}\text{'}}-2xy\text{'}+\left(v\left(v+1\right)-\frac{{u}^{2}}{-{x}^{2}+1}\right)y=0$

 • The points 1, -1, and $\mathrm{\infty }$ are singularities of the equation (except in special cases) and ordinary branch points of the functions.
 • In standard references, the branch cuts are taken to be $\left(-\infty ,-1\right)$ and $\left(-1,1\right)$, and the values of the functions on the branch cut $\left(-1,1\right)$ are obtained by an averaging process (in order to obtain functions which are real valued on this interval).
 Rather than take this approach, Maple defines the default Legendre functions to be continuous from above onto the cuts, $\left(-\infty ,-1\right)$ and $\left(-1,1\right)$. However, alternative definitions of the Legendre functions are also available, which place the branch cuts as $\left(-\infty ,-1\right)$ and $\left(1,\infty \right)$; these functions are real valued on the interval $\left(-1,1\right)$. The selection between the two definitions for the Legendre functions is accomplished via assignment to the environment variable _EnvLegendreCut. If this environment variable is assigned the value $-1..1$, Maple provides the default behavior, which places a branch cut on the real line coincident with the interval $\left(-1,1\right)$. If this environment variable is assigned the value $1..\mathrm{\infty }$, Maple places branch cuts on the real line coincident with the intervals $\left(-\infty ,-1\right)$ and $\left(1,\infty \right)$.
 If _EnvLegendreCut is either not assigned or has the value $-1..1$, the LegendreP and LegendreQ functions have the following hypergeometric representation:
 > LegendreP(a,b,z) = convert( LegendreP(a,b,z), hypergeom);
 ${\mathrm{LegendreP}}{}\left({a}{,}{b}{,}{z}\right){=}\frac{{\left({z}{+}{1}\right)}^{\frac{{b}}{{2}}}{}{\mathrm{hypergeom}}{}\left(\left[{-}{a}{,}{a}{+}{1}\right]{,}\left[{1}{-}{b}\right]{,}\frac{{1}}{{2}}{-}\frac{{z}}{{2}}\right)}{{\left({z}{-}{1}\right)}^{\frac{{b}}{{2}}}{}{\mathrm{\Gamma }}{}\left({1}{-}{b}\right)}$ (1)
 > LegendreQ(a,b,z) = convert( LegendreQ(a,b,z), hypergeom);
 ${\mathrm{LegendreQ}}{}\left({a}{,}{b}{,}{z}\right){=}\frac{{{ⅇ}}^{{I}{}{b}{}{\mathrm{\pi }}}{}\sqrt{{\mathrm{\pi }}}{}{\left({z}{+}{1}\right)}^{\frac{{b}}{{2}}}{}{\left({z}{-}{1}\right)}^{\frac{{b}}{{2}}}{}{\mathrm{\Gamma }}{}\left({1}{+}{b}{+}{a}\right){}{\mathrm{hypergeom}}{}\left(\left[{1}{+}\frac{{b}}{{2}}{+}\frac{{a}}{{2}}{,}\frac{{1}}{{2}}{+}\frac{{b}}{{2}}{+}\frac{{a}}{{2}}\right]{,}\left[\frac{{3}}{{2}}{+}{a}\right]{,}\frac{{1}}{{{z}}^{{2}}}\right)}{{2}{}{{z}}^{{1}{+}{b}{+}{a}}{}{\mathrm{\Gamma }}{}\left(\frac{{3}}{{2}}{+}{a}\right){}{{2}}^{{a}}}$ (2)
 The formula above for LegendreP is not valid when the second parameter, b, is a positive integer. In that case, the following formula is used:
 > LegendreP(a,b,z) = (z+1)^(b/2)*(z-1)^(b/2)*diff(LegendreP(a,z),[z\$b]);
 ${\mathrm{LegendreP}}{}\left({a}{,}{b}{,}{z}\right){=}{\left({z}{+}{1}\right)}^{\frac{{b}}{{2}}}{}{\left({z}{-}{1}\right)}^{\frac{{b}}{{2}}}{}{{2}}^{{b}}{}{\mathrm{pochhammer}}{}\left(\frac{{1}}{{2}}{,}{b}\right){}{\mathrm{GegenbauerC}}{}\left({a}{-}{b}{,}\frac{{1}}{{2}}{+}{b}{,}{z}\right)$ (3)
 For LegendreQ, the hypergeometric representation shown is not valid when the first parameter a+$\frac{3}{2}$ is a non-positive integer; in that case the following formula is applied recursively
 > LegendreQ(a,b,Z) = ((2*a+3)*Z*LegendreQ(a+1,b,Z) + (b-a-2)*LegendreQ(a+2,b,Z))/(a+1+b);
 ${\mathrm{LegendreQ}}{}\left({a}{,}{b}{,}{Z}\right){=}\frac{\left({2}{}{a}{+}{3}\right){}{Z}{}{\mathrm{LegendreQ}}{}\left({a}{+}{1}{,}{b}{,}{Z}\right){+}\left({b}{-}{a}{-}{2}\right){}{\mathrm{LegendreQ}}{}\left({a}{+}{2}{,}{b}{,}{Z}\right)}{{1}{+}{b}{+}{a}}$ (4)
 Regardless of the value of b, in the hypergeometric representations above for LegendreP and LegendreQ, when _EnvLegendreCut has the value $1..\mathrm{\infty }$ the formulas used are obtained from those displayed by replacing the factor ${\left(z-1\right)}^{\frac{b}{2}}$ by ${\left(1-z\right)}^{\frac{b}{2}}$.
 The toroidal functions can be obtained by leaving _EnvLegendreCut unassigned (or assigning it the value $-1..1$) and composing with $\mathrm{cosh}\left(x\right)$: LegendreP(v, u, cosh(x)), etcetera.
 Similarly, the spherical harmonic functions can be obtained by setting $\mathrm{_EnvLegendreCut}≔1..\mathrm{\infty }$ and composing with $\mathrm{cos}\left(x\right)$: LegendreP(v, u, cos(x)), etcetera.
 Commands such as evalf and simplify have remember tables that do not take into consideration the setting of _EnvLegendreCut. After changing the value of _EnvLegendreCut, remember tables can be cleared by executing either the  restart command or the forget command (as in forget(evalf) or forget(simplify)).
 • The values returned by these functions when the argument is either 1 or -1 are the values that would be obtained by considering the order and degree parameters fixed and taking the appropriate limit in the argument.

Examples

 > $\mathrm{LegendreP}\left(1.3,2.54,1.7\right)$
 ${1.036634985}$ (5)
 > $\mathrm{LegendreP}\left(1.3,2.54,0.7\right)$
 ${-3.485914197}{+}{3.953993515}{}{I}$ (6)
 > $\mathrm{LegendreP}\left(1.3,2.54,0.7+0.0001I\right)$
 ${-3.487465642}{+}{3.952624688}{}{I}$ (7)
 > $\mathrm{_EnvLegendreCut}≔1..\mathrm{\infty }:$
 > $\mathrm{forget}\left(\mathrm{evalf}\right):$
 > $\mathrm{LegendreP}\left(1.3,2.54,0.7\right)$
 ${5.271210724}$ (8)
 > $\mathrm{LegendreP}\left(1.3,2.54,0.7+0.0001I\right)$
 ${5.271209941}{+}{0.002068978010}{}{I}$ (9)
 > $\mathrm{_EnvLegendreCut}≔-1..1$
 ${\mathrm{_EnvLegendreCut}}{≔}{-1}{..}{1}$ (10)
 > $\mathrm{LegendreQ}\left(-2.4+1.7I,\mathrm{\pi }-\mathrm{\gamma }I,I\right)$
 ${-4720.643302}{+}{4608.249867}{}{I}$ (11)
 > $\mathrm{LegendreQ}\left(1.5,2,0.3+I\right)$
 ${-0.7992112483}{+}{0.2994630511}{}{I}$ (12)
 > $\mathrm{LegendreP}\left(\frac{1}{2},2,x\right)$
 ${\mathrm{LegendreP}}{}\left(\frac{{1}}{{2}}{,}{2}{,}{x}\right)$ (13)
 > $\mathrm{diff}\left(\mathrm{LegendreP}\left(v,u,\mathrm{cosh}\left(x\right)\right),x\right)$
 $\frac{\left(\left({v}{-}{u}{+}{1}\right){}{\mathrm{LegendreP}}{}\left({v}{+}{1}{,}{u}{,}{\mathrm{cosh}}{}\left({x}\right)\right){-}\left({v}{+}{1}\right){}{\mathrm{cosh}}{}\left({x}\right){}{\mathrm{LegendreP}}{}\left({v}{,}{u}{,}{\mathrm{cosh}}{}\left({x}\right)\right)\right){}{\mathrm{sinh}}{}\left({x}\right)}{{{\mathrm{cosh}}{}\left({x}\right)}^{{2}}{-}{1}}$ (14)
 > $\mathrm{_EnvLegendreCut}≔1..\mathrm{\infty }:$
 > $\mathrm{simplify}\left(\mathrm{LegendreP}\left(5,x\right),'\mathrm{LegendreP}'\right)$
 $\frac{{63}}{{8}}{}{{x}}^{{5}}{-}\frac{{35}}{{4}}{}{{x}}^{{3}}{+}\frac{{15}}{{8}}{}{x}$ (15)
 > $\mathrm{simplify}\left(\mathrm{LegendreP}\left(5,3,x\right),'\mathrm{LegendreP}'\right)$
 ${-}\frac{{105}{}{\left({1}{-}{x}\right)}^{{3}}{{2}}}{}{\left({x}{+}{1}\right)}^{{3}}{{2}}}{}\left({9}{}{{x}}^{{2}}{-}{1}\right)}{{2}}$ (16)
 > $\mathrm{simplify}\left(\mathrm{LegendreQ}\left(5,x\right),'\mathrm{LegendreQ}'\right)$
 ${-}\frac{{x}{}\left({63}{}{{x}}^{{4}}{-}{70}{}{{x}}^{{2}}{+}{15}\right){}\left({-}{\mathrm{ln}}{}\left({x}{+}{1}\right){+}{\mathrm{ln}}{}\left({1}{-}{x}\right)\right)}{{16}}{-}\frac{{8}}{{15}}{-}\frac{{63}{}{{x}}^{{4}}}{{8}}{+}\frac{{49}{}{{x}}^{{2}}}{{8}}$ (17)
 > $\mathrm{forget}\left(\mathrm{simplify}\right)$
 > $\mathrm{_EnvLegendreCut}≔-1..1$
 ${\mathrm{_EnvLegendreCut}}{≔}{-1}{..}{1}$ (18)
 > $\mathrm{simplify}\left(\mathrm{LegendreQ}\left(5,x\right),'\mathrm{LegendreQ}'\right)$
 ${-}\frac{{x}{}\left({63}{}{{x}}^{{4}}{-}{70}{}{{x}}^{{2}}{+}{15}\right){}\left({-}{\mathrm{ln}}{}\left({x}{+}{1}\right){+}{\mathrm{ln}}{}\left({x}{-}{1}\right)\right)}{{16}}{-}\frac{{8}}{{15}}{-}\frac{{63}{}{{x}}^{{4}}}{{8}}{+}\frac{{49}{}{{x}}^{{2}}}{{8}}$ (19)
 > $\mathrm{simplify}\left(\mathrm{LegendreQ}\left(3,2,x\right),'\mathrm{LegendreQ}'\right)$
 ${-}\frac{{15}{}\left({x}{-}{1}\right){}\left({x}{+}{1}\right){}{x}{}\left({-}{\mathrm{ln}}{}\left({x}{+}{1}\right){+}{\mathrm{ln}}{}\left({x}{-}{1}\right)\right)}{{2}}{+}\frac{{-}{15}{}{{x}}^{{4}}{+}{25}{}{{x}}^{{2}}{-}{8}}{\left({x}{-}{1}\right){}\left({x}{+}{1}\right)}$ (20)
 > $\mathrm{forget}\left(\mathrm{simplify}\right)$
 > $\mathrm{_EnvLegendreCut}≔1..\mathrm{\infty }$
 ${\mathrm{_EnvLegendreCut}}{≔}{1}{..}{\mathrm{\infty }}$ (21)
 > $\mathrm{simplify}\left(\mathrm{LegendreQ}\left(3,2,x\right),'\mathrm{LegendreQ}'\right)$
 $\frac{{15}{}\left({x}{-}{1}\right){}\left({x}{+}{1}\right){}{x}{}\left({-}{\mathrm{ln}}{}\left({x}{+}{1}\right){+}{\mathrm{ln}}{}\left({1}{-}{x}\right)\right)}{{2}}{+}\frac{{15}{}{{x}}^{{4}}{-}{25}{}{{x}}^{{2}}{+}{8}}{\left({x}{-}{1}\right){}\left({x}{+}{1}\right)}$ (22)