ó
    ‰*£h¡¶  ã                   ó  • S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	  SSK
JrJrJr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJrJr  SSKJr  SSKJr  SSKJrJrJ r J!r!J"r"J#r#J$r$J%r%  \	" S5      r& " S S\5      r' " S S\'5      r(S r) " S S\'5      r* " S S\'5      r+ " S S\'5      r, " S S\5      r- " S S\5      r. " S S \'5      r/ " S! S"\5      r0 " S# S$\'5      r1 " S% S&\'5      r2 " S' S(\'5      r3 " S) S*\'5      r4g+),z™
This module mainly implements special orthogonal polynomials.

See also functions.combinatorial.numbers which contains some
combinatorial polynomials.

é    )ÚRational)ÚDefinedFunctionÚArgumentIndexError)ÚS)ÚDummy)ÚbinomialÚ	factorialÚRisingFactorial)Úre)Úexp)Úfloor)Úsqrt)ÚcosÚsec)Úgamma)Úhyper)Úchebyshevt_polyÚchebyshevu_polyÚgegenbauer_polyÚhermite_polyÚhermite_prob_polyÚjacobi_polyÚlaguerre_polyÚlegendre_polyÚxc                   ó.   • \ rS rSrSr\S 5       rS rSrg)ÚOrthogonalPolynomialé   z+Base class for orthogonal polynomials.
    c                 óš   • UR                   (       a:  US:¼  a3  U R                  [        U5      [        5      R	                  [        U5      $ g g )Nr   )Ú
is_integerÚ_ortho_polyÚintÚ_xÚsubs©ÚclsÚnr   s      Ú`/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sympy/functions/special/polynomials.pyÚ_eval_at_orderÚ#OrthogonalPolynomial._eval_at_order    s8   € à�<�<˜A ›FØ—?‘?¤3 q£6¬2Ó.×3Ñ3´B¸Ó:Ð:ð #ˆ<ó    c                 óv   • U R                  U R                  S   U R                  S   R                  5       5      $ )Nr   é   )ÚfuncÚargsÚ	conjugate)Úselfs    r(   Ú_eval_conjugateÚ$OrthogonalPolynomial._eval_conjugate%   s,   € Ø�y‰y˜Ÿ™ 1™ t§y¡y°¡|×'=Ñ'=Ó'?Ó@Ð@r+   © N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úclassmethodr)   r2   Ú__static_attributes__r4   r+   r(   r   r      s!   † ñð ñ;ó ð;õAr+   r   c                   óD   • \ rS rSrSr\S 5       rS
S jrS rS r	S r
Srg	)Újacobié-   aÿ  
Jacobi polynomial $P_n^{\left(\alpha, \beta\right)}(x)$.

Explanation
===========

``jacobi(n, alpha, beta, x)`` gives the $n$th Jacobi polynomial
in $x$, $P_n^{\left(\alpha, \beta\right)}(x)$.

The Jacobi polynomials are orthogonal on $[-1, 1]$ with respect
to the weight $\left(1-x\right)^\alpha \left(1+x\right)^\beta$.

Examples
========

>>> from sympy import jacobi, S, conjugate, diff
>>> from sympy.abc import a, b, n, x

>>> jacobi(0, a, b, x)
1
>>> jacobi(1, a, b, x)
a/2 - b/2 + x*(a/2 + b/2 + 1)
>>> jacobi(2, a, b, x)
a**2/8 - a*b/4 - a/8 + b**2/8 - b/8 + x**2*(a**2/8 + a*b/4 + 7*a/8 + b**2/8 + 7*b/8 + 3/2) + x*(a**2/4 + 3*a/4 - b**2/4 - 3*b/4) - 1/2

>>> jacobi(n, a, b, x)
jacobi(n, a, b, x)

>>> jacobi(n, a, a, x)
RisingFactorial(a + 1, n)*gegenbauer(n,
    a + 1/2, x)/RisingFactorial(2*a + 1, n)

>>> jacobi(n, 0, 0, x)
legendre(n, x)

>>> jacobi(n, S(1)/2, S(1)/2, x)
RisingFactorial(3/2, n)*chebyshevu(n, x)/factorial(n + 1)

>>> jacobi(n, -S(1)/2, -S(1)/2, x)
RisingFactorial(1/2, n)*chebyshevt(n, x)/factorial(n)

>>> jacobi(n, a, b, -x)
(-1)**n*jacobi(n, b, a, x)

>>> jacobi(n, a, b, 0)
gamma(a + n + 1)*hyper((-n, -b - n), (a + 1,), -1)/(2**n*factorial(n)*gamma(a + 1))
>>> jacobi(n, a, b, 1)
RisingFactorial(a + 1, n)/factorial(n)

>>> conjugate(jacobi(n, a, b, x))
jacobi(n, conjugate(a), conjugate(b), conjugate(x))

>>> diff(jacobi(n,a,b,x), x)
(a/2 + b/2 + n/2 + 1/2)*jacobi(n - 1, a + 1, b + 1, x)

See Also
========

gegenbauer,
chebyshevt_root, chebyshevu, chebyshevu_root,
legendre, assoc_legendre,
hermite, hermite_prob,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly,
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Jacobi_polynomials
.. [2] https://mathworld.wolfram.com/JacobiPolynomial.html
.. [3] https://functions.wolfram.com/Polynomials/JacobiP/

c                 ó  • X#:X  aê  U[        SS5      :X  a2  [        [        R                  U5      [	        U5      -  [        X5      -  $ UR                  (       a  [        X5      $ U[        R                  :X  a8  [        S[        R                  -  U5      [	        US-   5      -  [        X5      -  $ [        US-   U5      [        SU-  S-   U5      -  [        X[        R                  -   U5      -  $ X2* :X  aE  [        X-   S-   5      [        US-   5      -  SU-   US-  -  -  SU-
  US-  -  -  [        X* U5      -  $ UR                  (       Gd0  UR                  5       (       a!  [        R                  U-  [        XX$* 5      -  $ UR                  (       aK  SU* -  [        X!-   S-   5      -  [        US-   5      [	        U5      -  -  [!        U* U-
  U* /US-   /S5      -  $ U[        R"                  :X  a  [        US-   U5      [	        U5      -  $ U[        R$                  L a[  UR&                  (       aI  X#-   SU-  -   R(                  (       a  [+        S5      e[        X#-   U-   S-   U5      [        R$                  -  $ g g [-        XX45      $ )Néÿÿÿÿé   é   r-   z,Error. a + b + 2*n should not be an integer.)r   r
   r   ÚHalfr	   Ú
chebyshevtÚis_zeroÚlegendreÚ
chebyshevuÚ
gegenbauerr   Úassoc_legendreÚ	is_NumberÚcould_extract_minus_signÚNegativeOner=   r   ÚOneÚInfinityÚis_positiver    Ú
ValueErrorr   )r&   r'   ÚaÚbr   s        r(   ÚevalÚjacobi.eval~   sE  € ð ‹6Ø”H˜R “OÓ#Ü&¤q§v¡v¨qÓ1´I¸a³LÑ@Ä:ÈaÓCSÑSÐSØ——Ü “~Ð%Ø”a—f‘f“Ü& q¬¯©¡x°Ó3´iÀÀAÁÓ6FÑFÌÐTUÓIYÑYÐYä& q¨1¡u¨aÓ0´?À1ÀQÁ3ÈÁ7ÈAÓ3NÑNÔQ[Ð\]Ôcd×ciÑciÑ_iÐklÓQmÑmÐmØ�"‹Wä˜™ ™Ó#¤e¨A°©E£lÑ2°a¸!±e¸qÀ¹s±^ÑCÀqÈ1ÁuÐPQÐRSÑPSÁnÑTÔWeÐfgÐikÐmnÓWoÑoÐoà�{�{ˆ{ð ×)Ñ)×+Ñ+Ü—}‘} aÑ'¬&°°q¸"Ó*=Ñ=Ð=à�y�yØ˜Q˜B™¤%¨©°©	Ó"2Ñ2´e¸AÀ¹E³lÄYÈqÃ\Ñ6QÑRÜ ˜r A™v¨ r˜l¨Q°©U¨G°RÓ8ñ9ð :à”A—E‘E‹zÜ& q¨1¡u¨aÓ0´9¸Q³<Ñ?Ð?Ø”a—j‘j’Ø—=—=à™  !¡™×/×/Ü(Ð)WÓXÐXÜ*¨1©5°1©9°q©=¸!Ó<¼q¿z¹zÑIÐIð	 !ð !ô ˜q QÓ*Ð*r+   c                 óJ  • SSK Jn  US:X  a  [        X5      eUS:X  a“  U R                  u  p4pV[	        S5      nSXE-   U-   U-   S-   -  nXE-   SU-  -   S-   [        XW-   S-   X7-
  5      -  X7-
  [        XE-   U-   S-   X7-
  5      -  -  n	U" U[        X4XV5      U	[        XtXV5      -  -   -  USUS-
  45      $ US:X  a›  U R                  u  p4pV[	        S5      nSXE-   U-   U-   S-   -  nSX7-
  -  XE-   SU-  -   S-   [        XG-   S-   X7-
  5      -  X7-
  [        XE-   U-   S-   X7-
  5      -  -  -  n	U" U[        X4XV5      U	[        XtXV5      -  -   -  USUS-
  45      $ US:X  aB  U R                  u  p4pV[        R                  XE-   U-   S-   -  [        US-
  US-   US-   U5      -  $ [        X5      e)	Nr   ©ÚSumr-   rA   ÚkrB   r@   é   )	Úsympy.concrete.summationsrW   r   r/   r   r
   r=   r   rC   )
r1   ÚargindexrW   r'   rQ   rR   r   rX   Úf1Úf2s
             r(   ÚfdiffÚjacobi.fdiff¤   sé  € Ý1Ø�q‹=ä$ TÓ4Ð4Ø˜‹]àŸ™‰JˆA�!Ü�c“
ˆAØ�a‘e˜a‘i !‘m aÑ'Ñ(ˆBØ‘5˜1˜Q™3‘; ‘?¤o°a±e¸a±iÀÁÓ&GÑGØ‘Eœ_¨Q©U°Q©Y¸©]¸A¹EÓBÑBñDˆBá�rœV A¨!Ó/°"´V¸AÀ!Ó5GÑ2GÑGÑHÈ1ÈaÐQRÐUVÑQVÈ-ÓXÐXØ˜‹]àŸ™‰JˆA�!Ü�c“
ˆAØ�a‘e˜a‘i !‘m aÑ'Ñ(ˆBØ˜™‘ 1¡5¨1¨Q©3¡;°¡?´oÀaÁeÈaÁiÐQRÑQVÓ6WÑ"WØ‘Eœ_¨Q©U°Q©Y¸©]¸A¹EÓBÑBñ#Dñ EˆBá�rœV A¨!Ó/°"´V¸AÀ!Ó5GÑ2GÑGÑHÈ1ÈaÐQRÐUVÑQVÈ-ÓXÐXØ˜‹]àŸ™‰JˆA�!Ü—6‘6˜Q™U Q™Y¨™]Ñ+¬f°Q¸±U¸AÀ¹EÀ1ÀqÁ5È!Ó.LÑLÐLä$ TÓ4Ð4r+   c                 óJ  • SSK Jn  UR                  (       d  UR                  SL a  [	        S5      e[        S5      n[        U* U5      [        X#-   U-   S-   U5      -  [        X'-   S-   X-
  5      -  [        U5      -  SU-
  S-  U-  -  nS[        U5      -  U" X‡SU45      -  $ )Nr   rV   Fú*Error: n should be a non-negative integer.rX   r-   rA   )rZ   rW   Úis_negativer    rP   r   r
   r	   )	r1   r'   rQ   rR   r   ÚkwargsrW   rX   Úkerns	            r(   Ú_eval_rewrite_as_SumÚjacobi._eval_rewrite_as_SumÀ   s©   € Ý1à�=�=˜AŸL™L¨EÒ1ÜÐIÓJÐJÜ�#‹JˆÜ   AÓ&¬¸¹À¹ÀQ¹ÈÓ)JÑJÌ_Ð]^Ñ]bÐefÑ]fÐhiÑhmÓMnÑnÜ˜!“ñØ!" Q¡¨¡	¨A™~ñ.ˆà”9˜Q“<Ñ¡# d°°1¨IÓ"6Ñ6Ð6r+   c                 ó*   • U R                   " XX440 UD6$ ©N©re   )r1   r'   rQ   rR   r   rc   s         r(   Ú_eval_rewrite_as_polynomialÚ"jacobi._eval_rewrite_as_polynomialÊ   s   € ð ×(Ò(¨¨qÑ>°vÑ>Ð>r+   c                 óš   • U R                   u  pp4U R                  XR                  5       UR                  5       UR                  5       5      $ rh   ©r/   r.   r0   )r1   r'   rQ   rR   r   s        r(   r2   Újacobi._eval_conjugateÏ   s4   € Ø—Y‘Y‰
ˆˆaØ�y‰y˜ŸK™K›M¨1¯;©;«=¸!¿+¹+»-ÓHÐHr+   r4   N)rY   ©r5   r6   r7   r8   r9   r:   rS   r^   re   rj   r2   r;   r4   r+   r(   r=   r=   -   s3   † ñNð` ñ#+ó ð#+ôJ5ò87ò?õ
Ir+   r=   c                 óú   • [        S5      X-   S-   -  [        X-   S-   5      [        X-   S-   5      -  -  SU -  U-   U-   S-   -  [        U 5      [        X-   U-   S-   5      -  -  n[        XX#5      [	        U5      -  $ )a  
Jacobi polynomial $P_n^{\left(\alpha, \beta\right)}(x)$.

Explanation
===========

``jacobi_normalized(n, alpha, beta, x)`` gives the $n$th
Jacobi polynomial in $x$, $P_n^{\left(\alpha, \beta\right)}(x)$.

The Jacobi polynomials are orthogonal on $[-1, 1]$ with respect
to the weight $\left(1-x\right)^\alpha \left(1+x\right)^\beta$.

This functions returns the polynomials normilzed:

.. math::

    \int_{-1}^{1}
      P_m^{\left(\alpha, \beta\right)}(x)
      P_n^{\left(\alpha, \beta\right)}(x)
      (1-x)^{\alpha} (1+x)^{\beta} \mathrm{d}x
    = \delta_{m,n}

Examples
========

>>> from sympy import jacobi_normalized
>>> from sympy.abc import n,a,b,x

>>> jacobi_normalized(n, a, b, x)
jacobi(n, a, b, x)/sqrt(2**(a + b + 1)*gamma(a + n + 1)*gamma(b + n + 1)/((a + b + 2*n + 1)*factorial(n)*gamma(a + b + n + 1)))

Parameters
==========

n : integer degree of polynomial

a : alpha value

b : beta value

x : symbol

See Also
========

gegenbauer,
chebyshevt_root, chebyshevu, chebyshevu_root,
legendre, assoc_legendre,
hermite, hermite_prob,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly,
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Jacobi_polynomials
.. [2] https://mathworld.wolfram.com/JacobiPolynomial.html
.. [3] https://functions.wolfram.com/Polynomials/JacobiP/

rA   r-   )r   r   r	   r=   r   )r'   rQ   rR   r   Únfactors        r(   Újacobi_normalizedrr   Ô   sŠ   € ôF �‹t�a‘e˜a‘iÑ ¤E¨!©%°!©)Ó$4´u¸Q¹UÀQ¹YÓ7GÑ$GÑHØ�A‘#˜‘'˜A‘+ ‘/ñ#Ü&/°£l´U¸1¹5À1¹9Àq¹=Ó5IÑ&IñK€Gô �!˜Ó¤ W£Ñ-Ð-r+   c                   óD   • \ rS rSrSr\S 5       rS
S jrS rS r	S r
Srg	)rH   i"  a~  
Gegenbauer polynomial $C_n^{\left(\alpha\right)}(x)$.

Explanation
===========

``gegenbauer(n, alpha, x)`` gives the $n$th Gegenbauer polynomial
in $x$, $C_n^{\left(\alpha\right)}(x)$.

The Gegenbauer polynomials are orthogonal on $[-1, 1]$ with
respect to the weight $\left(1-x^2\right)^{\alpha-\frac{1}{2}}$.

Examples
========

>>> from sympy import gegenbauer, conjugate, diff
>>> from sympy.abc import n,a,x
>>> gegenbauer(0, a, x)
1
>>> gegenbauer(1, a, x)
2*a*x
>>> gegenbauer(2, a, x)
-a + x**2*(2*a**2 + 2*a)
>>> gegenbauer(3, a, x)
x**3*(4*a**3/3 + 4*a**2 + 8*a/3) + x*(-2*a**2 - 2*a)

>>> gegenbauer(n, a, x)
gegenbauer(n, a, x)
>>> gegenbauer(n, a, -x)
(-1)**n*gegenbauer(n, a, x)

>>> gegenbauer(n, a, 0)
2**n*sqrt(pi)*gamma(a + n/2)/(gamma(a)*gamma(1/2 - n/2)*gamma(n + 1))
>>> gegenbauer(n, a, 1)
gamma(2*a + n)/(gamma(2*a)*gamma(n + 1))

>>> conjugate(gegenbauer(n, a, x))
gegenbauer(n, conjugate(a), conjugate(x))

>>> diff(gegenbauer(n, a, x), x)
2*a*gegenbauer(n - 1, a + 1, x)

See Also
========

jacobi,
chebyshevt_root, chebyshevu, chebyshevu_root,
legendre, assoc_legendre,
hermite, hermite_prob,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Gegenbauer_polynomials
.. [2] https://mathworld.wolfram.com/GegenbauerPolynomial.html
.. [3] https://functions.wolfram.com/Polynomials/GegenbauerC3/

c                 ó  • UR                   (       a  [        R                  $ U[        R                  :X  a  [	        X5      $ U[        R
                  :X  a  [        X5      $ U[        R                  :X  a  [        R                  $ UR                  (       Gdç  U[        R                  :X  a›  [        U5      [        R                  :„  S:X  a  [        R                  $ [        [        R                  X!-   -  5      [        [        R                  U-  5      -  [        SU-  U-   5      -  [        SU-  5      [        US-   5      -  -  $ UR                  5       (       a!  [        R                  U-  [!        XU* 5      -  $ UR"                  (       al  SU-  [%        [        R                  5      -  [        U[        R                  U-  -   5      -  [        SU-
  S-  5      [        US-   5      -  [        U5      -  -  $ U[        R
                  :X  a/  [        SU-  U-   5      [        SU-  5      [        US-   5      -  -  $ U[        R&                  L a.  UR(                  (       a  [+        X!5      [        R&                  -  $ g g [-        XU5      $ )NTrA   r-   )rb   r   ÚZerorC   rF   rM   rG   rL   rJ   r   ÚComplexInfinityr   ÚPir   r   rK   rH   rE   r   rN   rO   r
   r   )r&   r'   rQ   r   s       r(   rS   Úgegenbauer.evalg  sç  € ð �=�=Ü—6‘6ˆMð ”—‘‹;Ü˜A“>Ð!Ø”!—%‘%‹ZÜ˜aÓ#Ð#Ø”!—-‘-ÓÜ—6‘6ˆMà�{�{ˆ{à”A—M‘MÓ!Ü�q“EœAŸF™F‘N tÓ+Ü×,Ñ,Ð,ä¤§¡ a¡c¡
›O¬c´!·$±$°q±&«kÑ9¼EÀ!ÀAÁ#ÀaÁ%»LÑHÜ!& q¨¡s£¬e°A°a±C«jÑ!8ñ:ð ;ð
 ×)Ñ)×+Ñ+Ü—}‘} aÑ'¬*°Q¸A¸2Ó*>Ñ>Ð>à�y�yØ˜1™œt¤A§D¡D›zÑ)¬E°!´a·f±f¸Q±h±,Ó,?Ñ?Ü  A¡ q™yÓ)¬E°!°a±%«LÑ8¼5À»8ÑCñEð Gà”A—E‘E‹zÜ˜Q˜q™S 1™W“~¬¨q°©s«´e¸AÀ¹E³lÑ)BÑCÐCØ”a—j‘j’Ø—=—=Ü*¨1Ó0´1·:±:Ñ=Ð=ð !ð !ô
 # 1¨Ó+Ð+r+   c                 óÞ  • SSK Jn  US:X  a  [        X5      eUS:X  a˜  U R                  u  p4n[	        S5      nSSSX6-
  -  -   -  Xd-   -  UU-   SU-  -   X6-
  -  -  nSUS-   -  USU-  -   SU-  SU-  -   S-   -  -  SXc-   SU-  -   -  -   nU[        XdU5      -  U[        X4U5      -  -   n	U" X–SUS-
  45      $ US:X  a(  U R                  u  p4nSU-  [        US-
  US-   U5      -  $ [        X5      e)Nr   rV   r-   rA   rX   r@   rB   )rZ   rW   r   r/   r   rH   )
r1   r[   rW   r'   rQ   r   rX   Úfactor1Úfactor2rd   s
             r(   r^   Úgegenbauer.fdiff�  s1  € Ý1Ø�q‹=ä$ TÓ4Ð4Ø˜‹]à—i‘i‰GˆA�!Ü�c“
ˆAØ˜1  a¡e™}Ñ,Ñ-°±Ñ7¸AØñ=Ø  ™sñ=#Ø'(¡uñ<.ñ /ˆGà˜˜Q™‘i A¨¨!©¡G°°!±°a¸±c±	¸A±Ñ#>Ñ?Ø�Q‘U˜Q˜q™S‘[Ñ!ñ"ˆGàœ: a¨AÓ.Ñ.°¼ÀAÈ!Ó9LÑ1LÑLˆDÙ�t  A¨¡E˜]Ó+Ð+Ø˜‹]à—i‘i‰GˆA�!Ø�Q‘3”z ! a¡%¨¨Q©°Ó2Ñ2Ð2ä$ TÓ4Ð4r+   c           	      óÔ   • SSK Jn  [        S5      nSU-  [        X!U-
  5      -  SU-  USU-  -
  -  -  [	        U5      [	        USU-  -
  5      -  -  nU" XvS[        US-  5      45      $ )Nr   rV   rX   r@   rA   )rZ   rW   r   r
   r	   r   )r1   r'   rQ   r   rc   rW   rX   rd   s           r(   re   Úgegenbauer._eval_rewrite_as_Sum¦  ss   € Ý1Ü�#‹JˆØ�a‘œ/¨!°©UÓ3Ñ3°q¸±s¸aÀ!ÀAÁ#¹gÑ6FÑFÜ˜1“¤	¨!¨a°©c©'Ó 2Ñ2ñ4ˆá�4˜Q¤ a¨¡c£
Ð+Ó,Ð,r+   c                 ó*   • U R                   " XU40 UD6$ rh   ri   )r1   r'   rQ   r   rc   s        r(   rj   Ú&gegenbauer._eval_rewrite_as_polynomial­  ó   € ð ×(Ò(¨¨qÑ;°FÑ;Ð;r+   c                 ó|   • U R                   u  pnU R                  XR                  5       UR                  5       5      $ rh   rm   )r1   r'   rQ   r   s       r(   r2   Úgegenbauer._eval_conjugate²  ó,   € Ø—)‘)‰ˆˆaØ�y‰y˜ŸK™K›M¨1¯;©;«=Ó9Ð9r+   r4   N©rB   ro   r4   r+   r(   rH   rH   "  s2   † ñBðH ñ&,ó ð&,ôP5ò,-ò<õ
:r+   rH   c                   óN   • \ rS rSrSr\" \5      r\S 5       r	S	S jr
S rS rSrg)
rD   i»  aû  
Chebyshev polynomial of the first kind, $T_n(x)$.

Explanation
===========

``chebyshevt(n, x)`` gives the $n$th Chebyshev polynomial (of the first
kind) in $x$, $T_n(x)$.

The Chebyshev polynomials of the first kind are orthogonal on
$[-1, 1]$ with respect to the weight $\frac{1}{\sqrt{1-x^2}}$.

Examples
========

>>> from sympy import chebyshevt, diff
>>> from sympy.abc import n,x
>>> chebyshevt(0, x)
1
>>> chebyshevt(1, x)
x
>>> chebyshevt(2, x)
2*x**2 - 1

>>> chebyshevt(n, x)
chebyshevt(n, x)
>>> chebyshevt(n, -x)
(-1)**n*chebyshevt(n, x)
>>> chebyshevt(-n, x)
chebyshevt(n, x)

>>> chebyshevt(n, 0)
cos(pi*n/2)
>>> chebyshevt(n, -1)
(-1)**n

>>> diff(chebyshevt(n, x), x)
n*chebyshevu(n - 1, x)

See Also
========

jacobi, gegenbauer,
chebyshevt_root, chebyshevu, chebyshevu_root,
legendre, assoc_legendre,
hermite, hermite_prob,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Chebyshev_polynomial
.. [2] https://mathworld.wolfram.com/ChebyshevPolynomialoftheFirstKind.html
.. [3] https://mathworld.wolfram.com/ChebyshevPolynomialoftheSecondKind.html
.. [4] https://functions.wolfram.com/Polynomials/ChebyshevT/
.. [5] https://functions.wolfram.com/Polynomials/ChebyshevU/

c                 óH  • UR                   (       dÝ  UR                  5       (       a   [        R                  U-  [	        X* 5      -  $ UR                  5       (       a  [	        U* U5      $ UR
                  (       a-  [        [        R                  [        R                  -  U-  5      $ U[        R                  :X  a  [        R                  $ U[        R                  L a  [        R                  $ g UR                  (       a  U R                  U* U5      $ U R                  X5      $ rh   )rJ   rK   r   rL   rD   rE   r   rC   rw   rM   rN   rb   r)   r%   s      r(   rS   Úchebyshevt.eval  sÓ   € à�{�{ð ×)Ñ)×+Ñ+Ü—}‘} aÑ'¬*°Q¸Ó*;Ñ;Ð;à×)Ñ)×+Ñ+Ü! 1 " aÓ(Ð(à�y�yÜœ1Ÿ6™6¤A§D¡D™=¨1Ñ,Ó-Ð-Ø”A—E‘E‹zÜ—u‘u�Ø”a—j‘j’Ü—z‘zÐ!ð !ð �}�}à×)Ñ)¨1¨"¨aÓ0Ð0à×)Ñ)¨!Ó/Ð/r+   c                 ó†   • US:X  a  [        X5      eUS:X  a   U R                  u  p#U[        US-
  U5      -  $ [        X5      e©Nr-   rA   )r   r/   rG   ©r1   r[   r'   r   s       r(   r^   Úchebyshevt.fdiff  sG   € Ø�q‹=ä$ TÓ4Ð4Ø˜‹]à—9‘9‰DˆAØ”z ! a¡%¨Ó+Ñ+Ð+ä$ TÓ4Ð4r+   c           	      óž   • SSK Jn  [        S5      n[        USU-  5      US-  S-
  U-  -  X!SU-  -
  -  -  nU" XeS[	        US-  5      45      $ ©Nr   rV   rX   rA   r-   )rZ   rW   r   r   r   ©r1   r'   r   rc   rW   rX   rd   s          r(   re   Úchebyshevt._eval_rewrite_as_Sum%  sX   € Ý1Ü�#‹JˆÜ˜˜1˜Q™3Ó 1 a¡4¨!¡8¨a¡-Ñ/°!¸!¸A¹#±g±,Ñ>ˆÙ�4˜Q¤ a¨¡c£
Ð+Ó,Ð,r+   c                 ó(   • U R                   " X40 UD6$ rh   ri   ©r1   r'   r   rc   s       r(   rj   Ú&chebyshevt._eval_rewrite_as_polynomial+  ó   € ð ×(Ò(¨Ñ8°Ñ8Ð8r+   r4   N©rA   )r5   r6   r7   r8   r9   Ústaticmethodr   r!   r:   rS   r^   re   rj   r;   r4   r+   r(   rD   rD   »  s6   † ñAñF ˜Ó/€Kàñ0ó ð0ô0	5ò-õ9r+   rD   c                   óN   • \ rS rSrSr\" \5      r\S 5       r	S	S jr
S rS rSrg)
rG   i1  a  
Chebyshev polynomial of the second kind, $U_n(x)$.

Explanation
===========

``chebyshevu(n, x)`` gives the $n$th Chebyshev polynomial of the second
kind in x, $U_n(x)$.

The Chebyshev polynomials of the second kind are orthogonal on
$[-1, 1]$ with respect to the weight $\sqrt{1-x^2}$.

Examples
========

>>> from sympy import chebyshevu, diff
>>> from sympy.abc import n,x
>>> chebyshevu(0, x)
1
>>> chebyshevu(1, x)
2*x
>>> chebyshevu(2, x)
4*x**2 - 1

>>> chebyshevu(n, x)
chebyshevu(n, x)
>>> chebyshevu(n, -x)
(-1)**n*chebyshevu(n, x)
>>> chebyshevu(-n, x)
-chebyshevu(n - 2, x)

>>> chebyshevu(n, 0)
cos(pi*n/2)
>>> chebyshevu(n, 1)
n + 1

>>> diff(chebyshevu(n, x), x)
(-x*chebyshevu(n, x) + (n + 1)*chebyshevt(n + 1, x))/(x**2 - 1)

See Also
========

jacobi, gegenbauer,
chebyshevt, chebyshevt_root, chebyshevu_root,
legendre, assoc_legendre,
hermite, hermite_prob,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Chebyshev_polynomial
.. [2] https://mathworld.wolfram.com/ChebyshevPolynomialoftheFirstKind.html
.. [3] https://mathworld.wolfram.com/ChebyshevPolynomialoftheSecondKind.html
.. [4] https://functions.wolfram.com/Polynomials/ChebyshevT/
.. [5] https://functions.wolfram.com/Polynomials/ChebyshevU/

c                 ó"  • UR                   (       Gd!  UR                  5       (       a   [        R                  U-  [	        X* 5      -  $ UR                  5       (       aN  U[        R                  :X  a  [        R
                  $ U* S-
  R                  5       (       d  [	        U* S-
  U5      * $ UR                  (       a-  [        [        R                  [        R                  -  U-  5      $ U[        R                  :X  a  [        R                  U-   $ U[        R                  L a  [        R                  $ g UR                  (       a;  U[        R                  :X  a  [        R
                  $ U R                  U* S-
  U5      * $ U R                  X5      $ ©NrA   )rJ   rK   r   rL   rG   ru   rE   r   rC   rw   rM   rN   rb   r)   r%   s      r(   rS   Úchebyshevu.evalw  s'  € à�{�{ˆ{ð ×)Ñ)×+Ñ+Ü—}‘} aÑ'¬*°Q¸Ó*;Ñ;Ð;à×)Ñ)×+Ñ+ØœŸ™Ó%äŸ6™6�MØ˜"˜q™&×:Ñ:×<Ñ<Ü&¨ r¨A¡v¨qÓ1Ð1Ð1à�y�yÜœ1Ÿ6™6¤A§D¡D™=¨1Ñ,Ó-Ð-Ø”A—E‘E‹zÜ—u‘u˜q‘yÐ Ø”a—j‘j’Ü—z‘zÐ!ð !ð �}�}àœŸ™Ó%ÜŸ6™6�Mà×.Ñ.°¨r°A©v°qÓ9Ð9Ð9à×)Ñ)¨!Ó/Ð/r+   c                 ó¼   • US:X  a  [        X5      eUS:X  a;  U R                  u  p#US-   [        US-   U5      -  U[        X#5      -  -
  US-  S-
  -  $ [        X5      erŠ   )r   r/   rD   rG   r‹   s       r(   r^   Úchebyshevu.fdiff—  si   € Ø�q‹=ä$ TÓ4Ð4Ø˜‹]à—9‘9‰DˆAØ˜‘Uœj¨¨Q©°Ó2Ñ2°Q¼ÀAÓ9IÑ5IÑIÈaÐQRÉdÐUVÉhÑWÐWä$ TÓ4Ð4r+   c           	      óî   • SSK Jn  [        S5      n[        R                  U-  [        X-
  5      -  SU-  USU-  -
  -  -  [        U5      [        USU-  -
  5      -  -  nU" XeS[        US-  5      45      $ ©Nr   rV   rX   rA   ©rZ   rW   r   r   rL   r	   r   r�   s          r(   re   Úchebyshevu._eval_rewrite_as_Sum¢  s   € Ý1Ü�#‹JˆÜ�}‰}˜aÑ¤)Ø‰Eó#ñ Ø˜‘c˜Q  1¡™WÑ%ñ&Ü)2°1«¼	À!ÀaÈÁcÁ'Ó8JÑ)JñLˆá�4˜Q¤ a¨¡c£
Ð+Ó,Ð,r+   c                 ó(   • U R                   " X40 UD6$ rh   ri   r’   s       r(   rj   Ú&chebyshevu._eval_rewrite_as_polynomial©  r”   r+   r4   Nr•   )r5   r6   r7   r8   r9   r–   r   r!   r:   rS   r^   re   rj   r;   r4   r+   r(   rG   rG   1  s6   † ñAñF ˜Ó/€Kàñ0ó ð0ô>	5ò-õ9r+   rG   c                   ó(   • \ rS rSrSr\S 5       rSrg)Úchebyshevt_rooti¯  a%  
``chebyshev_root(n, k)`` returns the $k$th root (indexed from zero) of
the $n$th Chebyshev polynomial of the first kind; that is, if
$0 \le k < n$, ``chebyshevt(n, chebyshevt_root(n, k)) == 0``.

Examples
========

>>> from sympy import chebyshevt, chebyshevt_root
>>> chebyshevt_root(3, 2)
-sqrt(3)/2
>>> chebyshevt(3, chebyshevt_root(3, 2))
0

See Also
========

jacobi, gegenbauer,
chebyshevt, chebyshevu, chebyshevu_root,
legendre, assoc_legendre,
hermite, hermite_prob,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly
c                 óŽ   • SU::  a  X!:  d  [        SU< SU< 35      e[        [        R                  SU-  S-   -  SU-  -  5      $ )Nr   úmust have 0 <= k < n, got k = ú	 and n = rA   r-   ©rP   r   r   rw   ©r&   r'   rX   s      r(   rS   Úchebyshevt_root.evalÐ  sH   € à�a“˜a›eÝÛ+,ªað1ó 2ð 2ä”1—4‘4˜˜1™˜q™‘> 1 Q¡3Ñ'Ó(Ð(r+   r4   N©r5   r6   r7   r8   r9   r:   rS   r;   r4   r+   r(   r¤   r¤   ¯  s   † ñð@ ñ)ó ó)r+   r¤   c                   ó(   • \ rS rSrSr\S 5       rSrg)Úchebyshevu_rootiØ  a  
``chebyshevu_root(n, k)`` returns the $k$th root (indexed from zero) of the
$n$th Chebyshev polynomial of the second kind; that is, if $0 \le k < n$,
``chebyshevu(n, chebyshevu_root(n, k)) == 0``.

Examples
========

>>> from sympy import chebyshevu, chebyshevu_root
>>> chebyshevu_root(3, 2)
-sqrt(2)/2
>>> chebyshevu(3, chebyshevu_root(3, 2))
0

See Also
========

chebyshevt, chebyshevt_root, chebyshevu,
legendre, assoc_legendre,
hermite, hermite_prob,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly
c                 óˆ   • SU::  a  X!:  d  [        SU< SU< 35      e[        [        R                  US-   -  US-   -  5      $ )Nr   r¦   r§   r-   r¨   r©   s      r(   rS   Úchebyshevu_root.evalù  sD   € à�a“˜a›eÝÛ+,ªað1ó 2ð 2ä”1—4‘4˜˜Q™‘<  Q¡Ñ'Ó(Ð(r+   r4   Nr«   r4   r+   r(   r­   r­   Ø  s   † ñð@ ñ)ó ó)r+   r­   c                   óN   • \ rS rSrSr\" \5      r\S 5       r	S	S jr
S rS rSrg)
rF   i  a  
``legendre(n, x)`` gives the $n$th Legendre polynomial of $x$, $P_n(x)$

Explanation
===========

The Legendre polynomials are orthogonal on $[-1, 1]$ with respect to
the constant weight 1. They satisfy $P_n(1) = 1$ for all $n$; further,
$P_n$ is odd for odd $n$ and even for even $n$.

Examples
========

>>> from sympy import legendre, diff
>>> from sympy.abc import x, n
>>> legendre(0, x)
1
>>> legendre(1, x)
x
>>> legendre(2, x)
3*x**2/2 - 1/2
>>> legendre(n, x)
legendre(n, x)
>>> diff(legendre(n,x), x)
n*(x*legendre(n, x) - legendre(n - 1, x))/(x**2 - 1)

See Also
========

jacobi, gegenbauer,
chebyshevt, chebyshevt_root, chebyshevu, chebyshevu_root,
assoc_legendre,
hermite, hermite_prob,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Legendre_polynomial
.. [2] https://mathworld.wolfram.com/LegendrePolynomial.html
.. [3] https://functions.wolfram.com/Polynomials/LegendreP/
.. [4] https://functions.wolfram.com/Polynomials/LegendreP2/

c                 óø  • UR                   (       Gd3  UR                  5       (       a   [        R                  U-  [	        X* 5      -  $ UR                  5       (       a7  U* S-
  R                  5       (       d  [	        U* [        R
                  -
  U5      $ UR                  (       aY  [        [        R                  5      [        [        R                  US-  -
  5      [        [        R
                  US-  -   5      -  -  $ U[        R
                  :X  a  [        R
                  $ U[        R                  L a  [        R                  $ g UR                  (       a  U* [        R
                  -
  nU R                  X5      $ rŠ   )rJ   rK   r   rL   rF   rM   rE   r   rw   r   rC   rN   rb   r)   r%   s      r(   rS   Úlegendre.eval=  s  € à�{�{ˆ{ð ×)Ñ)×+Ñ+Ü—}‘} aÑ'¬(°1°b«/Ñ9Ð9à×)Ñ)×+Ñ+°Q°B¸±F×3TÑ3T×3VÑ3VÜ  ¤Q§U¡U¡
¨AÓ.Ð.à�y�yÜœAŸD™D“z¤5¬¯©°!°A±#©Ó#6´u¼Q¿U¹UÀQÀqÁS¹[Ó7IÑ#IÑJÐJØ”a—e‘e“Ü—u‘u�Ø”a—j‘j’Ü—z‘zÐ!ð !ð
 �}�}Ø�BœŸ™‘J�Ø×%Ñ% aÓ+Ð+r+   c                 ó´   • US:X  a  [        X5      eUS:X  a7  U R                  u  p#X#S-  S-
  -  U[        X#5      -  [        US-
  U5      -
  -  $ [        X5      erŠ   )r   r/   rF   r‹   s       r(   r^   Úlegendre.fdiffU  sa   € Ø�q‹=ä$ TÓ4Ð4Ø˜‹]ð —9‘9‰DˆAØ˜‘d˜Q‘h‘< ¤8¨A£>Ñ!1´H¸QÀ¹UÀAÓ4FÑ!FÑGÐGä$ TÓ4Ð4r+   c                 ó²   • SSK Jn  [        S5      n[        R                  U-  [        X5      S-  -  SU-   S-  X-
  -  -  SU-
  S-  U-  -  nU" XeSU45      $ rŽ   )rZ   rW   r   r   rL   r   r�   s          r(   re   Úlegendre._eval_rewrite_as_Summ  sb   € Ý1Ü�#‹JˆÜ�}‰}˜aÑ¤¨£°Ñ 1Ñ1°A¸±E¸1±9ÀÁÑ2FÑFÈÈQÉÐPQÉ	ÐTUÁ~ÑUˆÙ�4˜Q ˜Ó#Ð#r+   c                 ó(   • U R                   " X40 UD6$ rh   ri   r’   s       r(   rj   Ú$legendre._eval_rewrite_as_polynomials  r”   r+   r4   Nr•   )r5   r6   r7   r8   r9   r–   r   r!   r:   rS   r^   re   rj   r;   r4   r+   r(   rF   rF     s5   † ñ3ñj ˜}Ó-€Kàñ,ó ð,ô.5ò0$õ9r+   rF   c                   óT   • \ rS rSrSr\S 5       r\S 5       rSS jrS r	S r
S rS	rg
)rI   iy  aç  
``assoc_legendre(n, m, x)`` gives $P_n^m(x)$, where $n$ and $m$ are
the degree and order or an expression which is related to the nth
order Legendre polynomial, $P_n(x)$ in the following manner:

.. math::
    P_n^m(x) = (-1)^m (1 - x^2)^{\frac{m}{2}}
               \frac{\mathrm{d}^m P_n(x)}{\mathrm{d} x^m}

Explanation
===========

Associated Legendre polynomials are orthogonal on $[-1, 1]$ with:

- weight $= 1$            for the same $m$ and different $n$.
- weight $= \frac{1}{1-x^2}$   for the same $n$ and different $m$.

Examples
========

>>> from sympy import assoc_legendre
>>> from sympy.abc import x, m, n
>>> assoc_legendre(0,0, x)
1
>>> assoc_legendre(1,0, x)
x
>>> assoc_legendre(1,1, x)
-sqrt(1 - x**2)
>>> assoc_legendre(n,m,x)
assoc_legendre(n, m, x)

See Also
========

jacobi, gegenbauer,
chebyshevt, chebyshevt_root, chebyshevu, chebyshevu_root,
legendre,
hermite, hermite_prob,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Associated_Legendre_polynomials
.. [2] https://mathworld.wolfram.com/LegendrePolynomial.html
.. [3] https://functions.wolfram.com/Polynomials/LegendreP/
.. [4] https://functions.wolfram.com/Polynomials/LegendreP2/

c                 óÆ   • [        U[        SS9R                  [        U45      n[        R                  U-  S[        S-  -
  [        US5      -  -  UR                  5       -  $ )NT)Úpolysr-   rA   )r   r#   Údiffr   rL   r   Úas_expr)r&   r'   ÚmÚPs       r(   r)   Úassoc_legendre._eval_at_order´  sQ   € ä˜!œR tÑ,×1Ñ1´2°q°'Ó:ˆÜ�}‰}˜aÑ 1¤r¨1¡u¡9¬x¸¸1«~Ñ"=Ñ=ÀÇ	Á	ÃÑKÐKr+   c                 ó  • UR                  5       (       a>  [        R                  U* -  [        X!-   5      [        X-
  5      -  -  [	        X* U5      -  $ US:X  a  [        X5      $ US:X  aH  SU-  [        [        R                  5      -  [        SU-
  U-
  S-  5      [        SX!-
  S-  -
  5      -  -  $ UR                  (       aÁ  UR                  (       a¯  UR                  (       a�  UR                  (       a‹  UR                  (       a  [        U < SU< S35      e[        U5      U:”  a  [        U < SU< SU< S35      eU R                  [        U5      [        [        U5      5      5      R!                  ["        U5      $ g g g g )Nr   rA   r-   z. : 1st index must be nonnegative integer (got Ú)z0 : abs('2nd index') must be <= '1st index' (got z, )rK   r   rL   r	   rI   rF   r   rw   r   rJ   r    rb   rP   Úabsr)   r"   r$   r#   )r&   r'   r¾   r   s       r(   rS   Úassoc_legendre.eval¹  s-  € à×%Ñ%×'Ñ'ä—=‘= A 2Ñ&¬)°A±EÓ*:¼9ÀQÁUÓ;KÑ*KÑLÌ~Ð^_ÐacÐefÓOgÑgÐgØ�‹6ä˜A“>Ð!Ø�‹6Ø�a‘4œœQŸT™T›
‘?¤e¨Q°©U°Q©Y¸©MÓ&:¼5ÀÀaÁeÈQÁYÁÓ;OÑ&OÑPÐPØ�;�;˜1Ÿ;Ÿ;¨1¯<¯<¸A¿L¿LØ�}�}Ü ÓZ]Ó_`Ð!aÓbÐbÜ�1‹v˜‹zÜ Ó`cÓefÓhiÐ!jÓkÐkØ×%Ñ%¤c¨!£f¬c´#°a³&«kÓ:×?Ñ?ÄÀAÓFÐFð =I¨<˜;ˆ;r+   c                 óê   • US:X  a  [        X5      eUS:X  a  [        X5      eUS:X  aA  U R                  u  p#nSUS-  S-
  -  XB-  [        X#U5      -  X2-   [        US-
  X45      -  -
  -  $ [        X5      e)Nr-   rA   rB   )r   r/   rI   )r1   r[   r'   r¾   r   s        r(   r^   Úassoc_legendre.fdiffÊ  s‡   € Ø�q‹=ä$ TÓ4Ð4Ø˜‹]ä$ TÓ4Ð4Ø˜‹]ð —i‘i‰GˆA�!Ø�a˜‘d˜Q‘h‘< ¡¤^°A¸!Ó%<Ñ!<ÀÁÄ~ÐVWÐZ[ÑV[Ð]^ÓGbÑ?bÑ!bÑcÐcä$ TÓ4Ð4r+   c           
      óf  • SSK Jn  [        S5      n[        SU-  SU-  -
  5      SU-  [        X-
  5      -  [        U5      -  [        USU-  -
  U-
  5      -  -  [        R
                  U-  -  X1U-
  SU-  -
  -  -  nSUS-  -
  US-  -  U" XvS[        X-
  [        R                  -  5      45      -  $ rŽ   )rZ   rW   r   r	   r   rL   r   rC   )r1   r'   r¾   r   rc   rW   rX   rd   s           r(   re   Ú#assoc_legendre._eval_rewrite_as_SumÙ  sÃ   € Ý1Ü�#‹JˆÜ˜˜1™˜q ™s™Ó# Q¨¡T¬)°A±EÓ*:Ñ%:¼9Øó<ñ &Ü˜˜Q˜q™S™ 1™Ó%ñ&&ñ 'Ü'(§}¡}°aÑ'7ñ8Ø89À¹EÀAÀaÁC¹KÑ8HñIˆà�A�q‘D‘˜A˜a™CÑ ¡3 t°´E¸1¹5Ä!Ç&Á&¹.Ó4IÐ-JÓ#KÑKÐKr+   c                 ó*   • U R                   " XU40 UD6$ rh   ri   )r1   r'   r¾   r   rc   s        r(   rj   Ú*assoc_legendre._eval_rewrite_as_polynomialà  r�   r+   c                 ó|   • U R                   u  pnU R                  XR                  5       UR                  5       5      $ rh   rm   )r1   r'   r¾   r   s       r(   r2   Úassoc_legendre._eval_conjugateå  r„   r+   r4   Nr…   )r5   r6   r7   r8   r9   r:   r)   rS   r^   re   rj   r2   r;   r4   r+   r(   rI   rI   y  sI   † ñ8ðt ñLó ðLð ñGó ðGô 5òLò<õ
:r+   rI   c                   óT   • \ rS rSrSr\" \5      r\S 5       r	S
S jr
S rS rS rSrg	)Úhermiteiî  a†  
``hermite(n, x)`` gives the $n$th Hermite polynomial in $x$, $H_n(x)$.

Explanation
===========

The Hermite polynomials are orthogonal on $(-\infty, \infty)$
with respect to the weight $\exp\left(-x^2\right)$.

Examples
========

>>> from sympy import hermite, diff
>>> from sympy.abc import x, n
>>> hermite(0, x)
1
>>> hermite(1, x)
2*x
>>> hermite(2, x)
4*x**2 - 2
>>> hermite(n, x)
hermite(n, x)
>>> diff(hermite(n,x), x)
2*n*hermite(n - 1, x)
>>> hermite(n, -x)
(-1)**n*hermite(n, x)

See Also
========

jacobi, gegenbauer,
chebyshevt, chebyshevt_root, chebyshevu, chebyshevu_root,
legendre, assoc_legendre,
hermite_prob,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Hermite_polynomial
.. [2] https://mathworld.wolfram.com/HermitePolynomial.html
.. [3] https://functions.wolfram.com/Polynomials/HermiteH/

c                 óÖ  • UR                   (       d©  UR                  5       (       a   [        R                  U-  [	        X* 5      -  $ UR
                  (       a?  SU-  [        [        R                  5      -  [        [        R                  U-
  S-  5      -  $ U[        R                  L a  [        R                  $ g UR                  (       a  [        SU-  5      eU R                  X5      $ )NrA   ú0The index n must be nonnegative integer (got %r))rJ   rK   r   rL   rÎ   rE   r   rw   r   rM   rN   rb   rP   r)   r%   s      r(   rS   Úhermite.eval&  sµ   € à�{�{ð ×)Ñ)×+Ñ+Ü—}‘} aÑ'¬'°!°R«.Ñ8Ð8à�y�yØ˜!‘tœd¤1§4¡4›jÑ(¬5´!·%±%¸!±)¸Q±Ó+?Ñ?Ð?Ø”a—j‘j’Ü—z‘zÐ!ð !ð �}�}Ü ØFÈÑJóLð Lð ×)Ñ)¨!Ó/Ð/r+   c                 óŒ   • US:X  a  [        X5      eUS:X  a#  U R                  u  p#SU-  [        US-
  U5      -  $ [        X5      erŠ   )r   r/   rÎ   r‹   s       r(   r^   Úhermite.fdiff:  sK   € Ø�q‹=ä$ TÓ4Ð4Ø˜‹]à—9‘9‰DˆAØ�Q‘3”w˜q 1™u aÓ(Ñ(Ð(ä$ TÓ4Ð4r+   c           
      óê   • SSK Jn  [        S5      n[        R                  U-  [        U5      [        USU-  -
  5      -  -  SU-  USU-  -
  -  -  n[        U5      U" XeS[        US-  5      45      -  $ rž   rŸ   r�   s          r(   re   Úhermite._eval_rewrite_as_SumE  ss   € Ý1Ü�#‹JˆÜ�}‰}˜aÑ¤9¨Q£<´	¸!¸aÀ¹c¹'Ó0BÑ#BÑCÀqÈÁsÈaÐRSÐTUÑRUÉgÑFVÑVˆÜ˜‹|™C ¨!¬U°1°Q±3«ZÐ&8Ó9Ñ9Ð9r+   c                 ó(   • U R                   " X40 UD6$ rh   ri   r’   s       r(   rj   Ú#hermite._eval_rewrite_as_polynomialK  r”   r+   c                 óN   • [        S5      U-  [        X[        S5      -  5      -  $ r™   )r   Úhermite_probr’   s       r(   Ú_eval_rewrite_as_hermite_probÚ%hermite._eval_rewrite_as_hermite_probP  s"   € Ü�A‹w˜‰zœL¨¬d°1«g©IÓ6Ñ6Ð6r+   r4   Nr•   )r5   r6   r7   r8   r9   r–   r   r!   r:   rS   r^   re   rj   rÚ   r;   r4   r+   r(   rÎ   rÎ   î  s:   † ñ3ñj ˜|Ó,€Kàñ0ó ð0ô&	5ò:ò9õ
7r+   rÎ   c                   óT   • \ rS rSrSr\" \5      r\S 5       r	S
S jr
S rS rS rSrg	)rÙ   iT  aõ  
``hermite_prob(n, x)`` gives the $n$th probabilist's Hermite polynomial
in $x$, $He_n(x)$.

Explanation
===========

The probabilist's Hermite polynomials are orthogonal on $(-\infty, \infty)$
with respect to the weight $\exp\left(-\frac{x^2}{2}\right)$. They are monic
polynomials, related to the plain Hermite polynomials (:py:class:`~.hermite`) by

.. math :: He_n(x) = 2^{-n/2} H_n(x/\sqrt{2})

Examples
========

>>> from sympy import hermite_prob, diff, I
>>> from sympy.abc import x, n
>>> hermite_prob(1, x)
x
>>> hermite_prob(5, x)
x**5 - 10*x**3 + 15*x
>>> diff(hermite_prob(n,x), x)
n*hermite_prob(n - 1, x)
>>> hermite_prob(n, -x)
(-1)**n*hermite_prob(n, x)

The sum of absolute values of coefficients of $He_n(x)$ is the number of
matchings in the complete graph $K_n$ or telephone number, A000085 in the OEIS:

>>> [hermite_prob(n,I) / I**n for n in range(11)]
[1, 1, 2, 4, 10, 26, 76, 232, 764, 2620, 9496]

See Also
========

jacobi, gegenbauer,
chebyshevt, chebyshevt_root, chebyshevu, chebyshevu_root,
legendre, assoc_legendre,
hermite,
laguerre, assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Hermite_polynomial
.. [2] https://mathworld.wolfram.com/HermitePolynomial.html
c                 óÌ  • UR                   (       d£  UR                  5       (       a   [        R                  U-  [	        X* 5      -  $ UR
                  (       a9  [        [        R                  5      [        [        R                  U-
  S-  5      -  $ U[        R                  L a  [        R                  $ g UR                  (       a  [        SU-  5        g U R                  X5      $ )NrA   z'n must be a nonnegative integer, not %r)rJ   rK   r   rL   rÙ   rE   r   rw   r   rM   rN   rb   rP   r)   r%   s      r(   rS   Úhermite_prob.eval�  s    € à�{�{Ø×)Ñ)×+Ñ+Ü—}‘} aÑ'¬,°q¸"Ó*=Ñ=Ð=Ø�y�yÜœAŸD™D“z¤E¬1¯5©5°©7°a©-Ó$8Ñ8Ð8Ø”a—j‘j’Ü—z‘zÐ!ð !ð �}�}ÜÐDÀqÑHÕIà×)Ñ)¨!Ó/Ð/r+   c                 ód   • US:X  a   U R                   u  p#U[        US-
  U5      -  $ [        X5      e)NrA   r-   )r/   rÙ   r   r‹   s       r(   r^   Úhermite_prob.fdiffŸ  s5   € Ø�q‹=Ø—9‘9‰DˆAØ”\ ! A¡# qÓ)Ñ)Ð)ä$ TÓ4Ð4r+   c           
      óä   • SSK Jn  [        S5      n[        R                  * U-  X!SU-  -
  -  -  [        U5      [        USU-  -
  5      -  -  n[        U5      U" XeS[        US-  5      45      -  $ rž   )rZ   rW   r   r   rC   r	   r   r�   s          r(   re   Ú!hermite_prob._eval_rewrite_as_Sum¦  sj   € Ý1Ü�#‹JˆÜ—‘�˜!‰|˜a A a¡C¡%™jÑ(¬I°a«L¼9ÀQÀqÈÁsÁUÓ;KÑ,KÑLˆÜ˜‹|™C ¨!¬U°1°Q±3«ZÐ&8Ó9Ñ9Ð9r+   c                 ó(   • U R                   " X40 UD6$ rh   ri   r’   s       r(   rj   Ú(hermite_prob._eval_rewrite_as_polynomial¬  r”   r+   c                 óP   • [        S5      U* -  [        X[        S5      -  5      -  $ r™   )r   rÎ   r’   s       r(   Ú_eval_rewrite_as_hermiteÚ%hermite_prob._eval_rewrite_as_hermite±  s$   € Ü�A‹w˜!˜‰}œw q¬D°«G©)Ó4Ñ4Ð4r+   r4   Nr•   )r5   r6   r7   r8   r9   r–   r   r!   r:   rS   r^   re   rj   ræ   r;   r4   r+   r(   rÙ   rÙ   T  s;   † ñ7ñr Ð0Ó1€Kàñ0ó ð0ô5ò:ò9õ
5r+   rÙ   c                   óN   • \ rS rSrSr\" \5      r\S 5       r	S	S jr
S rS rSrg)
Úlaguerreiº  a   
Returns the $n$th Laguerre polynomial in $x$, $L_n(x)$.

Examples
========

>>> from sympy import laguerre, diff
>>> from sympy.abc import x, n
>>> laguerre(0, x)
1
>>> laguerre(1, x)
1 - x
>>> laguerre(2, x)
x**2/2 - 2*x + 1
>>> laguerre(3, x)
-x**3/6 + 3*x**2/2 - 3*x + 1

>>> laguerre(n, x)
laguerre(n, x)

>>> diff(laguerre(n, x), x)
-assoc_laguerre(n - 1, 1, x)

Parameters
==========

n : int
    Degree of Laguerre polynomial. Must be `n \ge 0`.

See Also
========

jacobi, gegenbauer,
chebyshevt, chebyshevt_root, chebyshevu, chebyshevu_root,
legendre, assoc_legendre,
hermite, hermite_prob,
assoc_laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Laguerre_polynomial
.. [2] https://mathworld.wolfram.com/LaguerrePolynomial.html
.. [3] https://functions.wolfram.com/Polynomials/LaguerreL/
.. [4] https://functions.wolfram.com/Polynomials/LaguerreL3/

c                 ód  • UR                   SL a  [        S5      eUR                  (       dÇ  UR                  5       (       a6  U* S-
  R                  5       (       d  [	        U5      [        U* S-
  U* 5      -  $ UR                  (       a  [        R                  $ U[        R                  L a  [        R                  $ U[        R                  L a$  [        R                  U-  [        R                  -  $ g UR                  (       a  [	        U5      [        U* S-
  U* 5      -  $ U R                  X5      $ )NFúError: n should be an integer.r-   )r    rP   rJ   rK   r   ré   rE   r   rM   ÚNegativeInfinityrN   rL   rb   r)   r%   s      r(   rS   Úlaguerre.evalõ  sì   € à�<‰<˜5Ò ÜÐ=Ó>Ð>Ø�{�{ð ×)Ñ)×+Ñ+°Q°B¸±F×3TÑ3T×3VÑ3VÜ˜1“vœh¨ r¨A¡v°¨rÓ2Ñ2Ð2à�y�yÜ—u‘u�Ø”a×(Ñ(Ò(Ü—z‘zÐ!Ø”a—j‘j’Ü—}‘} aÑ'¬!¯*©*Ñ4Ð4ð !ð �}�}Ü˜1“vœh¨ r¨A¡v°¨rÓ2Ñ2Ð2à×)Ñ)¨!Ó/Ð/r+   c                 ó„   • US:X  a  [        X5      eUS:X  a  U R                  u  p#[        US-
  SU5      * $ [        X5      erŠ   )r   r/   Úassoc_laguerrer‹   s       r(   r^   Úlaguerre.fdiff  sG   € Ø�q‹=ä$ TÓ4Ð4Ø˜‹]à—9‘9‰DˆAÜ" 1 q¡5¨!¨QÓ/Ð/Ð/ä$ TÓ4Ð4r+   c                 ó  • SSK Jn  UR                  (       a%  [        U5      U R                  " U* S-
  U* 40 UD6-  $ UR
                  SL a  [        S5      e[        S5      n[        U* U5      [        U5      S-  -  X%-  -  nU" XeSU45      $ )Nr   rV   r-   Frë   rX   rA   )
rZ   rW   rb   r   re   r    rP   r   r
   r	   r�   s          r(   re   Úlaguerre._eval_rewrite_as_Sum  s‰   € Ý1à�=�=Ü�q“6˜D×5Ò5°q°b¸1±f¸q¸bÑKÀFÑKÑKÐKØ�<‰<˜5Ò ÜÐ=Ó>Ð>Ü�#‹JˆÜ ˜r 1Ó%¬	°!«°a©Ñ7¸!¹$Ñ>ˆÙ�4˜Q ˜Ó#Ð#r+   c                 ó(   • U R                   " X40 UD6$ rh   ri   r’   s       r(   rj   Ú$laguerre._eval_rewrite_as_polynomial"  r”   r+   r4   Nr•   )r5   r6   r7   r8   r9   r–   r   r!   r:   rS   r^   re   rj   r;   r4   r+   r(   ré   ré   º  s5   † ñ6ñp ˜}Ó-€Kàñ0ó ð0ô,	5ò	$õ9r+   ré   c                   óD   • \ rS rSrSr\S 5       rS
S jrS rS r	S r
Srg	)rï   i(  a–  
Returns the $n$th generalized Laguerre polynomial in $x$, $L_n(x)$.

Examples
========

>>> from sympy import assoc_laguerre, diff
>>> from sympy.abc import x, n, a
>>> assoc_laguerre(0, a, x)
1
>>> assoc_laguerre(1, a, x)
a - x + 1
>>> assoc_laguerre(2, a, x)
a**2/2 + 3*a/2 + x**2/2 + x*(-a - 2) + 1
>>> assoc_laguerre(3, a, x)
a**3/6 + a**2 + 11*a/6 - x**3/6 + x**2*(a/2 + 3/2) +
    x*(-a**2/2 - 5*a/2 - 3) + 1

>>> assoc_laguerre(n, a, 0)
binomial(a + n, a)

>>> assoc_laguerre(n, a, x)
assoc_laguerre(n, a, x)

>>> assoc_laguerre(n, 0, x)
laguerre(n, x)

>>> diff(assoc_laguerre(n, a, x), x)
-assoc_laguerre(n - 1, a + 1, x)

>>> diff(assoc_laguerre(n, a, x), a)
Sum(assoc_laguerre(_k, a, x)/(-a + n), (_k, 0, n - 1))

Parameters
==========

n : int
    Degree of Laguerre polynomial. Must be `n \ge 0`.

alpha : Expr
    Arbitrary expression. For ``alpha=0`` regular Laguerre
    polynomials will be generated.

See Also
========

jacobi, gegenbauer,
chebyshevt, chebyshevt_root, chebyshevu, chebyshevu_root,
legendre, assoc_legendre,
hermite, hermite_prob,
laguerre,
sympy.polys.orthopolys.jacobi_poly
sympy.polys.orthopolys.gegenbauer_poly
sympy.polys.orthopolys.chebyshevt_poly
sympy.polys.orthopolys.chebyshevu_poly
sympy.polys.orthopolys.hermite_poly
sympy.polys.orthopolys.hermite_prob_poly
sympy.polys.orthopolys.legendre_poly
sympy.polys.orthopolys.laguerre_poly

References
==========

.. [1] https://en.wikipedia.org/wiki/Laguerre_polynomial#Generalized_Laguerre_polynomials
.. [2] https://mathworld.wolfram.com/AssociatedLaguerrePolynomial.html
.. [3] https://functions.wolfram.com/Polynomials/LaguerreL/
.. [4] https://functions.wolfram.com/Polynomials/LaguerreL3/

c                 óÀ  • UR                   (       a  [        X5      $ UR                  (       d‡  UR                   (       a  [        X-   U5      $ U[        R
                  L a*  US:”  a$  [        R                  U-  [        R
                  -  $ U[        R                  L a  US:”  a  [        R
                  $ g g UR                  (       a  [        SU-  5      e[        XU5      $ )Nr   rÐ   )rE   ré   rJ   r   r   rN   rL   rì   rb   rP   r   )r&   r'   Úalphar   s       r(   rS   Úassoc_laguerre.evalo  s°   € ð �=�=Ü˜A“>Ð!à�{�{à�y�yÜ ¡	¨5Ó1Ð1Ø”a—j‘j’ Q¨£UÜ—}‘} aÑ'¬!¯*©*Ñ4Ð4Ø”a×(Ñ(Ò(¨Q°«UÜ—z‘zÐ!ð .3Ð(ð �}�}Ü ØFÈÑJóLð Lô % Q¨5Ó1Ð1r+   c                 ó  • SSK Jn  US:X  a  [        X5      eUS:X  a8  U R                  u  p4n[	        S5      nU" [        XdU5      X4-
  -  USUS-
  45      $ US:X  a#  U R                  u  p4n[        US-
  US-   U5      * $ [        X5      e)Nr   rV   r-   rA   rX   rB   )rZ   rW   r   r/   r   rï   )r1   r[   rW   r'   r÷   r   rX   s          r(   r^   Úassoc_laguerre.fdiff…  s’   € Ý1Ø�q‹=ä$ TÓ4Ð4Ø˜‹]àŸ)™)‰KˆA�aÜ�c“
ˆAÙ”~ a°Ó2°a±iÑ@À1ÀaÈÈQÉÀ-ÓPÐPØ˜‹]àŸ)™)‰KˆA�aÜ" 1 q¡5¨%°!©)°QÓ7Ð7Ð7ä$ TÓ4Ð4r+   c                 ó(  • SSK Jn  UR                  (       d  UR                  SL a  [	        S5      e[        S5      n[        U* U5      [        Xb-   S-   5      [        U5      -  -  X6-  -  n[        X-   S-   5      [        U5      -  U" XvSU45      -  $ )Nr   rV   Fra   rX   r-   )	rZ   rW   rb   r    rP   r   r
   r   r	   )r1   r'   r÷   r   rc   rW   rX   rd   s           r(   re   Ú#assoc_laguerre._eval_rewrite_as_Sum–  sŽ   € Ý1à�=�=˜AŸL™L¨EÒ1ÜÐIÓJÐJÜ�#‹JˆÜØˆB�óÜ˜A™I¨™MÓ*¬Y°q«\Ñ9ñ;Ø=>¹TñBˆä�Q‘Y ‘]Ó#¤i°£lÑ2±S¸À1Àa¸yÓ5IÑIÐIr+   c                 ó*   • U R                   " XU40 UD6$ rh   ri   )r1   r'   r÷   r   rc   s        r(   rj   Ú*assoc_laguerre._eval_rewrite_as_polynomial   s   € ð ×(Ò(¨°1Ñ?¸Ñ?Ð?r+   c                 ó|   • U R                   u  pnU R                  XR                  5       UR                  5       5      $ rh   rm   )r1   r'   r÷   r   s       r(   r2   Úassoc_laguerre._eval_conjugate¥  s-   € Ø—i‘i‰ˆ�!Ø�y‰y˜ŸO™OÓ-¨q¯{©{«}Ó=Ð=r+   r4   Nr…   ro   r4   r+   r(   rï   rï   (  s3   † ñDðL ñ2ó ð2ô*5ò"Jò@õ
>r+   rï   N)5r9   Ú
sympy.corer   Úsympy.core.functionr   r   Úsympy.core.singletonr   Úsympy.core.symbolr   Ú(sympy.functions.combinatorial.factorialsr   r	   r
   Ú$sympy.functions.elementary.complexesr   Ú&sympy.functions.elementary.exponentialr   Ú#sympy.functions.elementary.integersr   Ú(sympy.functions.elementary.miscellaneousr   Ú(sympy.functions.elementary.trigonometricr   r   Ú'sympy.functions.special.gamma_functionsr   Úsympy.functions.special.hyperr   Úsympy.polys.orthopolysr   r   r   r   r   r   r   r   r#   r   r=   rr   rH   rD   rG   r¤   r­   rF   rI   rÎ   rÙ   ré   rï   r4   r+   r(   Ú<module>r     s  ðñõ  ß CÝ "Ý #ß YÑ YÝ 3Ý 6Ý 5Ý 9ß =Ý 9Ý /÷O÷ Oó Oñ ˆ3ƒZ€ô
A˜?ô 
Aô"dIÐ!ô dIòNF.ô\R:Ð%ô R:ôrs9Ð%ô s9ôl{9Ð%ô {9ô|&)�oô &)ôR&)�oô &)ôZq9Ð#ô q9ôhn:�_ô n:ôjc7Ð"ô c7ôL^5Ð'ô ^5ôLk9Ð#ô k9ô\>Ð)õ >r+   