
    \h&                        S r SSKJrJr  SSKJr  SSKJrJr  SSK	J
r
  SSKJrJrJrJr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  SSKJrJr  SSKJ r J!r!J"r"  SSK#J$r$J%r%  SSK&J'r'J(r(J)r)J*r*  SSK+J,r,  SSK-J.r.J/r/J0r0  SSK1J2r2  SSK3J4r4J5r5J6r6J7r7  SSK8J9r9  SSK:J;r;  SSK<J=r=  SSK>J?r?  SSK@JArAJBrB  SSKCJDrD  SSKEJFrFJGrGJHrHJIrIJJrJ  SSKKJLrL  SSKMJNrNJOrO  SSKPJQrQ  SSKRJSrS  SSKTJUrU   " S  S!\V5      rW " S" S#\5      rXS$ rYS% rZ\Z" S&5      r[S' r\\[\\S(4S) j5       r] " S* S+\X5      r^S, r_S- r` " S. S/\a5      rbS0 rc\Z" S(5      SWS1 j5       rdS2qe " S3 S4\X5      rfS5 rg\Z" S(5      SXS6 j5       rh " S7 S8\X5      ri " S9 S:\i5      rjS; rk " S< S=\i5      rlS> rm\Z" S(5      SXS? j5       rn " S@ SA\X5      ro " SB SC\o5      rpSD rq " SE SF\o5      rrSG rs " SH SI\o5      rtSJ ru " SK SL\o5      rvSM rw\Z" S(5      SXSN j5       rx " SO SP\X5      ry " SQ SR\y5      rzSS r{ " ST SU\y5      r|SV r}SS2K~Js  Jr  \GR                  r\GR                  r\GR                  r\GR
                  r\GR                  r\GR                  rg2)YzIntegral Transforms     )reducewraps)repeat)Spi)Add)AppliedUndef	count_opsexpand
expand_mulFunction)Mul)igcdilcm)default_sort_key)Dummy)postorder_traversal)	factorialrf)reargAbs)exp	exp_polar)coshcothsinhtanh)ceiling)MaxMinsqrt)piecewise_fold)coscotsintan)besselj)	Heaviside)gamma)meijerg)	integrateIntegral)_dummy)to_cnf	conjuncts	disjunctsOrAnd)roots)factorPoly)CRootOf)iterable)debugc                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )IntegralTransformError(   av  
Exception raised in relation to problems computing transforms.

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

This class is mostly used internally; if integrals cannot be computed
objects representing unevaluated transforms are usually returned.

The hint ``needeval=True`` can be used to disable returning transform
objects, and instead raise this exception if an integral cannot be
computed.
c                 @   > [         TU ]  U< SU< S35        X l        g )Nz" Transform could not be computed: .)super__init__function)self	transformrA   msg	__class__s       R/var/www/auris/envauris/lib/python3.13/site-packages/sympy/integrals/transforms.pyr@   IntegralTransformError.__init__6   s    9BCH	J     )rA   )__name__
__module____qualname____firstlineno____doc__r@   __static_attributes____classcell__)rE   s   @rF   r;   r;   (   s    ! !rH   r;   c                       \ rS rSrSr\S 5       r\S 5       r\S 5       r\S 5       r	S r
S rS	 rS
 rS r\S 5       rS rSrg)IntegralTransform<   aE  
Base class for integral transforms.

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

This class represents unevaluated transforms.

To implement a concrete transform, derive from this class and implement
the ``_compute_transform(f, x, s, **hints)`` and ``_as_integral(f, x, s)``
functions. If the transform cannot be computed, raise :obj:`IntegralTransformError`.

Also set ``cls._name``. For instance,

>>> from sympy import LaplaceTransform
>>> LaplaceTransform._name
'Laplace'

Implement ``self._collapse_extra`` if your function returns more than just a
number and possibly a convergence condition.
c                      U R                   S   $ )z The function to be transformed. r   argsrB   s    rF   rA   IntegralTransform.functionS        yy|rH   c                      U R                   S   $ )z:The dependent variable of the function to be transformed.    rT   rV   s    rF   function_variable#IntegralTransform.function_variableX   rX   rH   c                      U R                   S   $ )z$The independent transform variable.    rT   rV   s    rF   transform_variable$IntegralTransform.transform_variable]   rX   rH   c                 ~    U R                   R                  R                  U R                  15      U R                  1-
  $ )zR
This method returns the symbols that will exist when the transform
is evaluated.
)rA   free_symbolsunionr_   r[   rV   s    rF   rb   IntegralTransform.free_symbolsb   s;     }}))//1H1H0IJ%%&' 	'rH   c                     [         eNNotImplementedErrorrB   fxshintss        rF   _compute_transform$IntegralTransform._compute_transformk       !!rH   c                     [         erf   rg   rB   rj   rk   rl   s       rF   _as_integralIntegralTransform._as_integraln   rp   rH   c                 d    [        U6 nUS:X  a!  [        U R                  R                  S S5      eU$ )NF )r3   r;   rE   name)rB   extraconds      rF   _collapse_extra!IntegralTransform._collapse_extraq   s0    E{5=()<)<dBGGrH   c                 |  ^  S n[        U 4S jT R                  R                  [        5       5       5      (       + nU(       a4   T R                  " T R                  T R
                  T R                  40 UD6nT R                  nUR                  (       d  [        U5      nXB4$ ! [         a    [        S5        S n NDf = f)Nc              3   Z   >#    U  H   nUR                  TR                  5      v   M"     g 7frf   )hasr[   ).0funcrB   s     rF   	<genexpr>2IntegralTransform._try_directly.<locals>.<genexpr>y   s+      N+L4  $xx(>(>??+Ls   (+z6[IT _try ] Caught IntegralTransformError, returns None)anyrA   atomsr	   rn   r[   r_   r;   r9   is_Addr   )rB   rm   Ttry_directlyfns   `    rF   _try_directlyIntegralTransform._try_directlyw   s     N+/==+>+>|+LN N N++DMM**D,C,CNGLN ]]yyBBu * NOs   3B! !B;:B;c                 2   UR                  SS5      nUR                  SS5      nX1S'   U R                  " S	0 UD6u  pEUb  U$ UR                  (       Ga0  X!S'   UR                   Vs/ s H<  nU R                  " U/[        U R                  SS 5      -   6 R                  " S	0 UD6PM>     nn/ n/ n	U Hm  n[        U[        5      (       d  U/nU	R                  US   5        [        U5      S:X  a  UR                  US   5        MT  [        U5      S:  d  Me  XSS /-  nMo     US:X  a  [        U	6 R                  5       nO[        U	6 nU(       d  U$  U R                  U5      n[        U5      (       a  U4[        U5      -   $ Xx4$ U(       a+  [        U R                  R                   U R"                  S5      eUR%                  U R&                  5      u  pXR                  " [)        U6 /[        U R                  SS 5      -   6 -  $ s  snf ! [         a     Nf = f)
a]  
Try to evaluate the transform in closed form.

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

This general function handles linearity, but apart from that leaves
pretty much everything to _compute_transform.

Standard hints are the following:

- ``simplify``: whether or not to simplify the result
- ``noconds``: if True, do not return convergence conditions
- ``needeval``: if True, raise IntegralTransformError instead of
                returning IntegralTransform objects

The default values of these hints depend on the concrete transform,
usually the default is
``(simplify, noconds, needeval) = (True, False, False)``.
needevalFsimplifyTNrZ   r   r^    )popr   r   rU   rE   listdoit
isinstancetupleappendlenr   r   rz   r8   r;   _namerA   as_coeff_mulr[   r   )rB   rm   r   r   r   r   rk   resrx   resscoeffrests               rF   r   IntegralTransform.doit   s   * 99Z/99Z.$j""+U+=H999 (*GG%#q >>QC$tyy}*=$=?DDMuM#  %ED!!U++AAaD!q6Q;LL1&VaZeW$E  ~4j))+4j
,,U3E??6E%L00<' ($$dmmZA A ood&<&<=^^sDzlT$))AB-5H&HJJJK%4 * s   &AH/H	 H	 	
HHc                 d    U R                  U R                  U R                  U R                  5      $ rf   )rs   rA   r[   r_   rV   s    rF   as_integralIntegralTransform.as_integral   s,      0F0F!%!8!8: 	:rH   c                     U R                   $ rf   )r   )rB   rU   kwargss      rF   _eval_rewrite_as_Integral+IntegralTransform._eval_rewrite_as_Integral   s    rH   r   N)rI   rJ   rK   rL   rM   propertyrA   r[   r_   rb   rn   rs   rz   r   r   r   r   rN   r   rH   rF   rQ   rQ   <   s    ,       ' '"""EKN : : rH   rQ   c                 X    U(       a"  SSK Jn  SSKJn  U" U" [	        U 5      SS95      $ U $ )Nr   )r   )	powdenestT)polar)sympy.simplifyr   sympy.simplify.powsimpr   r#   )exprr   r   r   s       rF   	_simplifyr      s'    +4	."6dCDDKrH   c                    ^  U 4S jnU$ )a&  
This is a decorator generator for dropping convergence conditions.

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

Suppose you define a function ``transform(*args)`` which returns a tuple of
the form ``(result, cond1, cond2, ...)``.

Decorating it ``@_noconds_(default)`` will add a new keyword argument
``noconds`` to it. If ``noconds=True``, the return value will be altered to
be only ``result``, whereas if ``noconds=False`` the return value will not
be altered.

The default value of the ``noconds`` keyword will be ``default`` (i.e. the
argument of this function).
c                 :   >^  [        T 5      TS.U 4S jj5       nU$ )Nnocondsc                 0   > T" U0 UD6nU (       a  US   $ U$ Nr   r   )r   rU   r   r   r   s       rF   wrapper0_noconds_.<locals>.make_wrapper.<locals>.wrapper   s#    ''C1vJrH   )r   )r   r   defaults   ` rF   make_wrapper_noconds_.<locals>.make_wrapper   s#    	t#* 	 
	
 rH   r   )r   r   s   ` rF   	_noconds_r      s    $ rH   Fc                 V    [        X[        R                  [        R                  45      $ rf   )r,   r   ZeroInfinity)rj   rk   s     rF   _default_integratorr     s    QAFFAJJ/00rH   Tc                   ^ [        SSU 5      mU" UTS-
  -  U -  U5      nUR                  [        5      (       dK  [        UR	                  TU5      U5      [
        R                  [
        R                  4[
        R                  4$ UR                  (       d  [        SU S5      eUR                  S   u  pVUR                  [        5      (       a  [        SU S5      eU4S jn[        U5       Vs/ s H
  o" U5      PM     n	nU	 Vs/ s H  oS	   S
:w  d  M  UPM     n	nU	R                  S S9  U	(       d  [        SU S5      eU	S   u  pn[        UR	                  TU5      U5      X4U4$ s  snf s  snf )z/Backend function to compute Mellin transforms. rl   zmellin-transformrZ   Mellincould not compute integralr   integral in unexpected formc                   > SSK Jn  [        R                  n[        R                  n[        R
                  n[        [        U 5      5      n[        SSS9nU GH  n[        R                  n[        R                  n	/ n
[        U5       H  nUR                  [        S 5      R                  [        T5      U5      nUR                  (       a<  UR                  S;   d,  UR                  T5      (       d  UR                  U5      (       d  X/-  n
M  U" X5      nUR                  (       a  UR                  S;   a  X/-  n
M  UR                   U:X  a  [#        UR$                  U	5      n	M  ['        UR                   U5      nM     U[        R                  La  X:w  a  [#        X5      nGMP  U	[        R                  La  X:w  a  ['        X5      nGMv  [)        U[+        U
6 5      nGM     X#U4$ )z>
Turn ``cond`` into a strip (a, b), and auxiliary conditions.
r   )_solve_inequalitytT)realc                 (    U R                  5       S   $ r   )as_real_imagrk   s    rF   <lambda>:_mellin_transform.<locals>.process_conds.<locals>.<lambda>)  s    !.."21"5rH   )z==z!=)sympy.solvers.inequalitiesr   r   NegativeInfinityr   truer0   r/   r   r1   replacer   subsis_Relationalrel_opr~   ltsr    gtsr!   r3   r2   )ry   r   abauxcondsr   ca_b_aux_dd_solnrl   s                 rF   process_conds(_mellin_transform.<locals>.process_conds  sw    	AJJff&,'#D!AB##BDq\YY577;tBqE1~ HH,66!99BFF1IICKD(/))|3CKD88q=TXXr*BTXXr*B! "" #J1---"'J#r4y)5 6 SyrH   r^   Fc                 4    U S   U S   -
  [        U S   5      4$ )Nr   rZ   r^   )r
   r   s    rF   r   #_mellin_transform.<locals>.<lambda>B  s    adQqTk9QqT?;rH   keyzno convergence found)r.   r~   r-   r   r   r   r   r   r   is_Piecewiser;   rU   r1   sort)rj   rk   s_
integratorr   Fry   r   r   r   r   r   r   rl   s                @rF   _mellin_transformr     sM   
 	s&*A1q1u:>1%A55??21A4F4F

3SUVU[U[[[>>$Xq2NOOffQiGAuuX$a68 	8%N (17!]1E7/11QE/	JJ;J<$Xq2HIIaIA#QVVAr]H-vs:: 8/s   /E*E/E/c                   .    \ rS rSrSrSrS rS rS rSr	g)	MellinTransformiK  z
Class representing unevaluated Mellin transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute Mellin transforms, see the :func:`mellin_transform`
docstring.
r   c                     [        XU40 UD6$ rf   )r   ri   s        rF   rn   "MellinTransform._compute_transformW  s     q2E22rH   c                 h    [        XUS-
  -  -  U[        R                  [        R                  45      $ NrZ   )r-   r   r   r   rr   s       rF   rs   MellinTransform._as_integralZ  s(    a!e*q!&&!**&=>>rH   c                     / n/ n/ nU H  u  u  pVnX%/-  nX6/-  nXG/-  nM     [        U6 [        U6 4[        U6 4nUS   S   US   S   :  S:X  d	  US   S:X  a  [        SS S5      eU$ )Nr   rZ   TFr   zno combined convergence.)r    r!   r3   r;   )	rB   rx   r   r   ry   sasbr   r   s	            rF   rz   MellinTransform._collapse_extra]  s     KHRaIAIACKD ! AwQ #t*,F1IQ"t+s1v($ :< <
rH   r   N)
rI   rJ   rK   rL   rM   r   rn   rs   rz   rN   r   rH   rF   r   r   K  s     E3?rH   r   c                 :    [        XU5      R                  " S0 UD6$ )a  
Compute the Mellin transform `F(s)` of `f(x)`,

.. math :: F(s) = \int_0^\infty x^{s-1} f(x) \mathrm{d}x.

For all "sensible" functions, this converges absolutely in a strip
  `a < \operatorname{Re}(s) < b`.

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

The Mellin transform is related via change of variables to the Fourier
transform, and also to the (bilateral) Laplace transform.

This function returns ``(F, (a, b), cond)``
where ``F`` is the Mellin transform of ``f``, ``(a, b)`` is the fundamental strip
(as above), and ``cond`` are auxiliary convergence conditions.

If the integral cannot be computed in closed form, this function returns
an unevaluated :class:`MellinTransform` object.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`. If ``noconds=False``,
then only `F` will be returned (i.e. not ``cond``, and also not the strip
``(a, b)``).

Examples
========

>>> from sympy import mellin_transform, exp
>>> from sympy.abc import x, s
>>> mellin_transform(exp(-x), x, s)
(gamma(s), (0, oo), True)

See Also
========

inverse_mellin_transform, laplace_transform, fourier_transform
hankel_transform, inverse_hankel_transform
r   )r   r   )rj   rk   rl   rm   s       rF   mellin_transformr   l  s     R 1#((1511rH   c                     U u  pE[        U[        -  5      n[        U[        -  5      n[        U* U-  UR                  5       S   -
  5      n[	        XA-  U-   U-   5      [	        SU-
  U-
  XA-  -
  5      SU-  [        -  4$ )a,  
Re-write the sine function ``sin(m*s + n)`` as gamma functions, compatible
with the strip (a, b).

Return ``(gamma1, gamma2, fac)`` so that ``f == fac/(gamma1 * gamma2)``.

Examples
========

>>> from sympy.integrals.transforms import _rewrite_sin
>>> from sympy import pi, S
>>> from sympy.abc import s
>>> _rewrite_sin((pi, 0), s, 0, 1)
(gamma(s), gamma(1 - s), pi)
>>> _rewrite_sin((pi, 0), s, 1, 0)
(gamma(s - 1), gamma(2 - s), -pi)
>>> _rewrite_sin((pi, 0), s, -1, 0)
(gamma(s + 1), gamma(-s), -pi)
>>> _rewrite_sin((pi, pi/2), s, S(1)/2, S(3)/2)
(gamma(s - 1/2), gamma(3/2 - s), -pi)
>>> _rewrite_sin((pi, pi), s, 0, 1)
(gamma(s), gamma(1 - s), -pi)
>>> _rewrite_sin((2*pi, 0), s, 0, S(1)/2)
(gamma(2*s), gamma(1 - 2*s), pi)
>>> _rewrite_sin((2*pi, 0), s, S(1)/2, 1)
(gamma(2*s - 1), gamma(2 - 2*s), -pi)
r   rZ   )r   r   r   r   r*   )m_nrl   r   r   mnrs          rF   _rewrite_sinr     s    J DA1R4A1R4A1q~~'**+Aq1uQUQY_5QwrzAArH   c                       \ rS rSrSrSrg)MellinTransformStripErrori  z>
Exception raised by _rewrite_gamma. Mainly for internal use.
r   N)rI   rJ   rK   rL   rM   rN   r   rH   rF   r   r     s     	rH   r   c           
      (  ^ ^^/^0^1^2 [        X#/5      u  m/m0U/U04S jn/ nT R                  [        5       Hi  nUR                  T5      (       d  M  UR                  S   nUR
                  (       a  UR                  " T5      S   nUR                  " T5      u  pXX/-  nMk     T R                  [        [        [        [        5       Hp  nUR                  T5      (       d  M  UR                  S   nUR
                  (       a  UR                  " T5      S   nUR                  " T5      u  pXX[        -  /-  nMr     U V
s/ s H   oR                  (       a  [        U
5      OU
PM"     nn
[         R                  nU H  n
U
R                   (       a  M  U
n  O   U V
s/ s H  oU-  PM	     nn
[#        S U 5       5      (       a  UR                  (       d  [%        SSS5      eU['        [(        U V
s/ s H  n
[        U
R*                  5      PM     sn
[         R                  5      -  nX:X  aI  [-        U5      S:X  a  UnO7U['        [.        U V
s/ s H  n
[        U
R0                  5      PM     sn
5      -  nT R3                  TTU-  5      m [         R                  U-  n[         R                  U-  nT/b  T/U-  m/T0b  T0U-  m0T R5                  5       u  nn[6        R8                  " U5      n[6        R8                  " U5      n[;        [=        U[?        S5      5      5      [;        [=        U[?        S	5      5      5      -   n/ n/ n/ n/ n/ nU 4S
 jm1U(       Gag  URA                  5       u  m2nU(       a  UUnnUnOUUnnUnU1U2U4S jnT2R                  T5      (       d  UT2/-  nGOT2RB                  (       d  [E        T2[F        5      (       a  T2RB                  (       a  T2RH                  nT2RF                  nO[K        S5      nT2RF                  nURL                  (       a%  UnUS:  a  U(       + nUUU4/[        U5      -  -  nM  UR                  T5      (       d*  U" U5      u  p#U(       d  SU-  nUUU-  /-  nUUU-  /-  nGO3T1" T25      eT2RO                  T5      (       Ga-  [Q        T2T5      nURS                  5       S:w  av  URU                  5       S   n[W        UT5      n [-        U 5      URS                  5       :w  a  [X        RZ                  " U5      n UU/-  nUU  V!s/ s H
  n!TU!-
  U4PM     sn!-  nGM  UR]                  5       u  nn!UU/-  nU!U* -  n!U" U!U5      (       a3  U[         R                  U!* S-   4/-  nU[         R                  U!* 4/-  nGOUS/-  nU[         R^                  U!S-   4/-  nU[         R^                  U!4/-  nGO[E        T2[        5      (       a`  U" T2R                  S   5      u  p#U(       a9  US:  a  U" U* U-  U5      S	:X  d  US:  a  U" U* U-  U5      S:X  a  [a        S5      eUX#4/-  nGOr[E        T2[        5      (       ax  T2R                  S   nU(       a.  [        U[        -  5      [        SU[        -  -
  5      [        n$n#n"O[c        U" U5      TT/T05      u  n"n#n$UU"U(       + 4U#U(       + 4/-  nUU$/-  nO[E        T2[        5      (       a:  T2R                  S   nU[        US	S9U4[        [        S-  U-
  S	S9U(       + 4/-  nO[E        T2[        5      (       a*  T2R                  S   nU[        [        S-  U-
  S	S9U4/-  nOW[E        T2[        5      (       a:  T2R                  S   nU[        [        S-  U-
  S	S9U4[        US	S9U(       + 4/-  nOT1" T25      eU(       a  GMg  U[7        U6 [7        U6 -  -  n/ / / / 4u  n%n&n'n(UU%U'S4UU(U&S	44 GH6  u  n)n*n+nU)(       d  M  U)RA                  5       u  nn!US:w  a  US:w  a  [        [        U5      5      nUU-  n,U!U-  n-URL                  (       d  [e        S5      e[g        U5       H  n.U)U,U-U.U-  -   4/-  n)M     U(       a6  US[        -  SU-
  S-  -  UU![         Rh                  -
  -  -  -  nUUU-  /-  nO6US[        -  SU-
  S-  -  UU![         Rh                  -
  -  -  -  nUUU* -  /-  nM  US:X  a  U*Rk                  SU!-
  5        OU+Rk                  U!5        U)(       a  GM$  GM9     [7        U6 nU%Rm                  [n        S9  U&Rm                  [n        S9  U'Rm                  [n        S9  U(Rm                  [n        S9  U%U&4U'U(4X~U4$ s  sn
f s  sn
f s  sn
f s  sn
f s  sn!f )a8  
Try to rewrite the product f(s) as a product of gamma functions,
so that the inverse Mellin transform of f can be expressed as a meijer
G function.

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

Return (an, ap), (bm, bq), arg, exp, fac such that
G((an, ap), (bm, bq), arg/z**exp)*fac is the inverse Mellin transform of f(s).

Raises IntegralTransformError or MellinTransformStripError on failure.

It is asserted that f has no poles in the fundamental strip designated by
(a, b). One of a and b is allowed to be None. The fundamental strip is
important, because it determines the inversion contour.

This function can handle exponentials, linear factors, trigonometric
functions.

This is a helper function for inverse_mellin_transform that will not
attempt any transformations on f.

Examples
========

>>> from sympy.integrals.transforms import _rewrite_gamma
>>> from sympy.abc import s
>>> from sympy import oo
>>> _rewrite_gamma(s*(s+3)*(s-1), s, -oo, oo)
(([], [-3, 0, 1]), ([-2, 1, 2], []), 1, 1, -1)
>>> _rewrite_gamma((s-1)**2, s, -oo, oo)
(([], [1, 1]), ([2, 2], []), 1, 1, 1)

Importance of the fundamental strip:

>>> _rewrite_gamma(1/s, s, 0, oo)
(([1], []), ([], [0]), 1, 1, 1)
>>> _rewrite_gamma(1/s, s, None, oo)
(([1], []), ([], [0]), 1, 1, 1)
>>> _rewrite_gamma(1/s, s, 0, None)
(([1], []), ([], [0]), 1, 1, 1)
>>> _rewrite_gamma(1/s, s, -oo, 0)
(([], [1]), ([0], []), 1, 1, -1)
>>> _rewrite_gamma(1/s, s, None, 0)
(([], [1]), ([0], []), 1, 1, -1)
>>> _rewrite_gamma(1/s, s, -oo, None)
(([], [1]), ([0], []), 1, 1, -1)

>>> _rewrite_gamma(2**(-s+3), s, -oo, oo)
(([], []), ([], []), 1/2, 1, 8)
c                 0  > [        [        U 5      5      n Tc  T[        R                  L a  gTc  U T:  $ Tc  U T:*  $ U T:  S:X  a  gU T:*  S:X  a  gU(       a  gTR                  (       d"  TR                  (       d  U R                  (       a  g[        S5      e)zE
Decide whether pole at c lies to the left of the fundamental strip.
NTFzPole inside critical strip?)r   r   r   r   rb   r   )r   is_numerr   r   s     rF   left_rewrite_gamma.<locals>.left  s    
 2a5M:"

*:r6M:7NGG??boo ((EFFrH   r   rZ   c              3   8   #    U  H  oR                   v   M     g 7frf   )is_Rational)r   rk   s     rF   r   !_rewrite_gamma.<locals>.<genexpr>?  s     5}!}s   GammaNzNonrational multiplierTFc                 $   > [        STSU -  5      $ )NInverse MellinzUnrecognised form '%s'.)r;   )factrj   s    rF   	exception!_rewrite_gamma.<locals>.exceptiona  s    %&6;TW[;[\\rH   c                    > U R                   " T5      (       d  T" T5      e[        U T5      nUR                  5       S:w  a  T" T5      eUR                  5       $ )z6Test if arg is of form a*s+b, raise exception if not. rZ   )is_polynomialr6   degree
all_coeffs)r   pr  r
  rl   s     rF   
linear_arg"_rewrite_gamma.<locals>.linear_argl  sL    $$Q''o%S!AxxzQo%<<>!rH   r   z Gammas partially over the strip.)evaluater^   za is not an integerr   )8r   r   r*   r~   rU   r   as_independentr   r&   r$   r'   r%   r   is_extended_realr   Oner  allr;   r   r   qr   r   r  r   as_numer_denomr   	make_argsr   zipr   r   is_Powr   r   baser   
is_Integerr  r6   r  LTr4   r7   	all_rootsr  NegativeOnerh   r   	TypeErrorrangeHalfr   r   r   )3rj   rl   r   r   r  s_multipliersgr   r   _rk   common_coefficients_multiplierfacexponentnumerdenomrU   facsdfacsnumer_gammasdenom_gammasexponentialsr  ugammaslgammasufacsr  r  exp_ry   r  rsr   gamma1gamma2fac_anapbmbqgammasplusminusnewanewckr   r   r  r
  s3   ``                                             @@@@rF   _rewrite_gammarF    s	   ~ vYFBG4 MWWU^uuQxxffQi::$$Q'*C##A&   WWS#sC(uuQxxffQi::$$Q'*C##A&(# ) CPP-Q11SVq8-MP}}}!"  4AA=a))=MA5}555//$Wd4LMM%fT6C4E6C 56accF6C4EFGee'M ML)}"-L-}=}!qv}=>?L 	
q!L.!A
%%
Cuu\!H	~
l	~
l ##%LE5MM% EMM% EE6$<()DUF5M1J,KKDDELLL]
h+\WGE+\WGE	" xx{{dVOE[[JtS11{{yyxx |xx!8#8D$s4y00XXa[[!$'T6Dq	)q	!o%""T1AxxzQ q	1a[r7ahhj( **1-B% B7Bq!a%*B77<<>DAqaSLE!GAAx  QUUQBFO,,QUUQBK=("Q]]AE233Q]]A.//e$$diil+DAEtQBqD(3u<EtQBqD(3t;-:< <xGc"" 		!A',QrT{E!ad(OR'3JqM1b"'M$f(l+f(l-CDDDdVOEc""		!Ac!e,h7"Q$(U3\BD DDc""		!Ac"Q$(U3X>??Dc""		!Ac"Q$(U3X>!e,(l;= =D D/!M $P 3:c5k!!C R^NBB+7R*F+7R*G*I%eXf::<DAqBw17!Iss||#$9::qAdQqSj122F "AbDQUAI.QZ@@C QTF*LAbDQUAI.QZ@@C Q!WI-LBwAE"Q+ f*I: |
C GG G!GG G!GG G!GG G!8b"Xsc11y Q B4E >b 8s   ='e;f ,f	f
fc                     [        SSU SS9nU R                  [        5      n [        U 5      [	        U 5      [        U 5      4 GHn  nUR                  (       a  UR                   Vs/ s H  n[        XqXSUSS9PM     nnU V	s/ s H  oS   PM	     n
n	U V	s/ s H  oS   PM	     nn	[        U6 nU(       d  [        XR                  [        5      S	9nUR                  XR5      [        U
6 4s  $  [        XaUS   US   5      u  ppn [!        XXU-  -  5      nU(       a  UnO SS
KJn  U" U5      nUR*                  (       a  [-        UR                  5      S:X  ai  [        U[/        U5      -
  5      UR                  S   R                  S   -  [        [/        U5      U-
  5      UR                  S   R                  S   -  -   n[/        [1        UR2                  5      5      UR4                  [6        -  :  /nU[        [9        [-        UR:                  5      [-        UR<                  5      :g  S[?        UR@                  5      S-   :  5      [/        [1        UR2                  5      5      UR4                  [6        -  :H  5      /-  n[9        U6 nUS:X  a  [        SU S5      eUU-  R                  XR5      U4s  $    [        SU S5      es  snf s  sn	f s  sn	f ! [         a     GM  f = f! ["         a     GM  f = f! [(         a    [        SU S5      ef = f)zjA helper for the real inverse_mellin_transform function, this one here
assumes x to be real and positive. r   zinverse-mellin-transformT)positiveFr   rZ   r   )gens)hyperexpandr	  zCould not calculate integral   zdoes not convergerv   )!r.   rewriter*   r5   r   r   r   rU   _inverse_mellin_transformr   r   r)   r   r3   rF  r;   r+   
ValueErrorr   rJ  rh   r   r   r   r   argumentdeltar   r2   r=  r?  r   nu)r   rl   x_strip
as_meijergrk   r'  Gr   r  r   r   r   r   Cer+  hrJ  ry   s                       rF   rM  rM    s    	s.DAA 	
		%AQiAq	288 VV%# .aAj6;=#  % $((4aqT4E("&'$QaD$D't*CSyy';<88A?CK//	,Q58U1XFOA!	a1f%A AI6N
 ~~#aff+"2a#a&j)!&&)..*;;A
+AFF1INN1,==>
 C

O$qwwrz12 	RADD	SY.RX\0ABQZZ)QWWRZ79 : 	:4y5=( !%8: :#||A"D((_ 3b !!11b
99]% )' & 		  		 ' I,$a)GI IIsB   %KKK,KK# K5
K K #
K21K25LNc                   ^    \ rS rSrSrSr\" S5      r\" S5      rS r	\
S 5       rS rS	 rS
rg)InverseMellinTransformi5  z
Class representing unevaluated inverse Mellin transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute inverse Mellin transforms, see the
:func:`inverse_mellin_transform` docstring.
r	  Noner   c                     Uc  [         R                  nUc  [         R                  n[        R                  " XX#XE40 UD6$ rf   )rZ  _none_sentinelrQ   __new__)clsr   rl   rk   r   r   optss          rF   r^  InverseMellinTransform.__new__C  s<    9&55A9&55A ((qDtDDrH   c                     U R                   S   U R                   S   p!U[        R                  L a  S nU[        R                  L a  S nX4$ )NrK     )rU   rZ  r]  )rB   r   r   s      rF   fundamental_strip(InverseMellinTransform.fundamental_stripJ  sH    yy|TYYq\1&555A&555AtrH   c                    UR                  SS5        [        c>  [        [        [        [
        [        [        [        [        [        [        [        [        1q[        U5       HR  nUR                  (       d  M  UR!                  U5      (       d  M.  UR"                  [        ;  d  MD  [%        SUSU-  5      e   U R&                  n[)        XX640 UD6$ )Nr   Tr	  zComponent %s not recognised.)r   _allowedr   r*   r&   r$   r'   r%   r   r   r   r   r   r   r   is_Functionr~   r   r;   rd  rM  )rB   r   rl   rk   rm   rj   rS  s          rF   rn   )InverseMellinTransform._compute_transformS  s     			*d#UCc3dD$2H %Q'A}}}qaffH.D,-=q%Ca%GI I ( &&(qA5AArH   c                 (   U R                   R                  n[        XU* -  -  X$[        R                  [        R
                  -  -
  U[        R                  [        R
                  -  -   45      S[        R                  -  [        R                  -  -  $ Nr^   )rE   _cr-   r   ImaginaryUnitr   Pi)rB   r   rl   rk   r   s        rF   rs   #InverseMellinTransform._as_integralc  sv    NNqb'	A1??1::+E'Eq$%OOAJJ$>H? $@ ABCADD&BXZ 	ZrH   r   N)rI   rJ   rK   rL   rM   r   r   r]  rl  r^  r   rd  rn   rs   rN   r   rH   rF   rZ  rZ  5  sF     E6]N	sBE  B ZrH   rZ  c                 H    [        XX#S   US   5      R                  " S0 UD6$ )a  
Compute the inverse Mellin transform of `F(s)` over the fundamental
strip given by ``strip=(a, b)``.

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

This can be defined as

.. math:: f(x) = \frac{1}{2\pi i} \int_{c - i\infty}^{c + i\infty} x^{-s} F(s) \mathrm{d}s,

for any `c` in the fundamental strip. Under certain regularity
conditions on `F` and/or `f`,
this recovers `f` from its Mellin transform `F`
(and vice versa), for positive real `x`.

One of `a` or `b` may be passed as ``None``; a suitable `c` will be
inferred.

If the integral cannot be computed in closed form, this function returns
an unevaluated :class:`InverseMellinTransform` object.

Note that this function will assume x to be positive and real, regardless
of the SymPy assumptions!

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`.

Examples
========

>>> from sympy import inverse_mellin_transform, oo, gamma
>>> from sympy.abc import x, s
>>> inverse_mellin_transform(gamma(s), s, x, (0, oo))
exp(-x)

The fundamental strip matters:

>>> f = 1/(s**2 - 1)
>>> inverse_mellin_transform(f, s, x, (-oo, -1))
x*(1 - 1/x**2)*Heaviside(x - 1)/2
>>> inverse_mellin_transform(f, s, x, (-1, 1))
-x*Heaviside(1 - x)/2 - Heaviside(x - 1)/(2*x)
>>> inverse_mellin_transform(f, s, x, (1, oo))
(1/2 - x**2/2)*Heaviside(1 - x)/x

See Also
========

mellin_transform
hankel_transform, inverse_hankel_transform
r   rZ   r   )rZ  r   )r   rl   rk   rS  rm   s        rF   inverse_mellin_transformrq  i  s*    j "!8U1X>CCLeLLrH   c                    [        X0-  [        U[        R                  -  U-  U-  5      -  U[        R                  [        R
                  45      nUR                  [        5      (       d  [        Xv5      [        R                  4$ [        X[        R                  [        R
                  45      nU[        R                  [        R
                  [        R                  4;   d  UR                  [        5      (       a  [        XPS5      eUR                  (       d  [        XPS5      eUR                  S   u  pyUR                  [        5      (       a  [        XPS5      e[        Xv5      U	4$ )z
Compute a general Fourier-type transform

.. math::

    F(k) = a \int_{-\infty}^{\infty} e^{bixk} f(x)\, dx.

For suitable choice of *a* and *b*, this reduces to the standard Fourier
and inverse Fourier transforms.
z$function not integrable on real axisr   r   r   )r,   r   r   rm  r   r   r~   r-   r   r   NaNr;   r   rU   )
rj   rk   rE  r   r   rw   r   r   
integral_fry   s
             rF   _fourier_transformru    s    	!#c!AOO+A-a/001a6H6H!**2UVA55??%qvv--1!"4"4ajjABJa((!**aee<<
x@X@X$T.TUU>>$T.JKKffQiGAuuX$T.KLLQ!4''rH   c                   0    \ rS rSrSrS rS rS rS rSr	g)	FourierTypeTransformi  z"Base class for Fourier transforms.c                 2    [        SU R                  -  5      eNz,Class %s must implement a(self) but does notrh   rE   rV   s    rF   r   FourierTypeTransform.a      !:T^^KM 	MrH   c                 2    [        SU R                  -  5      eNz,Class %s must implement b(self) but does notrz  rV   s    rF   r   FourierTypeTransform.b  r|  rH   c                     [        XUU R                  5       U R                  5       U R                  R                  40 UD6$ rf   )ru  r   r   rE   r   rB   rj   rk   rE  rm   s        rF   rn   'FourierTypeTransform._compute_transform  s<    !!"&&&(DFFH"&.."6"6A:?A 	ArH   c                     U R                  5       nU R                  5       n[        XA-  [        U[        R
                  -  U-  U-  5      -  U[        R                  [        R                  45      $ rf   )r   r   r-   r   r   rm  r   r   )rB   rj   rk   rE  r   r   s         rF   rs   !FourierTypeTransform._as_integral  sX    FFHFFHC!// 1! 3A 566A<N<NPQPZPZ8[\\rH   r   N
rI   rJ   rK   rL   rM   r   r   rn   rs   rN   r   rH   rF   rw  rw    s    -MMA
]rH   rw  c                   (    \ rS rSrSrSrS rS rSrg)FourierTransformi  z
Class representing unevaluated Fourier transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute Fourier transforms, see the :func:`fourier_transform`
docstring.
Fourierc                     gr   r   rV   s    rF   r   FourierTransform.a      rH   c                 (    S[         R                  -  $ )Nr   rn  rV   s    rF   r   FourierTransform.b  s    !$$wrH   r   N	rI   rJ   rK   rL   rM   r   r   r   rN   r   rH   rF   r  r    s     ErH   r  c                 :    [        XU5      R                  " S0 UD6$ )a"  
Compute the unitary, ordinary-frequency Fourier transform of ``f``, defined
as

.. math:: F(k) = \int_{-\infty}^\infty f(x) e^{-2\pi i x k} \mathrm{d} x.

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

If the transform cannot be computed in closed form, this
function returns an unevaluated :class:`FourierTransform` object.

For other Fourier transform conventions, see the function
:func:`sympy.integrals.transforms._fourier_transform`.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`.
Note that for this transform, by default ``noconds=True``.

Examples
========

>>> from sympy import fourier_transform, exp
>>> from sympy.abc import x, k
>>> fourier_transform(exp(-x**2), x, k)
sqrt(pi)*exp(-pi**2*k**2)
>>> fourier_transform(exp(-x**2), x, k, noconds=False)
(sqrt(pi)*exp(-pi**2*k**2), True)

See Also
========

inverse_fourier_transform
sine_transform, inverse_sine_transform
cosine_transform, inverse_cosine_transform
hankel_transform, inverse_hankel_transform
mellin_transform, laplace_transform
r   )r  r   rj   rk   rE  rm   s       rF   fourier_transformr    s     N A!$))2E22rH   c                   (    \ rS rSrSrSrS rS rSrg)InverseFourierTransformi  z
Class representing unevaluated inverse Fourier transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute inverse Fourier transforms, see the
:func:`inverse_fourier_transform` docstring.
zInverse Fourierc                     gr   r   rV   s    rF   r   InverseFourierTransform.a#  r  rH   c                 (    S[         R                  -  $ rk  r  rV   s    rF   r   InverseFourierTransform.b&  s    vrH   r   Nr  r   rH   rF   r  r    s     ErH   r  c                 :    [        XU5      R                  " S0 UD6$ )aF  
Compute the unitary, ordinary-frequency inverse Fourier transform of `F`,
defined as

.. math:: f(x) = \int_{-\infty}^\infty F(k) e^{2\pi i x k} \mathrm{d} k.

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

If the transform cannot be computed in closed form, this
function returns an unevaluated :class:`InverseFourierTransform` object.

For other Fourier transform conventions, see the function
:func:`sympy.integrals.transforms._fourier_transform`.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`.
Note that for this transform, by default ``noconds=True``.

Examples
========

>>> from sympy import inverse_fourier_transform, exp, sqrt, pi
>>> from sympy.abc import x, k
>>> inverse_fourier_transform(sqrt(pi)*exp(-(pi*k)**2), k, x)
exp(-x**2)
>>> inverse_fourier_transform(sqrt(pi)*exp(-(pi*k)**2), k, x, noconds=False)
(exp(-x**2), True)

See Also
========

fourier_transform
sine_transform, inverse_sine_transform
cosine_transform, inverse_cosine_transform
hankel_transform, inverse_hankel_transform
mellin_transform, laplace_transform
r   )r  r   r   rE  rk   rm   s       rF   inverse_fourier_transformr  *  s     N #1+009599rH   c                    [        X0-  U" XA-  U-  5      -  U[        R                  [        R                  45      nUR	                  [
        5      (       d  [        X5      [        R                  4$ UR                  (       d  [        X`S5      eUR                  S   u  pUR	                  [
        5      (       a  [        X`S5      e[        X5      U	4$ )z
Compute a general sine or cosine-type transform
    F(k) = a int_0^oo b*sin(x*k) f(x) dx.
    F(k) = a int_0^oo b*cos(x*k) f(x) dx.

For suitable choice of a and b, this reduces to the standard sine/cosine
and inverse sine/cosine transforms.
r   r   r   )r,   r   r   r   r~   r-   r   r   r   r;   rU   )
rj   rk   rE  r   r   Krw   r   r   ry   s
             rF   _sine_cosine_transformr  X  s     	!#aAh,AFFAJJ 78A55??%qvv-->>$T.JKKffQiGAuuX$T.KLLQ!4''rH   c                   0    \ rS rSrSrS rS rS rS rSr	g)	SineCosineTypeTransformiq  z?
Base class for sine and cosine transforms.
Specify cls._kern.
c                 2    [        SU R                  -  5      ery  rz  rV   s    rF   r   SineCosineTypeTransform.aw  r|  rH   c                 2    [        SU R                  -  5      er~  rz  rV   s    rF   r   SineCosineTypeTransform.b{  r|  rH   c           	          [        XUU R                  5       U R                  5       U R                  R                  U R                  R
                  40 UD6$ rf   )r  r   r   rE   _kernr   r  s        rF   rn   *SineCosineTypeTransform._compute_transform  sL    %aA&*ffh&*nn&:&:&*nn&:&:E ?DE 	ErH   c                     U R                  5       nU R                  5       nU R                  R                  n[	        XA-  U" XR-  U-  5      -  U[
        R                  [
        R                  45      $ rf   )r   r   rE   r  r-   r   r   r   )rB   rj   rk   rE  r   r   r  s          rF   rs   $SineCosineTypeTransform._as_integral  sS    FFHFFHNN  Aac!eHq!&&!**&=>>rH   r   Nr  r   rH   rF   r  r  q  s    
MM
E?rH   r  c                   ,    \ rS rSrSrSr\rS rS r	Sr
g)SineTransformi  z
Class representing unevaluated sine transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute sine transforms, see the :func:`sine_transform`
docstring.
Sinec                 8    [        S5      [        [        5      -  $ rk  r"   r   rV   s    rF   r   SineTransform.a      AwtBxrH   c                 "    [         R                  $ rf   r   r  rV   s    rF   r   SineTransform.b      uurH   r   NrI   rJ   rK   rL   rM   r   r&   r  r   r   rN   r   rH   rF   r  r    s     EE rH   r  c                 :    [        XU5      R                  " S0 UD6$ )a  
Compute the unitary, ordinary-frequency sine transform of `f`, defined
as

.. math:: F(k) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty f(x) \sin(2\pi x k) \mathrm{d} x.

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

If the transform cannot be computed in closed form, this
function returns an unevaluated :class:`SineTransform` object.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`.
Note that for this transform, by default ``noconds=True``.

Examples
========

>>> from sympy import sine_transform, exp
>>> from sympy.abc import x, k, a
>>> sine_transform(x*exp(-a*x**2), x, k)
sqrt(2)*k*exp(-k**2/(4*a))/(4*a**(3/2))
>>> sine_transform(x**(-a), x, k)
2**(1/2 - a)*k**(a - 1)*gamma(1 - a/2)/gamma(a/2 + 1/2)

See Also
========

fourier_transform, inverse_fourier_transform
inverse_sine_transform
cosine_transform, inverse_cosine_transform
hankel_transform, inverse_hankel_transform
mellin_transform, laplace_transform
r   )r  r   r  s       rF   sine_transformr    s     H q!&&///rH   c                   ,    \ rS rSrSrSr\rS rS r	Sr
g)InverseSineTransformi  z
Class representing unevaluated inverse sine transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute inverse sine transforms, see the
:func:`inverse_sine_transform` docstring.
zInverse Sinec                 8    [        S5      [        [        5      -  $ rk  r  rV   s    rF   r   InverseSineTransform.a  r  rH   c                 "    [         R                  $ rf   r  rV   s    rF   r   InverseSineTransform.b  r  rH   r   Nr  r   rH   rF   r  r    s     EE rH   r  c                 :    [        XU5      R                  " S0 UD6$ )a  
Compute the unitary, ordinary-frequency inverse sine transform of `F`,
defined as

.. math:: f(x) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty F(k) \sin(2\pi x k) \mathrm{d} k.

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

If the transform cannot be computed in closed form, this
function returns an unevaluated :class:`InverseSineTransform` object.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`.
Note that for this transform, by default ``noconds=True``.

Examples
========

>>> from sympy import inverse_sine_transform, exp, sqrt, gamma
>>> from sympy.abc import x, k, a
>>> inverse_sine_transform(2**((1-2*a)/2)*k**(a - 1)*
...     gamma(-a/2 + 1)/gamma((a+1)/2), k, x)
x**(-a)
>>> inverse_sine_transform(sqrt(2)*k*exp(-k**2/(4*a))/(4*sqrt(a)**3), k, x)
x*exp(-a*x**2)

See Also
========

fourier_transform, inverse_fourier_transform
sine_transform
cosine_transform, inverse_cosine_transform
hankel_transform, inverse_hankel_transform
mellin_transform, laplace_transform
r   )r  r   r  s       rF   inverse_sine_transformr    s     J  a(--666rH   c                   ,    \ rS rSrSrSr\rS rS r	Sr
g)CosineTransformi  z
Class representing unevaluated cosine transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute cosine transforms, see the :func:`cosine_transform`
docstring.
Cosinec                 8    [        S5      [        [        5      -  $ rk  r  rV   s    rF   r   CosineTransform.a  r  rH   c                 "    [         R                  $ rf   r  rV   s    rF   r   CosineTransform.b  r  rH   r   NrI   rJ   rK   rL   rM   r   r$   r  r   r   rN   r   rH   rF   r  r    s     EE rH   r  c                 :    [        XU5      R                  " S0 UD6$ )a  
Compute the unitary, ordinary-frequency cosine transform of `f`, defined
as

.. math:: F(k) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty f(x) \cos(2\pi x k) \mathrm{d} x.

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

If the transform cannot be computed in closed form, this
function returns an unevaluated :class:`CosineTransform` object.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`.
Note that for this transform, by default ``noconds=True``.

Examples
========

>>> from sympy import cosine_transform, exp, sqrt, cos
>>> from sympy.abc import x, k, a
>>> cosine_transform(exp(-a*x), x, k)
sqrt(2)*a/(sqrt(pi)*(a**2 + k**2))
>>> cosine_transform(exp(-a*sqrt(x))*cos(a*sqrt(x)), x, k)
a*exp(-a**2/(2*k))/(2*k**(3/2))

See Also
========

fourier_transform, inverse_fourier_transform,
sine_transform, inverse_sine_transform
inverse_cosine_transform
hankel_transform, inverse_hankel_transform
mellin_transform, laplace_transform
r   )r  r   r  s       rF   cosine_transformr    s     H 1#((1511rH   c                   ,    \ rS rSrSrSr\rS rS r	Sr
g)InverseCosineTransformi?  z
Class representing unevaluated inverse cosine transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute inverse cosine transforms, see the
:func:`inverse_cosine_transform` docstring.
zInverse Cosinec                 8    [        S5      [        [        5      -  $ rk  r  rV   s    rF   r   InverseCosineTransform.aL  r  rH   c                 "    [         R                  $ rf   r  rV   s    rF   r   InverseCosineTransform.bO  r  rH   r   Nr  r   rH   rF   r  r  ?  s     EE rH   r  c                 :    [        XU5      R                  " S0 UD6$ )a  
Compute the unitary, ordinary-frequency inverse cosine transform of `F`,
defined as

.. math:: f(x) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty F(k) \cos(2\pi x k) \mathrm{d} k.

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

If the transform cannot be computed in closed form, this
function returns an unevaluated :class:`InverseCosineTransform` object.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`.
Note that for this transform, by default ``noconds=True``.

Examples
========

>>> from sympy import inverse_cosine_transform, sqrt, pi
>>> from sympy.abc import x, k, a
>>> inverse_cosine_transform(sqrt(2)*a/(sqrt(pi)*(a**2 + k**2)), k, x)
exp(-a*x)
>>> inverse_cosine_transform(1/sqrt(k), k, x)
1/sqrt(x)

See Also
========

fourier_transform, inverse_fourier_transform,
sine_transform, inverse_sine_transform
cosine_transform
hankel_transform, inverse_hankel_transform
mellin_transform, laplace_transform
r   )r  r   r  s       rF   inverse_cosine_transformr  S  s     H "!*//8%88rH   c                    [        U [        X2U-  5      -  U-  U[        R                  [        R                  45      nUR                  [        5      (       d  [        Xe5      [        R                  4$ UR                  (       d  [        X@S5      eUR                  S   u  pgUR                  [        5      (       a  [        X@S5      e[        Xe5      U4$ )zj
Compute a general Hankel transform

.. math:: F_\nu(k) = \int_{0}^\infty f(r) J_\nu(k r) r \mathrm{d} r.
r   r   r   )r,   r(   r   r   r   r~   r-   r   r   r   r;   rU   )rj   r   rE  rQ  rw   r   r   ry   s           rF   _hankel_transformr  ~  s     	!GB!$$Q&AFFAJJ(?@A55??%qvv-->>$T.JKKffQiGAuuX$T.KLLQ!4''rH   c                   :    \ rS rSrSrS rS rS r\S 5       r	Sr
g)	HankelTypeTransformi  z#
Base class for Hankel transforms.
c                     U R                   " U R                  U R                  U R                  U R                  S   40 UD6$ NrK  )rn   rA   r[   r_   rU   )rB   rm   s     rF   r   HankelTypeTransform.doit  sB    &&t}}'+'='='+'>'>'+yy|0 */	0 	0rH   c                 2    [        XX4U R                  40 UD6$ rf   )r  r   )rB   rj   r   rE  rQ  rm   s         rF   rn   &HankelTypeTransform._compute_transform  s     qdjjBEBBrH   c                 |    [        U[        XCU-  5      -  U-  U[        R                  [        R                  45      $ rf   )r-   r(   r   r   r   )rB   rj   r   rE  rQ  s        rF   rs    HankelTypeTransform._as_integral  s1    '"c**1,q!&&!**.EFFrH   c                     U R                  U R                  U R                  U R                  U R                  S   5      $ r  )rs   rA   r[   r_   rU   rV   s    rF   r   HankelTypeTransform.as_integral  s8      !%!7!7!%!8!8!%1/ 	/rH   r   N)rI   rJ   rK   rL   rM   r   rn   rs   r   r   rN   r   rH   rF   r  r    s,    0CG / /rH   r  c                       \ rS rSrSrSrSrg)HankelTransformi  z
Class representing unevaluated Hankel transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute Hankel transforms, see the :func:`hankel_transform`
docstring.
Hankelr   NrI   rJ   rK   rL   rM   r   rN   r   rH   rF   r  r    s     ErH   r  c                 :    [        XX#5      R                  " S0 UD6$ )aY  
Compute the Hankel transform of `f`, defined as

.. math:: F_\nu(k) = \int_{0}^\infty f(r) J_\nu(k r) r \mathrm{d} r.

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

If the transform cannot be computed in closed form, this
function returns an unevaluated :class:`HankelTransform` object.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`.
Note that for this transform, by default ``noconds=True``.

Examples
========

>>> from sympy import hankel_transform, inverse_hankel_transform
>>> from sympy import exp
>>> from sympy.abc import r, k, m, nu, a

>>> ht = hankel_transform(1/r**m, r, k, nu)
>>> ht
2*k**(m - 2)*gamma(-m/2 + nu/2 + 1)/(2**m*gamma(m/2 + nu/2))

>>> inverse_hankel_transform(ht, k, r, nu)
r**(-m)

>>> ht = hankel_transform(exp(-a*r), r, k, 0)
>>> ht
a/(k**3*(a**2/k**2 + 1)**(3/2))

>>> inverse_hankel_transform(ht, k, r, 0)
exp(-a*r)

See Also
========

fourier_transform, inverse_fourier_transform
sine_transform, inverse_sine_transform
cosine_transform, inverse_cosine_transform
inverse_hankel_transform
mellin_transform, laplace_transform
r   )r  r   )rj   r   rE  rQ  rm   s        rF   hankel_transformr    s     \ 1',,5u55rH   c                       \ rS rSrSrSrSrg)InverseHankelTransformi  z
Class representing unevaluated inverse Hankel transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute inverse Hankel transforms, see the
:func:`inverse_hankel_transform` docstring.
zInverse Hankelr   Nr  r   rH   rF   r  r    s     ErH   r  c                 :    [        XX#5      R                  " S0 UD6$ )a_  
Compute the inverse Hankel transform of `F` defined as

.. math:: f(r) = \int_{0}^\infty F_\nu(k) J_\nu(k r) k \mathrm{d} k.

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

If the transform cannot be computed in closed form, this
function returns an unevaluated :class:`InverseHankelTransform` object.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`.
Note that for this transform, by default ``noconds=True``.

Examples
========

>>> from sympy import hankel_transform, inverse_hankel_transform
>>> from sympy import exp
>>> from sympy.abc import r, k, m, nu, a

>>> ht = hankel_transform(1/r**m, r, k, nu)
>>> ht
2*k**(m - 2)*gamma(-m/2 + nu/2 + 1)/(2**m*gamma(m/2 + nu/2))

>>> inverse_hankel_transform(ht, k, r, nu)
r**(-m)

>>> ht = hankel_transform(exp(-a*r), r, k, 0)
>>> ht
a/(k**3*(a**2/k**2 + 1)**(3/2))

>>> inverse_hankel_transform(ht, k, r, 0)
exp(-a*r)

See Also
========

fourier_transform, inverse_fourier_transform
sine_transform, inverse_sine_transform
cosine_transform, inverse_cosine_transform
hankel_transform
mellin_transform, laplace_transform
r   )r  r   )r   rE  r   rQ  rm   s        rF   inverse_hankel_transformr    s     \ "!.33<e<<rH   )F)T)rM   	functoolsr   r   	itertoolsr   
sympy.corer   r   sympy.core.addr   sympy.core.functionr	   r
   r   r   r   sympy.core.mulr   sympy.core.intfuncr   r   sympy.core.sortingr   sympy.core.symbolr   sympy.core.traversalr   (sympy.functions.combinatorial.factorialsr   r   $sympy.functions.elementary.complexesr   r   r   &sympy.functions.elementary.exponentialr   r   %sympy.functions.elementary.hyperbolicr   r   r   r   #sympy.functions.elementary.integersr   (sympy.functions.elementary.miscellaneousr    r!   r"   $sympy.functions.elementary.piecewiser#   (sympy.functions.elementary.trigonometricr$   r%   r&   r'   sympy.functions.special.besselr(   'sympy.functions.special.delta_functionsr)   'sympy.functions.special.gamma_functionsr*   sympy.functions.special.hyperr+   sympy.integralsr,   r-   sympy.integrals.meijerintr.   sympy.logic.boolalgr/   r0   r1   r2   r3   sympy.polys.polyrootsr4   sympy.polys.polytoolsr5   r6   sympy.polys.rootoftoolsr7   sympy.utilities.iterablesr8   sympy.utilities.miscr9   rh   r;   rQ   r   r   _nocondsr   r   r   r   r   rN  r   rF  rM  rg  rZ  rq  ru  rw  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  sympy.integrals.laplace	integralslaplace_laplaceLaplaceTransformlaplace_transformlaplace_correspondencelaplace_initial_condsInverseLaplaceTransforminverse_laplace_transformr   rH   rF   <module>r     s    #   ; ;  ) / # 4 B = = A H H 7 C C ? G G 2 = 9 1 / , E E ' . + . &!0 !(Y  Y x6 U1 
+> A; 
A;H' B)2X*BZ	
 	h2V	 48: 8:t 1Z. 1Zh5Mx 4( (<], ],+ &'3T2 &':\ 4( (0?/ ?8+ ($0N2 (%7P- ($2N4 ($9V 4( (*/+ /4
) 
.6b
0 
.=l + *,, .. !88  66 ":: $>> rH   