§
    OŠtjk  ã                   óî   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
mZmZmZ ddlmZmZ ddlmZ dd	lmZmZmZmZmZmZmZ d
„ Zd„ Zdd„Zd„ Zdd„Zdd„Z d„ Z!d„ Z"d„ Z#d„ Z$d„ Z%d„ Z&dd„Z'd„ Z(dS )aô  
Algorithms for solving the Risch differential equation.

Given a differential field K of characteristic 0 that is a simple
monomial extension of a base field k and f, g in K, the Risch
Differential Equation problem is to decide if there exist y in K such
that Dy + f*y == g and to find one if there are some.  If t is a
monomial over k and the coefficients of f and g are in k(t), then y is
in k(t), and the outline of the algorithm here is given as:

1. Compute the normal part n of the denominator of y.  The problem is
then reduced to finding y' in k<t>, where y == y'/n.
2. Compute the special part s of the denominator of y.   The problem is
then reduced to finding y'' in k[t], where y == y''/(n*s)
3. Bound the degree of y''.
4. Reduce the equation Dy + f*y == g to a similar equation with f, g in
k[t].
5. Find the solutions in k[t] of bounded degree of the reduced equation.

See Chapter 6 of "Symbolic Integration I: Transcendental Functions" by
Manuel Bronstein.  See also the docstring of risch.py.
é    )Úmul)Úreduce)Úoo)ÚDummy)ÚPolyÚgcdÚZZÚcancel)ÚimÚre)Úsqrt)Úgcdex_diophantineÚfrac_inÚ
derivationÚsplitfactorÚNonElementaryIntegralExceptionÚDecrementLevelÚrecognize_log_derivativec                 ón  — | j         rt          S |t          ||¦  «        k    r3|                      |¦  «                             ¦   «         d         d         S g }|}|                      |¦  «        }d}|j         r=|                     ||f¦  «         ||z  }|dz  }|                      |¦  «        }|j         °=d}t          d|¦  «        }t          |¦  «        dk    r[|                     ¦   «         }	||	d         z  }
|                      |
¦  «        }|j         r||	d         z  }|
}t          |¦  «        dk    °[|S )aY  
    Computes the order of a at p, with respect to t.

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

    For a, p in k[t], the order of a at p is defined as nu_p(a) = max({n
    in Z+ such that p**n|a}), where a != 0.  If a == 0, nu_p(a) = +oo.

    To compute the order at a rational function, a/b, use the fact that
    nu_p(a/b) == nu_p(a) - nu_p(b).
    r   é   é   )	Úis_zeror   r   Úas_polyÚETÚremÚappendÚlenÚpop)ÚaÚpÚtÚ
power_listÚp1ÚrÚtracks_powerÚnÚproductÚfinalÚproductfs              úQ/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/integrals/rde.pyÚorder_atr+   )   s@  € ð 	„yð Ýˆ	Ø�D��A‰JŒJ‚€Ø�yŠy˜‰|Œ|�ŠÑ Ô  Ô# AÔ&Ð&ð €JØ	
€BØ	�Šˆb‰	Œ	€AØ€LØ
Œ)ð Ø×Ò˜2˜lÐ+Ñ,Ô,Ð,Ø�‰UˆØ˜ÑˆØ�EŠE�"‰IŒIˆð	 Œ)ð ð
 	
€AÝ�1�a‰jŒj€GÝ
ˆj‰/Œ/˜QÒ
Ð
Ø—’Ñ Ô ˆØ˜5 œ8Ñ#ˆØ�EŠE�(‰OŒOˆØŒ9ð 	Ø��q”‰MˆAØˆGõ ˆj‰/Œ/˜QÒ
Ð
ð €Hó    c                 ót   — | j         rt          S |                     |¦  «        |                      |¦  «        z
  S )z¤
    Computes the order of a/d at oo (infinity), with respect to t.

    For f in k(t), the order or f at oo is defined as deg(d) - deg(a), where
    f == a/d.
    )r   r   Údegree)r   Údr!   s      r*   Úorder_at_oor0   T   s2   € ð 	„yð Ýˆ	Ø�8Š8�A‰;Œ;˜Ÿš !™œÑ$Ð$r,   Nc                 óv  ‡ ‡‡— |pt          d¦  «        }t          |‰¦  «        \  }}t          ||                     ‰j        ¦  «        ¦  «        }|                     |¦  «        }|                     t          ||¦  «        ¦  «        Št          |                     ‰¦  «                             ‰j        ¦  «        ‰                     ‰j        ¦  «        ‰                      ‰j        ¦  «        ¦  «        \  }}	‰ t          |‰j        ¦  «        t          ‰‰¦  «        z  z
                       ‰j        ¦  «         
                    ‰                     ‰j        ¦  «        ¦  «        }
t          |
|¦  «        }
|
j                             |¦  «        st          d‰j        ¦  «        ‰ |ffS d„ |
                     ¦   «         D ¦   «         }t          t          ˆˆ ˆfd„|D ¦   «         t          d‰j        ¦  «        ¦  «        }t          |‰¦  «        }|‰ z  ||z  z
  }||z  }|                     |d¬¦  «        \  }}|||ffS )aˆ  
    Weak normalization.

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

    Given a derivation D on k[t] and f == a/d in k(t), return q in k[t]
    such that f - Dq/q is weakly normalized with respect to t.

    f in k(t) is said to be "weakly normalized" with respect to t if
    residue_p(f) is not a positive integer for any normal irreducible p
    in k[t] such that f is in R_p (Definition 6.1.1).  If f has an
    elementary integral, this is equivalent to no logarithm of
    integral(f) whose argument depends on t has a positive integer
    coefficient, where the arguments of the logarithms not in k(t) are
    in k[t].

    Returns (q, f - Dq/q)
    Úzr   c                 ó0   — g | ]}|t           v ¯|d k    ¯|‘ŒS )r   )r	   )Ú.0Úis     r*   ú
<listcomp>z#weak_normalizer.<locals>.<listcomp>†   s%   € Ð8Ð8Ð8ˆq a­2 g g°!°a²%°%ˆ°%°%°%r,   c           
      ó~   •— g | ]9}t          ‰t          |‰j        ¦  «        t          ‰‰¦  «        z  z
  ‰¦  «        ‘Œ:S © )r   r   r!   r   )r4   r&   ÚDEr   Úd1s     €€€r*   r6   z#weak_normalizer.<locals>.<listcomp>ˆ   sA   ø€ ÐNÐNÐNÀq•S˜�T ! R¤T™]œ]­:°b¸"Ñ+=Ô+=Ñ=Ñ=¸rÑBÔBÐNÐNÐNr,   T©Úinclude)r   r   r   Údiffr!   Úquor   r   r   r   Ú	resultantÚexprÚhasÚ
real_rootsr   r   r
   )r   r/   r9   r2   ÚdnÚdsÚgÚ
d_sqf_partÚa1Úbr$   ÚNÚqÚdqÚsnÚsdr:   s   ` `             @r*   Úweak_normalizerrN   `   sô  øøø€ ð( 	
ˆ�U�3‰ZŒZ€AÝ˜˜BÑÔ�F€Bˆõ 	ˆB�—’˜œ‘”ÑÔ€AØ—’˜‘”€JØ	�Š�˜J¨Ñ*Ô*Ñ	+Ô	+€Bå˜aŸeše B™iœi×/Ò/°´Ñ5Ô5°r·z²zÀ"Ä$Ñ7GÔ7GØ	�	Š	�"”$‰Œñô �E€Bˆà	
�T�!�R”T‰]Œ]�: b¨"Ñ-Ô-Ñ-Ñ	-×6Ò6°r´tÑ<Ô<×FÒFØ
�
Š
�2”4ÑÔñ	ô 	€AåˆQ�‰
Œ
€AàŒ6�:Š:�a‰=Œ=ð 'Ý�Q˜œ‘”  1˜vÐ&Ð&à8Ð8�A—L’L‘N”NÐ8Ñ8Ô8€Aå�sÐNÐNÐNÐNÐNÐNÈAÐNÑNÔNÝˆQ�”‰Œñ	ô 	€Aõ 
�A�rÑ	Ô	€BØ	
ˆ1‰ˆq�‰t‰€BØ	
ˆ1‰€BØ�YŠY�r 4ˆYÑ(Ô(�F€Bˆà��Bˆxˆ=Ðr,   c                 ód  — t          ||¦  «        \  }}t          ||¦  «        \  }}|                     |¦  «        }	|                     |                     |j        ¦  «        ¦  «                             |	                     |	                     |j        ¦  «        ¦  «        ¦  «        }
||
z  }||
z  }|                     |¦  «        d         rt          ‚||z  }|                     |d¬¦  «        \  }}|| z  |t          |
|¦  «        z  |z  z
  }|                     |d¬¦  «        \  }}|||f||f|
fS )a  
    Normal part of the denominator.

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

    Given a derivation D on k[t] and f, g in k(t) with f weakly
    normalized with respect to t, either raise NonElementaryIntegralException,
    in which case the equation Dy + f*y == g has no solution in k(t), or the
    quadruplet (a, b, c, h) such that a, h in k[t], b, c in k<t>, and for any
    solution y in k(t) of Dy + f*y == g, q = y*h in k<t> satisfies
    a*Dq + b*q == c.

    This constitutes step 1 in the outline given in the rde.py docstring.
    r   Tr;   )	r   r   r=   r!   r>   Údivr   r
   r   )ÚfaÚfdÚgaÚgdr9   rC   rD   ÚenÚesr    Úhr   ÚcÚcaÚcdÚbaÚbds                    r*   Únormal_denomr]   “   s   € õ  ˜˜RÑ Ô �F€BˆÝ˜˜RÑ Ô �F€Bˆà
�Šˆr‰
Œ
€AØ
�Šˆr�wŠw�r”t‰}Œ}ÑÔ×!Ò! !§%¢%¨¯ª¨r¬t©¬Ñ"5Ô"5Ñ6Ô6€Aà
ˆ1‰€AØ	ˆ!‰€AØ‡u‚uˆR�y„y�„|ð -å,Ð,Ø	
ˆ2‰€BØ�YŠY�r 4ˆYÑ(Ô(�F€Bˆà	
ˆ2‰�•:˜a Ñ$Ô$Ñ$ RÑ'Ñ	'€BØ�YŠY�r 4ˆYÑ(Ô(�F€Bˆð ��Bˆx˜"˜b˜ 1Ð%Ð%r,   Úautoc                 ó
  — |dk    r|j         }|dk    rt          |j        |j        ¦  «        }n¤|dk    r!t          |j        dz  dz   |j        ¦  «        }n}|dv rg|                     ¦   «                              |¦  «        }|                     ¦   «                              |¦  «        }	| ||	t          d|j        ¦  «        fS t          d|z  ¦  «        ‚t          |||j        ¦  «        t          |||j        ¦  «        z
  }
t          |||j        ¦  «        t          |||j        ¦  «        z
  }t          d|t          d|
¦  «        z
  ¦  «        }|
�sdd	lm	} |dk    rø|j
                             t          |j        |j        ¦  «        ¦  «        }t          |¦  «        5  t          |                     d¦  «         |                     d¦  «        z  |                      d¦  «        z  |j        ¦  «        \  }}t          ||j        ¦  «        \  }} ||||||¦  «        }|�|\  }}}|dk    rt          ||¦  «        }d
d
d
¦  «         n# 1 swxY w Y   �n|dk    �r|j
                             t          |j        dz  dz   |j        ¦  «        ¦  «        }t          |¦  «        5  t          t          |                     t          d¦  «        ¦  «         |                     t          d¦  «        ¦  «        z  |                      t          d¦  «        ¦  «        z  ¦  «        |j        ¦  «        \  }}t          t!          |                     t          d¦  «        ¦  «         |                     t          d¦  «        ¦  «        z  |                      t          d¦  «        ¦  «        z  ¦  «        |j        ¦  «        \  }}t          ||j        ¦  «        \  }}t#          t          d|j        ¦  «        |z  ||¦  «        r\ ||t          t          d¦  «        |j        ¦  «        z  |z  ||z  z   ||z  |||¦  «        }|�|\  }}}|dk    rt          ||¦  «        }d
d
d
¦  «         n# 1 swxY w Y   t%          d|
 ||z
  ¦  «        }||z  }|| z  }| |z  }||                     |¦  «        z  t          ||j        ¦  «        | z  t'          ||¦  «                             |¦  «        z  |z  z   }||z  |z                       |¦  «        }	|}|||	|fS )a  
    Special part of the denominator.

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

    case is one of {'exp', 'tan', 'primitive'} for the hyperexponential,
    hypertangent, and primitive cases, respectively.  For the
    hyperexponential (resp. hypertangent) case, given a derivation D on
    k[t] and a in k[t], b, c, in k<t> with Dt/t in k (resp. Dt/(t**2 + 1) in
    k, sqrt(-1) not in k), a != 0, and gcd(a, t) == 1 (resp.
    gcd(a, t**2 + 1) == 1), return the quadruplet (A, B, C, 1/h) such that
    A, B, C, h in k[t] and for any solution q in k<t> of a*Dq + b*q == c,
    r = qh in k[t] satisfies A*Dr + B*r == C.

    For ``case == 'primitive'``, k<t> == k[t], so it returns (a, b, c, 1) in
    this case.

    This constitutes step 2 of the outline given in the rde.py docstring.
    r^   ÚexpÚtanr   r   )Ú	primitiveÚbasez@case must be one of {'exp', 'tan', 'primitive', 'base'}, not %s.r   ©Úparametric_log_derivNéÿÿÿÿ)Úcaser   r!   Úto_fieldr>   Ú
ValueErrorr+   ÚminÚprdere   r/   r   r   Úevalr   r   r   r   Úmaxr   )r   r[   r\   rY   rZ   r9   rg   r    ÚBÚCÚnbÚncr&   re   ÚdcoeffÚalphaaÚalphadÚetaaÚetadÚAÚQÚmr2   ÚbetaaÚbetadrI   ÚpNÚpnrW   s                                r*   Úspecial_denomr~   ¸   s-  € ð. ˆv‚~€~ØŒwˆàˆu‚}€}Ý�”�r”tÑÔˆˆØ	�ŠˆÝ�”�q‘˜1‘˜bœdÑ#Ô#ˆˆØ	Ð&Ð	&Ð	&Ø�KŠK‰MŒM×Ò˜bÑ!Ô!ˆØ�KŠK‰MŒM×Ò˜bÑ!Ô!ˆØ�1�a�˜a ¤™œÐ'Ð'åð Ø!%ñ&ñ 'ô 'ð 	'õ 
�"�a˜œÑ	Ô	¥¨"¨a°´Ñ!6Ô!6Ñ	6€BÝ	�"�a˜œÑ	Ô	¥¨"¨a°´Ñ!6Ô!6Ñ	6€BåˆAˆr•C˜˜2‘J”J‰ÑÔ€AØñ *à.Ð.Ð.Ð.Ð.Ð.Ø�5Š=ˆ=Ø”T—X’X�d 2¤4¨¬Ñ.Ô.Ñ/Ô/ˆFÝ Ñ#Ô#ð &ð &å!(¨"¯'ª'°!©*¬*¨°R·W²W¸Q±Z´ZÑ)?ÀÇÂÀqÁ	Ä	Ñ)IÈ2Ì4Ñ!PÔ!P‘�˜Ý$ V¨R¬TÑ2Ô2‘
��dØ(Ð(¨°¸¸tÀRÑHÔH�Ø�=Ø‘G�A�q˜!Ø˜A’v�vÝ  1™IœI˜ð&ð &ð &ñ &ô &ð &ð &ð &ð &ð &ð &øøøð &ð &ð &ð &ùð �UŠ]‰]Ø”T—X’X�d 2¤4¨¡7¨1¡9¨b¬dÑ3Ô3Ñ4Ô4ˆFÝ Ñ#Ô#ð *ð *å!(­¨R¯WªWµT¸"±X´XÑ->Ô->Ð,>¸r¿wºwÅtÈBÁxÄxÑ?PÔ?PÑ,PÐQR×QWÒQWÕX\Ð]_ÑX`ÔX`ÑQaÔQaÑ,aÑ)bÔ)bÐdfÔdhÑ!iÔ!i‘�˜Ý&¥r¨2¯7ª7µ4¸±8´8Ñ+<Ô+<Ð*<¸R¿WºWÅTÈ"ÁXÄXÑ=NÔ=NÑ*NÈqÏvÊvÕVZÐ[]ÑV^ÔV^ÑO_ÔO_Ñ*_Ñ'`Ô'`ÐbdÔbfÑgÔg‘��uÝ$ V¨R¬TÑ2Ô2‘
��då+­D°°B´D©M¬M¸%Ñ,?ÀÈÑKÔKð *Ø,Ð,¨VµD½¸b¹¼À2Ä4Ñ4HÔ4HÑ-HÈÑ-NÈvÐV[É|Ñ-[Ð]cÐdiÑ]iÐkoÐquÐwyÑzÔz�AØ�}Ø"#™˜˜1˜aØ š6˜6Ý # A q¡	¤	˜Að*ð *ð *ñ *ô *ð *ð *ð *ð *ð *ð *øøøð *ð *ð *ð *õ 	ˆA�ˆs�A˜‘FÑÔ€AØ	
ˆA‰€BØ	
ˆQˆB‰€Bà	ˆ"‰€AØ
ˆ2�6Š6�"‰:Œ:‰�˜Q ¤™œ a™­
°1°bÑ(9Ô(9×(=Ò(=¸aÑ(@Ô(@Ñ@ÀÑCÑC€AØ	ˆB‰ˆr‰�Š�rÑÔ€AØ
€Að ˆq�!�Qˆ<Ðs&   ÆBIÉIÉIÊ#F4Q#Ñ#Q'Ñ*Q'Fc           	      óž
  ‡— |dk    r‰j         }|                      ‰j        ¦  «        }|                     ‰j        ¦  «        }|rt          ˆfd„|D ¦   «         ¦  «        }n|                     ‰j        ¦  «        }t	          |                     ‰j        ¦  «                             ¦   «                              ¦   «          |                      ‰j        ¦  «                             ¦   «                              ¦   «         z  ¦  «        }	|dk    rJt          d|t          ||dz
  ¦  «        z
  ¦  «        }
||dz
  k    r|	j        rt          d|	||z
  ¦  «        }
�n÷|dk    �rK||k    rt          d||z
  ¦  «        }
nt          d||z
  dz   ¦  «        }
t          ‰j
        ‰j        ‰j        dz
           ¦  «        \  }}‰j        }t          ‰¦  «        5  t          |	‰j        ¦  «        \  }}||dz
  k    riddlm} 	  |||||fg‰¦  «        \  \  }}}t!          |¦  «        dk    rt#          d¦  «        ‚t          |
|d         ¦  «        }
�nG# t$          $ r Y �n:w xY w||k    �r/dd	lm}  |||‰¦  «        }|��|\  }}|dk    �r| t)          |‰¦  «                             |¦  «        z  ||                     |¦  «        z  z                        ¦   «          |                     ¦   «         |                      ¦   «         z  z  }t          |‰j        ¦  «        \  }}ddlm} 	  |||||fg‰¦  «        \  \  }}}t!          |¦  «        dk    rt#          d¦  «        ‚t          |
|d                              ¦   «         ¦  «        }
n# t$          $ r Y nw xY wd
d
d
¦  «         n# 1 swxY w Y   �n¥|dk    rðddlm} t          d|t          ||¦  «        z
  ¦  «        }
||k    rÂt          ‰j
                             t/          ‰j        ‰j        ¦  «        ¦  «        ‰j        ‰j        dz
           ¦  «        \  }}t          ‰¦  «        5  t          |	‰j        ¦  «        \  }} |||||‰¦  «        }|�|\  } }}| dk    rt          |
|¦  «        }
d
d
d
¦  «         n# 1 swxY w Y   n¯|dv r™‰j
                             ‰j        ¦  «        }‰j
                             ¦   «         }t	          |	|z  ¦  «        }	t          d|t          ||z   dz
  |¦  «        z
  ¦  «        }
|||z   dz
  k    r|	j        rt          d|	||z
  ¦  «        }
nt#          d|z  ¦  «        ‚|
S )am  
    Bound on polynomial solutions.

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

    Given a derivation D on k[t] and ``a``, ``b``, ``c`` in k[t] with ``a != 0``, return
    n in ZZ such that deg(q) <= n for any solution q in k[t] of
    a*Dq + b*q == c, when parametric=False, or deg(q) <= n for any solution
    c1, ..., cm in Const(k) and q in k[t] of a*Dq + b*q == Sum(ci*gi, (i, 1, m))
    when parametric=True.

    For ``parametric=False``, ``cQ`` is ``c``, a ``Poly``; for ``parametric=True``, ``cQ`` is Q ==
    [q1, ..., qm], a list of Polys.

    This constitutes step 3 of the outline given in the rde.py docstring.
    r^   c              3   óL   •K  — | ]}|                      ‰j        ¦  «        V — Œd S ©N)r.   r!   )r4   r5   r9   s     €r*   ú	<genexpr>zbound_degree.<locals>.<genexpr>(  s/   øè è € Ð,Ð, A�—’˜"œ$‘”Ð,Ð,Ð,Ð,Ð,Ð,r,   rc   r   r   rb   )Úlimited_integratezLength of m should be 1©Ú!is_log_deriv_k_t_radical_in_fieldNr`   rd   )ra   Úother_nonlinearzScase must be one of {'exp', 'tan', 'primitive', 'other_nonlinear', 'base'}, not %s.)rg   r.   r!   rm   r
   r   ÚLCÚas_exprÚ
is_Integerr   r/   ÚTÚlevelr   rk   rƒ   r   ri   r   r…   r   re   r>   r   )r   rH   ÚcQr9   rg   Ú
parametricÚdaÚdbÚdcÚalphar&   ru   rv   Út1rs   rt   rƒ   ÚzaÚzdry   r…   rw   Úaar2   Úbetarz   r{   re   ÚdeltaÚlams      `                          r*   Úbound_degreer™     s  ø€ ð( ˆv‚~€~ØŒwˆà	
�Š�"”$‰Œ€BØ	
�Š�"”$‰Œ€Bð ð ÝÐ,Ð,Ð,Ð,¨Ð,Ñ,Ô,Ñ,Ô,ˆˆà�YŠY�r”t‰_Œ_ˆå�A—I’I˜bœd‘O”O×&Ò&Ñ(Ô(×0Ò0Ñ2Ô2Ð2Ø	�	Š	�"”$‰Œ×ÒÑÔ×$Ò$Ñ&Ô&ñ'ñ (ô (€Eð ˆv‚~€~Ý��2�˜B  Q¡™œÑ'Ñ(Ô(ˆØ��a‘Š<ˆ<˜EÔ,ˆ<Ý�A�u˜b 2™gÑ&Ô&ˆAùà	�Ò	Ñ	Ø�Š7ˆ7Ý�A�r˜B‘w‘”ˆAˆAå�A�r˜B‘w ‘{Ñ#Ô#ˆAå˜RœT 2¤4¨¬°1©Ô#5Ñ6Ô6‰
ˆˆdàŒTˆÝ˜BÑÔð %	7ð %	7Ý$ U¨B¬DÑ1Ô1‰NˆF�FØ�R˜!‘VŠ|ˆ|Ø3Ð3Ð3Ð3Ð3Ð3ð%Ø"3Ð"3°F¸FÀdÈDÀ\ÀNØñ#ô #‘K‘H�R˜˜aõ
 ˜1‘v”v ’{�{Ý(Ð)BÑCÔCÐCÝ˜A˜q œt™œ�A‘Aøõ 6ð ð ð Ø‘Dðøøøð �r’‘ð
 DÐCÐCÐCÐCÐCØ5Ð5°f¸fÀbÑIÔI�Ø‘=Ø‘E�B˜Ø˜Q’w‘wØ!"¥:¨a°Ñ#4Ô#4×#<Ò#<¸RÑ#@Ô#@Ñ!@Ø˜aŸiši¨™mœm™Oñ",ß-/ªR©T¬Tð 2Ø34·9²9±;´;¸q¿tºt¹v¼vÑ3Eñ G˜å'.¨t°R´TÑ':Ô':™˜˜uØ;Ð;Ð;Ð;Ð;Ð;ð7Ø*;Ð*;¸EÀ5Ø"&¨  °ñ+4ô +4™K™H˜R  aõ
  # 1™vœv¨š{˜{Ý&0Ð1JÑ&KÔ&KÐ KÝ # A q¨¤t§|¢|¡~¤~Ñ 6Ô 6˜A˜Aøõ  >ð !ð !ð !Ø ˜Dð!øøøðA%	7ð %	7ð %	7ñ %	7ô %	7ð %	7ð %	7ð %	7ð %	7ð %	7ð %	7øøøð %	7ð %	7ð %	7ð %	7ùðN 
�ŠˆØ.Ð.Ð.Ð.Ð.Ð.å��2�˜B ™œÑ#Ñ$Ô$ˆØ�Š8ˆ8Ý  ¤§¢­$¨r¬t°R´TÑ*:Ô*:Ñ!;Ô!;¸R¼TÀ"Ä(ÈQÁ,Ô=OÑPÔP‰JˆD�$Ý Ñ#Ô#ð &ð &Ý!(¨°´Ñ!5Ô!5‘�˜Ø(Ð(¨°¸¸tÀRÑHÔH�Ø�=ð  ‘G�A�q˜!Ø˜A’v�vÝ  1™IœI˜ð&ð &ð &ñ &ô &ð &ð &ð &ð &ð &ð &øøøð &ð &ð &ð &øð 
Ð+Ð	+Ð	+Ø”—’˜BœDÑ!Ô!ˆØŒd�gŠg‰iŒiˆÝ�u˜S‘yÑ!Ô!ˆÝ��2�˜B ™J¨™N¨BÑ/Ô/Ñ/Ñ0Ô0ˆØ��e‘˜a‘ÒÐ EÔ$4ÐÝ�A�u˜b 2™gÑ&Ô&ˆAøõ ð 2Ø48ñ9ñ :ô :ð 	:ð €Hso   Ç(NÇ7IÈ:NÉ
IÉNÉIÉCNÌM?Ì4ANÍ?
NÎ	NÎNÎNÎNÎ"NÑ ARÒRÒRc                 óX  — t          d|j        ¦  «        }t          d|j        ¦  «        }t          d|j        ¦  «        }	 |j        r||d||fS |dk     du rt          ‚|                      |¦  «        }|                     |¦  «        j        st          ‚|                      |¦  «        |                     |¦  «        |                     |¦  «        }}} |                      |j        ¦  «        dk    rU|                     ¦   «                              | ¦  «        }|                     ¦   «                              | ¦  «        }|||||fS t          || |¦  «        \  }	}
|t          | |¦  «        z  }|
t          |	|¦  «        z
  }||                      |j        ¦  «        z  }|||	z  z  }|| z  }�Œk)aª  
    Rothstein's Special Polynomial Differential Equation algorithm.

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

    Given a derivation D on k[t], an integer n and ``a``,``b``,``c`` in k[t] with
    ``a != 0``, either raise NonElementaryIntegralException, in which case the
    equation a*Dq + b*q == c has no solution of degree at most ``n`` in
    k[t], or return the tuple (B, C, m, alpha, beta) such that B, C,
    alpha, beta in k[t], m in ZZ, and any solution q in k[t] of degree
    at most n of a*Dq + b*q == c must be of the form
    q == alpha*h + beta, where h in k[t], deg(h) <= m, and Dh + B*h == C.

    This constitutes step 4 of the outline given in the rde.py docstring.
    r   r   T)r   r!   r   r   r   r   r>   r.   rh   r   r   )r   rH   rX   r&   r9   Úzeror‘   r–   rE   r$   r2   s              r*   Úspderœ   ƒ  s†  € õ" ��2”4‰=Œ=€Då��B”D‰MŒM€EÝ��2”4‰=Œ=€DðØŒ9ð 	/Ø˜$  4¨Ð.Ð.Ø�ŠE�dˆ?ˆ?Ý0Ð0à�EŠE�!‰HŒHˆØ�uŠu�Q‰xŒxÔð 	1Ý0Ð0à—%’%˜‘(”(˜AŸEšE !™HœH a§e¢e¨A¡h¤hˆaˆ1ˆà�8Š8�B”D‰>Œ>˜QÒÐØ—
’
‘”× Ò  Ñ#Ô#ˆAØ—
’
‘”× Ò  Ñ#Ô#ˆAØ�q˜!˜U DÐ)Ð)å   A qÑ)Ô)‰ˆˆ1Ø	�Z˜˜2ÑÔÑˆØ•
˜1˜bÑ!Ô!Ñ!ˆØ	ˆQ�XŠX�b”d‰^Œ^Ñˆà�˜‘	ÑˆØ�‰
ˆñ/r,   c                 ó  — t          d|j        ¦  «        }|j        sî|                     |j        ¦  «        |                      |j        ¦  «        z
  }d|cxk    r|k    s	n t          ‚t          |                     |j        ¦  «                             ¦   «         |                      |j        ¦  «                             ¦   «         z  |j        |z  z  |j        d¬¦  «        }||z   }|dz
  }|t          ||¦  «        z
  | |z  z
  }|j        ¯î|S )aì  
    Poly Risch Differential Equation - No cancellation: deg(b) large enough.

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

    Given a derivation D on k[t], ``n`` either an integer or +oo, and ``b``,``c``
    in k[t] with ``b != 0`` and either D == d/dt or
    deg(b) > max(0, deg(D) - 1), either raise NonElementaryIntegralException, in
    which case the equation ``Dq + b*q == c`` has no solution of degree at
    most n in k[t], or a solution q in k[t] of this equation with
    ``deg(q) < n``.
    r   F©Úexpandr   )r   r!   r   r.   r   r   r‡   r   ©rH   rX   r&   r9   rJ   ry   r    s          r*   Úno_cancel_b_larger¡   ²  sû   € õ 	ˆQ�”‰Œ€AàŒið 	(Ø�HŠH�R”T‰NŒN˜QŸXšX b¤d™^œ^Ñ+ˆØ�Aˆ{ˆ{Š{ˆ{˜Š{ˆ{ˆ{ˆ{Ý0Ð0å�—’˜2œ4‘”×#Ò#Ñ%Ô% a§i¢i°´¡o¤o×&8Ò&8Ñ&:Ô&:Ñ:¸2¼4À¹7ÑBÀBÄDØðñ ô ˆà�‰EˆØ�‰EˆØ•
˜1˜bÑ!Ô!Ñ! A a¡CÑ'ˆð Œið 	(ð €Hr,   c                 ó”  — t          d|j        ¦  «        }|j        �s*|dk    rd}n=|                     |j        ¦  «        |j                             |j        ¦  «        z
  dz   }d|cxk    r|k    s	n t
          ‚|dk    rƒt          |                     |j        ¦  «                             ¦   «         ||j                             |j        ¦  «                             ¦   «         z  z  |j        |z  z  |j        d¬¦  «        }�n|                      |j        ¦  «        |                     |j        ¦  «        k    rt
          ‚|                      |j        ¦  «        dk    rQ||                      |j        |j	        dz
           ¦  «        |                     |j        |j	        dz
           ¦  «        fS t          |                     |j        ¦  «                             ¦   «         |                      |j        ¦  «                             ¦   «         z  |j        d¬¦  «        }||z   }|dz
  }|t          ||¦  «        z
  | |z  z
  }|j        �¯*|S )a˜  
    Poly Risch Differential Equation - No cancellation: deg(b) small enough.

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

    Given a derivation D on k[t], ``n`` either an integer or +oo, and ``b``,``c``
    in k[t] with deg(b) < deg(D) - 1 and either D == d/dt or
    deg(D) >= 2, either raise NonElementaryIntegralException, in which case the
    equation Dq + b*q == c has no solution of degree at most n in k[t],
    or a solution q in k[t] of this equation with deg(q) <= n, or the
    tuple (h, b0, c0) such that h in k[t], b0, c0, in k, and for any
    solution q in k[t] of degree at most n of Dq + bq == c, y == q - h
    is a solution in k of Dy + b0*y == c0.
    r   r   Frž   )r   r!   r   r.   r/   r   r   r‡   rŠ   r‹   r   r    s          r*   Úno_cancel_b_smallr£   Ð  s  € õ  	ˆQ�”‰Œ€AàŒiñ (Ø�Š6ˆ6ØˆAˆAà—’˜œ‘” ¤§¢¨R¬TÑ!2Ô!2Ñ2°QÑ6ˆAà�Aˆ{ˆ{Š{ˆ{˜Š{ˆ{ˆ{ˆ{Ý0Ð0àˆqŠ5ˆ5Ý�Q—Y’Y˜rœt‘_”_×'Ò'Ñ)Ô)¨1¨R¬T¯\ª\¸"¼$Ñ-?Ô-?×-BÒ-BÑ-DÔ-DÑ+DÑEÀbÄdÈAÁgÑMØ”˜Uð$ñ $ô $ˆA‰Að �xŠx˜œ‰~Œ~ §¢¨"¬$¡¤Ò/Ð/Ý4Ð4Ø�xŠx˜œ‰~Œ~ Ò"Ð"Ø˜1Ÿ9š9 R¤T¨"¬(°Q©,Ô%7Ñ8Ô8Ø—I’I˜bœd 2¤8¨a¡<Ô0Ñ1Ô1ð3ð 3å�Q—Y’Y˜rœt‘_”_×'Ò'Ñ)Ô)¨!¯)ª)°B´D©/¬/×*<Ò*<Ñ*>Ô*>Ñ>ÀÄØðñ ô ˆAð �‰EˆØ�‰EˆØ•
˜1˜bÑ!Ô!Ñ! A a¡CÑ'ˆð/ Œiñ (ð2 €Hr,   c                 ó2  — t          d|j        ¦  «        }t          |                      |j        ¦  «                             ¦   «          |j                             |j        ¦  «                             ¦   «         z  ¦  «        }|j        r
|j        r|}nd}|j        �sút          || 
                    |j        ¦  «        |j         
                    |j        ¦  «        z
  dz   ¦  «        }d|cxk    r|k    s	n t          ‚t          ||j                             |j        ¦  «                             ¦   «         z  |                      |j        ¦  «                             ¦   «         z   ¦  «        }|j        r|||fS |dk    rPt          |                     |j        ¦  «                             ¦   «         |z  |j        |z  z  |j        d¬¦  «        }	nž| 
                    |j        ¦  «        |j         
                    |j        ¦  «        dz
  k    rt          ‚|                     |j        ¦  «                             ¦   «         |                      |j        ¦  «                             ¦   «         z  }	||	z   }|dz
  }|t          |	|¦  «        z
  | |	z  z
  }|j        �¯ú|S )a™  
    Poly Risch Differential Equation - No cancellation: deg(b) == deg(D) - 1

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

    Given a derivation D on k[t] with deg(D) >= 2, n either an integer
    or +oo, and b, c in k[t] with deg(b) == deg(D) - 1, either raise
    NonElementaryIntegralException, in which case the equation Dq + b*q == c has
    no solution of degree at most n in k[t], or a solution q in k[t] of
    this equation with deg(q) <= n, or the tuple (h, m, C) such that h
    in k[t], m in ZZ, and C in k[t], and for any solution q in k[t] of
    degree at most n of Dq + b*q == c, y == q - h is a solution in k[t]
    of degree at most m of Dy + b*y == C.
    r   rf   r   Frž   )r   r!   r
   r   r‡   r/   r‰   Úis_positiver   rm   r.   r   r   )
rH   rX   r&   r9   rJ   ÚlcÚMry   Úur    s
             r*   Úno_cancel_equalr©   ÿ  s/  € õ  	ˆQ�”‰Œ€AÝ	�—’˜2œ4‘”×#Ò#Ñ%Ô%Ð% b¤d§l¢l°2´4Ñ&8Ô&8×&;Ò&;Ñ&=Ô&=Ñ=Ñ	>Ô	>€BØ	„}ð ˜œð ØˆˆàˆàŒiñ (Ý��1—8’8˜BœD‘>”> B¤D§K¢K°´Ñ$5Ô$5Ñ5¸Ñ9Ñ:Ô:ˆà�Aˆ{ˆ{Š{ˆ{˜Š{ˆ{ˆ{ˆ{Ý0Ð0å�1�R”T—\’\ "¤$Ñ'Ô'×*Ò*Ñ,Ô,Ñ,¨q¯yªy¸¼©¬×/AÒ/AÑ/CÔ/CÑCÑDÔDˆØŒ9ð 	Ø�q˜!�9ÐØˆqŠ5ˆ5Ý�Q—Y’Y˜rœt‘_”_×'Ò'Ñ)Ô)¨!Ñ+¨B¬D°!©GÑ3°R´TÀ%ÐHÑHÔHˆAˆAà�xŠx˜œ‰~Œ~ ¤§¢¨R¬TÑ!2Ô!2°QÑ!6Ò6Ð6Ý4Ð4à—I’I˜bœd‘O”O×&Ò&Ñ(Ô(¨¯ª°2´4©¬×);Ò);Ñ)=Ô)=Ñ=�à�‰EˆØ�‰EˆØ•
˜1˜bÑ!Ô!Ñ! A a¡CÑ'ˆð' Œiñ (ð* €Hr,   c                 ó|  — ddl m} t          |¦  «        5  t          | |j        ¦  «        \  }} ||||¦  «        }|�|\  }}|dk    rt          d¦  «        ‚ddd¦  «         n# 1 swxY w Y   |j        r|S ||                     |j        ¦  «        k     rt          ‚t          d|j        ¦  «        }	|j        �s|                     |j        ¦  «        }
||
k     rt          ‚t          |¦  «        5  t          | 
                    ¦   «         |j        ¦  «        \  }}t          |||||¦  «        \  }}ddd¦  «         n# 1 swxY w Y   t          |                     ¦   «         |                     ¦   «         z  |j        |
z  z  |j        d¬¦  «        }|	|z  }	|
dz
  }|| |z  t          ||¦  «        z   z  }|j        �¯|	S )a³  
    Poly Risch Differential Equation - Cancellation: Primitive case.

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

    Given a derivation D on k[t], n either an integer or +oo, ``b`` in k, and
    ``c`` in k[t] with Dt in k and ``b != 0``, either raise
    NonElementaryIntegralException, in which case the equation Dq + b*q == c
    has no solution of degree at most n in k[t], or a solution q in k[t] of
    this equation with deg(q) <= n.
    r   r„   Nz7is_deriv_in_field() is required to  solve this problem.r   Frž   )rk   r…   r   r   r!   ÚNotImplementedErrorr   r.   r   r   r‡   ÚrischDErˆ   r   )rH   rX   r&   r9   r…   r[   r\   rw   r2   rJ   ry   Úa2aÚa2dÚsarM   Ústms                   r*   Úcancel_primitiver±   .  sJ  € ð 8Ð7Ð7Ð7Ð7Ð7Ý	˜Ñ	Ô	ð ,ð ,Ý˜˜BœDÑ!Ô!‰ˆˆBØ-Ð-¨b°"°bÑ9Ô9ˆØˆ=Ø‰DˆAˆqØ�AŠvˆvÝ)ð ++ñ ,ô ,ð ,ð,ð ,ð ,ñ ,ô ,ð ,ð ,ð ,ð ,ð ,ð ,øøøð ,ð ,ð ,ð ,ð 	„yð Øˆàˆ1�8Š8�B”D‰>Œ>ÒÐÝ,Ð,åˆQ�”‰Œ€AØŒiñ 
)Ø�HŠH�R”T‰NŒNˆØˆqŠ5ˆ5Ý0Ð0Ý˜BÑÔð 	3ð 	3Ý˜qŸtšt™vœv r¤tÑ,Ô,‰HˆC�Ý˜R  S¨#¨rÑ2Ô2‰FˆB�ð	3ð 	3ð 	3ñ 	3ô 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3øøøð 	3ð 	3ð 	3ð 	3õ �2—:’:‘<”< §
¢
¡¤Ñ,¨R¬T°1©WÑ4°b´dÀ5ÐIÑIÔIˆØ	ˆS‰ˆØ�‰EˆØ	ˆQˆs‰U•Z  RÑ(Ô(Ñ(Ñ(ˆð Œiñ 
)ð €Hs%   –AA$Á$A(Á+A(Ã0AD=Ä=EÅEc                 óÞ  — ddl m} |j                             t	          |j        |j        ¦  «        ¦  «                             ¦   «         }t          |¦  «        5  t          ||j        ¦  «        \  }}t          | |j        ¦  «        \  }}	 |||	|||¦  «        }
|
�|
\  }}}|dk    rt          d¦  «        ‚ddd¦  «         n# 1 swxY w Y   |j
        r|S ||                     |j        ¦  «        k     rt          ‚t	          d|j        ¦  «        }|j
        �sT|                     |j        ¦  «        }||k     rt          ‚|                      ¦   «         }t          |¦  «        5  t          ||j        ¦  «        \  }}||z  ||z  t	          ||j        ¦  «        z  z   }||z  }t          |                     ¦   «         |j        ¦  «        \  }}t          |||||¦  «        \  }}ddd¦  «         n# 1 swxY w Y   t	          |                     ¦   «         |                     ¦   «         z  |j        |z  z  |j        d¬¦  «        }||z  }|dz
  }|| |z  t          ||¦  «        z   z  }|j
        �¯T|S )a¼  
    Poly Risch Differential Equation - Cancellation: Hyperexponential case.

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

    Given a derivation D on k[t], n either an integer or +oo, ``b`` in k, and
    ``c`` in k[t] with Dt/t in k and ``b != 0``, either raise
    NonElementaryIntegralException, in which case the equation Dq + b*q == c
    has no solution of degree at most n in k[t], or a solution q in k[t] of
    this equation with deg(q) <= n.
    r   rd   Nz6is_deriv_in_field() is required to solve this problem.r   Frž   )rk   re   r/   r>   r   r!   rˆ   r   r   r«   r   r.   r   r‡   r¬   r   )rH   rX   r&   r9   re   Úetaru   rv   r[   r\   rw   r   ry   r2   rJ   rG   Úa1aÚa1dr­   r®   r¯   rM   r°   s                          r*   Ú
cancel_expr¶   `  sÞ  € ð +Ð*Ð*Ð*Ð*Ð*Ø
Œ$�(Š(•4˜œ˜bœdÑ#Ô#Ñ
$Ô
$×
,Ò
,Ñ
.Ô
.€Cå	˜Ñ	Ô	ð +ð +Ý˜S "¤$Ñ'Ô'‰
ˆˆdÝ˜˜BœDÑ!Ô!‰ˆˆBØ Ð   R¨¨t°RÑ8Ô8ˆØˆ=Ø‰GˆAˆq�!Ø�AŠvˆvÝ)ð +*ñ +ô +ð +ð+ð +ð +ñ +ô +ð +ð +ð +ð +ð +ð +øøøð +ð +ð +ð +ð 	„yð Øˆàˆ1�8Š8�B”D‰>Œ>ÒÐÝ,Ð,åˆQ�”‰Œ€AØŒiñ )Ø�HŠH�R”T‰NŒNˆØˆqŠ5ˆ5Ý0Ð0à�YŠY‰[Œ[ˆÝ˜BÑÔð 	5ð 	5å˜r 2¤4Ñ(Ô(‰HˆC�Ø�d‘(˜T #™X¥d¨1¨b¬d¡m¤mÑ3Ñ3ˆCØ�d‘(ˆCå˜qŸtšt™vœv r¤tÑ,Ô,‰HˆC�å˜S # s¨C°Ñ4Ô4‰FˆB�ð	5ð 	5ð 	5ñ 	5ô 	5ð 	5ð 	5ð 	5ð 	5ð 	5ð 	5øøøð 	5ð 	5ð 	5ð 	5õ �2—:’:‘<”< §
¢
¡¤Ñ,¨R¬T°1©WÑ4°b´dÀ5ÐIÑIÔIˆØ	ˆS‰ˆØ�‰EˆØ	ˆQˆs‰U•Z  RÑ(Ô(Ñ(Ñ(ˆð% Œiñ )ð& €Hs&   ÁACÃCÃ
CÅ#A?G.Ç.G2Ç5G2c                 ó¢  — | j         s|j        dk    sL|                      |j        ¦  «        t	          d|j                             |j        ¦  «        dz
  ¦  «        k    r(|rddlm}  || |||¦  «        S t          | |||¦  «        S | j         s?|                      |j        ¦  «        |j                             |j        ¦  «        dz
  k     �r|j        dk    s#|j                             |j        ¦  «        dk    rñ|rddlm	}  || |||¦  «        S t          | |||¦  «        }t          |t          ¦  «        r|S |\  }}	}
t          |¦  «        5  |	                     |j        ¦  «        |
                     |j        ¦  «        }
}	|	€t          d¦  «        ‚|
€t          d	¦  «        ‚t!          |	|
||¦  «                             |j        ¦  «        }ddd¦  «         n# 1 swxY w Y   ||z   S |j                             |j        ¦  «        dk    �r8|                      |j        ¦  «        |j                             |j        ¦  «        dz
  k    rú||                      |j        ¦  «                             ¦   «          |j                             |j        ¦  «                             ¦   «         z  k    r—|                      |j        ¦  «                             ¦   «         j        st'          d
¦  «        ‚|rt)          d¦  «        ‚t+          | |||¦  «        }t          |t          ¦  «        r|S |\  }}}t!          | |||¦  «        }||z   S | j         rt)          d¦  «        ‚|j        dk    r#|rt)          d¦  «        ‚t-          | |||¦  «        S |j        dk    r#|rt)          d¦  «        ‚t/          | |||¦  «        S t)          d|j        z  ¦  «        ‚)a  
    Solve a Polynomial Risch Differential Equation with degree bound ``n``.

    This constitutes step 4 of the outline given in the rde.py docstring.

    For parametric=False, cQ is c, a Poly; for parametric=True, cQ is Q ==
    [q1, ..., qm], a list of Polys.
    rc   r   r   )Úprde_no_cancel_b_larger   )Úprde_no_cancel_b_smallNzb0 should be a non-Null valuezc0 should be a non-Null valuezResult should be a numberz0prde_no_cancel_b_equal() is not yet implemented.zWRemaining cases for Poly (P)RDE are not yet implemented (is_deriv_in_field() required).r`   zIParametric RDE cancellation hyperexponential case is not yet implemented.rb   zBParametric RDE cancellation primitive case is not yet implemented.zBOther Poly (P)RDE cancellation cases are not yet implemented (%s).)r   rg   r.   r!   rm   r/   rk   r¸   r¡   r¹   r£   Ú
isinstancer   r   r   ri   Úsolve_poly_rder‡   Ú	is_numberÚ	TypeErrorr«   r©   r¶   r±   )rH   rŒ   r&   r9   r�   r¸   r¹   ÚRrW   Úb0Úc0Úyry   ro   s                 r*   r»   r»   œ  sX  € ð Œ9ð P˜"œ' VÒ+Ð+Ø�HŠH�R”T‰NŒN�S  B¤D§K¢K°´Ñ$5Ô$5¸Ñ$9Ñ:Ô:Ò:Ð:àð 	8à4Ð4Ð4Ð4Ð4Ð4Ø)Ð)¨!¨R°°BÑ7Ô7Ð7Ý   B¨¨2Ñ.Ô.Ð.à
Œ)ð G�q—x’x ¤‘~”~¨¬¯ª°B´DÑ(9Ô(9¸AÑ(=Ò=Ñ=ØŒW˜ÒÐ "¤$§+¢+¨b¬dÑ"3Ô"3°qÒ"8Ð"8àð 	8Ø4Ð4Ð4Ð4Ð4Ð4Ø)Ð)¨!¨R°°BÑ7Ô7Ð7å˜a  Q¨Ñ+Ô+ˆå�a�ÑÔð 	ØˆHð ‰IˆAˆr�2Ý Ñ#Ô#ð @ð @ØŸš B¤DÑ)Ô)¨2¯:ª:°b´dÑ+;Ô+;�B�Ø�:Ý$Ð%DÑEÔEÐEØ�;Ý$Ð%DÑEÔEÐEÝ" 2 r¨1¨bÑ1Ô1×9Ò9¸"¼$Ñ?Ô?�ð@ð @ð @ñ @ô @ð @ð @ð @ð @ð @ð @øøøð @ð @ð @ð @ð �q‘5ˆLà	Œ�Š�R”TÑ	Ô	˜aÒ	Ñ	 A§H¢H¨R¬T¡N¤N°b´d·k²kÀ"Ä$Ñ6GÔ6GÈ!Ñ6KÒ$KÐ$KØ�—’˜2œ4‘”×#Ò#Ñ%Ô%Ð% b¤d§l¢l°2´4Ñ&8Ô&8×&;Ò&;Ñ&=Ô&=Ñ=Ò=Ð=ð �yŠy˜œ‰Œ×!Ò!Ñ#Ô#Ô-ð 	9ÝÐ7Ñ8Ô8Ð8àð 	 Ý%ð 'ñ  ô  ð  õ ˜A˜r 1 bÑ)Ô)ˆå�a�ÑÔð 	ØˆHà‰GˆAˆq�!å˜q ! Q¨Ñ+Ô+ˆAØ�q‘5ˆLð Œ9ð 	EÝ%ð 'Bñ Cô Cð Cð Œw˜%ÒÐØð IÝ-ð /Hñ Iô Ið Iå! ! R¨¨BÑ/Ô/Ð/à”˜KÒ'Ð'Øð BÝ-ð /Añ Bô Bð Bå'¨¨2¨q°"Ñ5Ô5Ð5õ *ð +:Ø<>¼Gñ+Dñ Eô Eð Es   ÅBGÇG Ç#G c                 óx  — t          | ||¦  «        \  }\  } }t          | ||||¦  «        \  }\  }}\  }	}
}t          ||||	|
|¦  «        \  }}}}	 t          ||||¦  «        }n# t          $ r
 t
          }Y nw xY wt          |||||¦  «        \  }}}}}|j        r|}nt          ||||¦  «        }||z  |z   ||z  fS )a  
    Solve a Risch Differential Equation: Dy + f*y == g.

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

    See the outline in the docstring of rde.py for more information
    about the procedure used.  Either raise NonElementaryIntegralException, in
    which case there is no solution y in the given differential field,
    or return y in k(t) satisfying Dy + f*y == g, or raise
    NotImplementedError, in which case, the algorithms necessary to
    solve the given Risch Differential Equation have not yet been
    implemented.
    )	rN   r]   r~   r™   r«   r   rœ   r   r»   )rQ   rR   rS   rT   r9   Ú_r   r[   r\   rY   rZ   Úhnrw   rn   ro   Úhsr&   ry   r‘   r–   rÁ   s                        r*   r¬   r¬   ù  s  € õ " " b¨"Ñ-Ô-�K€A�xˆˆBÝ ,¨R°°R¸¸RÑ @Ô @Ñ€A�xˆˆB‘�"�b˜2Ý  2 r¨2¨r°2Ñ6Ô6�K€A€qˆ!ˆRðõ ˜˜A˜q "Ñ%Ô%ˆˆøÝð ð ð õ
 ˆˆˆðøøøõ    1 a¨¨BÑ/Ô/Ñ€A€qˆ!ˆU�DØ„yð (Øˆˆå˜1˜a  BÑ'Ô'ˆà�!‰G�d‰N˜B˜r™EÐ"Ð"s   ÁA# Á#A7Á6A7r�   )r^   )r^   F)F))Ú__doc__Úoperatorr   Ú	functoolsr   Ú
sympy.corer   Úsympy.core.symbolr   Úsympy.polysr   r   r	   r
   Ú$sympy.functions.elementary.complexesr   r   Ú(sympy.functions.elementary.miscellaneousr   Úsympy.integrals.rischr   r   r   r   r   r   r   r+   r0   rN   r]   r~   r™   rœ   r¡   r£   r©   r±   r¶   r»   r¬   r8   r,   r*   ú<module>rÏ      s  ððð ð. Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #à -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -à 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9ð[ð [ð [ð [ð [ð [ð [ð [ð [ð [ð [ð [ð [ð [ð [ð [ð [ð [ð(ð (ð (ðV	%ð 	%ð 	%ð0ð 0ð 0ð 0ðf"&ð "&ð "&ðJQð Qð Qð Qðhtð tð tð tðn-ð -ð -ð^ð ð ð<+ð +ð +ð^,ð ,ð ,ð^/ð /ð /ðd9ð 9ð 9ðxZð Zð Zð Zðz'#ð '#ð '#ð '#ð '#r,   