+
    ‹°³jk  ã                   óö   € R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
HtHtHt ^ RIHtHt ^ RIHt ^ RIHtHtHtHtHtHtHt R	 tR
 tRR ltR tRR ltRR lt R t!R t"R t#R t$R t%R t&RR lt'R t(R# )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                óX  € V P                   '       d   \        # V\        W"4      8X  d.   V P                  V4      P	                  4       ^ ,          ^ ,          # . pTpV P                  V4      p^pVP                   '       d7   VP                  WF34       WD,          pV^,          pV P                  V4      pKH  ^ p\        ^V4      p\        V4      ^ 8w  dX   VP                  4       p	W‰^ ,          ,          p
V P                  V
4      pVP                   '       g   KT  Wy^,          ,          pT
pKg  V# )a9  
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).
)	Úis_zeror   r   Úas_polyÚETÚremÚappendÚlenÚpop)ÚaÚpÚtÚ
power_listÚp1ÚrÚtracks_powerÚnÚproductÚfinalÚproductfs   &&&        ÚT/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/integrals/rde.pyÚorder_atr(   )   sñ   € ð 	‡y‡y€yÜˆ	ØŒD�‹J„Ø�y‰y˜‹|�‰Ó  Õ# AÕ&Ð&ð €JØ	
€BØ	�‰ˆb‹	€AØ€LØ
�)�)ˆ)Ø×Ñ˜2Ð+Ô,Ø�UˆØ˜ÕˆØ�E‰E�"‹IŠØ	€AÜ�1�a‹j€GÜ
ˆj‹/˜QÔ
Ø—‘Ó ˆØ �8Õ#ˆØ�E‰E�(‹OˆØ�9�9Š9Ø�q•�MˆAØŠGØ€Hó    c                ó€   € V P                   '       d   \        # VP                  V4      V P                  V4      ,
          # )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_oor-   T   s-   € ð 	‡y‡y€yÜˆ	Ø�8‰8�A‹;˜Ÿ™ !›Õ$Ð$r)   Nc                óò  € T;'       g    \        R4      p\        W4      w  rE\        WDP                  VP                  4      4      pVP                  V4      pVP                  \        Wv4      4      p\        VP                  V4      P                  VP                  4      VP                  VP                  4      V P                  VP                  4      4      w  ršV \        W2P                  4      \        W‚4      ,          ,
          P                  VP                  4      P                  VP                  VP                  4      4      p\        W³4      pVP                  P                  V4      '       g   \        ^VP                  4      W33# VP                  4        Uu. uF  qÌ\        9   g   K  V^ 8”  g   K  VNK  	  pp\        \         V Uu. uF9  p\        V \        WâP                  4      \        W‚4      ,          ,
          V4      NK;  	  up\        ^VP                  4      4      p\        Wò4      pWð,          VV,          ,
          pWñ,          pVP#                  VRR7      w  ppVVV33# u upi u upi )aP  
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)
ÚzT©Úinclude)r   r   r   Údiffr   Úquor   r   r   r   Ú	resultantÚexprÚhasÚ
real_rootsr   r   r   r	   )r   r,   ÚDEr/   ÚdnÚdsÚgÚ
d_sqf_partÚd1Úa1Úbr!   ÚiÚNr#   ÚqÚdqÚsnÚsds   &&&&               r'   Úweak_normalizerrF   `   sÏ  € ð( 	
�ˆŒU�3‹Z€AÜ˜Ó�F€Bô 	ˆB—‘˜Ÿ™“Ó€AØ—‘˜“€JØ	�‰œ˜JÓ*Ó	+€Bä˜aŸe™e B›i×/Ñ/°·±Ó5°r·z±zÀ"Ç$Á$Ó7GØ	�	‰	�"—$‘$‹ó�E€Bà	
ŒT�!—T‘T‹]œ: bÓ-Õ-Õ	-×6Ñ6°r·t±tÓ<×FÑFØ
�
‰
�2—4‘4Óó	€AäˆQ‹
€Aà�6‰6�:‰:�a�=Š=Ü�Q˜Ÿ™“ ˜vÐ&Ð&à—L‘L”NÓ8‘Nˆq¬2¡gŒ°!°a±%�ˆ‘N€AÐ8äŒsÉAÓNÉAÀq”S˜œT !§T¡T›]¬:°bÓ+=Õ=Õ=¸rÖBÉAÑNÜˆQ�—‘‹ó	€Aô 
�AÓ	€BØ	
�ˆq��t�€BØ	
�€BØ�Y‰Y�r 4ˆYÓ(�F€Bˆà��Bˆxˆ=Ðùò 	9ùâNs   ÆI/Æ0I/Æ9I/Ç?I4
c                óD  € \        W4      w  rV\        W44      w  rxVP                  V4      p	VP                  VP                  VP                  4      4      P	                  V	P                  V	P                  VP                  4      4      4      p
WZ,          pWº,          pVP                  V4      ^,          '       d   \        hWÂ,          pVP                  VRR7      w  rÞW°,          V\        W¤4      ,          V,          ,
          pVP                  VRR7      w  ppW¿V3WÞ3V
3# )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.
Tr0   )	r   r   r2   r   r3   Údivr   r	   r   )ÚfaÚfdÚgaÚgdr8   r9   r:   ÚenÚesr   Úhr   ÚcÚcaÚcdÚbaÚbds   &&&&&            r'   Únormal_denomrU   “   sé   € ô  ˜Ó �F€BÜ˜Ó �F€Bà
�‰ˆr‹
€AØ
�‰ˆr�w‰w�r—t‘t‹}Ó×!Ñ! !§%¡%¨¯©¨r¯t©t«Ó"5Ó6€Aà
�€AØ	�€AØ‡u�uˆRƒy�‡|„|ä,Ð,Ø	
�€BØ�Y‰Y�r 4ˆYÓ(�F€Bà	
��”:˜aÓ$Õ$ RÕ'Õ	'€BØ�Y‰Y�r 4ˆYÓ(�F€Bˆð �Bˆx˜"˜ 1Ð%Ð%r)   c                ó”
  € VR8X  d   VP                   pVR8X  d"   \        VP                  VP                  4      pM¦VR8X  d0   \        VP                  ^,          ^,           VP                  4      pMpVR9   dX   VP                  4       P	                  V4      pVP                  4       P	                  V4      p	WV	\        ^VP                  4      3# \        RV,          4      h\        WVP                  4      \        W'VP                  4      ,
          p
\        W7VP                  4      \        WGVP                  4      ,
          p\        ^ V\        ^ V
4      ,
          4      pV
'       Eg   ^RIH	p VR8X  dî   VP                  P	                  \        VP                  VP                  4      4      p\        V4      ;_uu_ 4        \        VP                  ^ 4      ) VP                  ^ 4      ,          V P                  ^ 4      ,          VP                  4      w  pp\        WåP                  4      w  ppV! VVVVV4      pVe   Vw  pppV^8X  d   \        VV4      pRRR4       EMVR8X  Ed   VP                  P	                  \        VP                  ^,          ^,           VP                  4      4      p\        V4      ;_uu_ 4        \        \        VP                  \        R4      4      ) VP                  \        R4      4      ,          V P                  \        R4      4      ,          4      VP                  4      w  pp\        \!        VP                  \        R4      4      ) VP                  \        R4      4      ,          V P                  \        R4      4      ,          4      VP                  4      w  pp\        WåP                  4      w  pp\#        \        ^VP                  4      V,          VV4      '       dj   V! V\        \        R4      VP                  4      ,          V,          VV,          ,           VV,          VVV4      pVe   Vw  pppV^8X  d   \        VV4      pRRR4       \%        ^ V
) WË,
          4      pVV,          pW|) ,          pV V,          pVVP	                  V4      ,          \        WÅP                  4      V ,          \'        Wu4      P	                  V4      ,          V,          ,           pVV,          V,          P	                  V4      p	TpVW‰V3#   + '       g   i     LÄ; i  + '       g   i     L×; i)	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.
ÚautoÚexpÚtanz@case must be one of {'exp', 'tan', 'primitive', 'base'}, not %s.©Úparametric_log_derivN)Ú	primitiveÚbaseéÿÿÿÿ)Úcaser   r   Úto_fieldr3   Ú
ValueErrorr(   ÚminÚprder[   r,   r   r   Úevalr
   r   r   r   Úmaxr   )r   rS   rT   rQ   rR   r8   r_   r   ÚBÚCÚnbÚncr#   r[   ÚdcoeffÚalphaaÚalphadÚetaaÚetadÚAÚQÚmr/   ÚbetaaÚbetadrA   ÚpNÚpnrO   s   &&&&&&&                      r'   Úspecial_denomrv   ¸   sô  € ð. ˆv„~Ø�w‰wˆàˆu„}Ü�—‘�r—t‘tÓ‰Ø	�ŒÜ�—‘�q•˜1•˜bŸd™dÓ#‰Ø	Ð&Ô	&Ø�K‰K‹M×Ñ˜bÓ!ˆØ�K‰K‹M×Ñ˜bÓ!ˆØ�aœ˜a §¡›Ð'Ð'äð Ø!%õ&ó 'ð 	'ô 
�"˜Ÿ™Ó	¤¨"°·±Ó!6Õ	6€BÜ	�"˜Ÿ™Ó	¤¨"°·±Ó!6Õ	6€BäˆAˆr”C˜˜2“J�Ó€Aßˆ2å.Ø�5Œ=Ø—T‘T—X‘Xœd 2§4¡4¨¯©Ó.Ó/ˆFÜ ×#Õ#ä!(¨"¯'©'°!«*¨°R·W±W¸Q³ZÕ)?ÀÇÁÀqÃ	Õ)IÈ2Ï4É4Ó!P‘�˜Ü$ V¯T©TÓ2‘
��dÙ(¨°¸¸tÀRÓH�Ø’=Ø‘G�A�q˜!Ø˜A”vÜ  1›I˜÷ $Ñ#ð �U�]Ø—T‘T—X‘Xœd 2§4¡4¨¥7¨1¥9¨b¯d©dÓ3Ó4ˆFÜ ×#Õ#ä!(¬¨R¯W©W´T¸"³XÓ->Ð,>¸r¿w¹wÄtÈBÃxÓ?PÕ,PÐQR×QWÑQWÔX\Ð]_ÓX`ÓQaÕ,aÓ)bÐdf×dhÑdhÓ!i‘�˜Ü&¤r¨2¯7©7´4¸³8Ó+<Ð*<¸R¿W¹WÄTÈ"ÃXÓ=NÕ*NÈqÏvÉvÔVZÐ[]ÓV^ÓO_Õ*_Ó'`Ðbd×bfÑbfÓg‘��uÜ$ V¯T©TÓ2‘
��dä+¬D°°B·D±D«M¸%Õ,?ÀÈ×KÒKÙ,¨V´D¼¸b»À2Ç4Á4Ó4HÕ-HÈÕ-NÈvÐV[Í|Õ-[Ð]cÐdiÕ]iÐkoÐquÐwyÓz�AØ’}Ø"#™˜˜1˜aØ œ6Ü # A q£	˜A÷ $ô 	ˆA�ˆs�A•FÓ€AØ	
ˆA�€BØ	
ˆB�€Bà	ˆ"�€AØ
ˆ2�6‰6�"‹:�œ˜Q§¡› a�¬
°1Ó(9×(=Ñ(=¸aÓ(@Õ@ÀÕCÕC€AØ	ˆB�ˆr��‰�rÓ€AØ
€Að ˆq�Qˆ<Ð÷E $×#ú÷ $×#ús   ÇBT$ËF"T7Ô$T4	Ô7U	c           	     ó  a€ VR8X  d   SP                   pV P                  SP                  4      pVP                  SP                  4      pV'       d   \        V3R lV 4       4      pMVP                  SP                  4      p\	        VP                  SP                  4      P                  4       P                  4       ) V P                  SP                  4      P                  4       P                  4       ,          4      p	VR8X  dX   \        ^ V\        Wv^,
          4      ,
          4      p
Wv^,
          8X  d&   V	P                  '       d   \        ^ W˜V,
          4      p
V
# VR8X  Ed   Wv8”  d   \        ^ W‡,
          4      p
M\        ^ W†,
          ^,           4      p
\        SP                  SP                  SP                  ^,
          ,          4      w  r¼SP                  p\        S4      ;_uu_ 4        \        V	SP                  4      w  rïWv^,
          8X  dJ   ^RIHp  V! WïW¼3.S4      w  w  ppp\!        V4      ^8w  d   \#        R4      h\        V
V^ ,          4      p
EMWv8X  Ed   ^RIHp V! WïS4      pVeô   Vw  ppV^8X  dè   T \)        VS4      P                  V4      ,          VVP                  V4      ,          ,           P                  4       ) VP                  4       V P                  4       ,          ,          p\        VSP                  4      w  pp^RIHp  V! VVW¼3.S4      w  w  ppp\!        V4      ^8w  d   \#        R4      h\        V
V^ ,          P                  4       4      p
RRR4       V
# VR	8X  dð   ^R
IHp \        ^ V\        Wv4      ,
          4      p
Wg8X  dÅ   \        SP                  P-                  \/        SP                  SP                  4      4      SP                  SP                  ^,
          ,          4      w  r¼\        S4      ;_uu_ 4        \        V	SP                  4      w  rïV! WïW¼S4      pVe   Vw  p ppV ^8X  d   \        V
V4      p
RRR4       V
#  V
# VR9   d¸   SP                  P                  SP                  4      pSP                  P                  4       p\	        V	V,          4      p	\        ^ V\        VV,           ^,
          V4      ,
          4      p
WvV,           ^,
          8X  d&   V	P                  '       d   \        ^ W˜V,
          4      p
V
# \#        RV,          4      h  \$         d     ELÞi ; i  \$         d     ELði ; i  + '       g   i     T
# ; i  + '       g   i     T
# ; i)a=  
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.
rW   c              3   óX   <"  € T F  qP                  SP                  4      x € K!  	  R # 5i©N)r+   r   )Ú.0r@   r8   s   & €r'   Ú	<genexpr>Úbound_degree.<locals>.<genexpr>(  s   øé € Ð,© A—‘˜"Ÿ$™$—�«ùs   ƒ'*r]   r\   )Úlimited_integratezLength of m should be 1©Ú!is_log_deriv_k_t_radical_in_fieldNrX   rZ   zScase must be one of {'exp', 'tan', 'primitive', 'other_nonlinear', 'base'}, not %s.)rY   Úother_nonlinear)r_   r+   r   re   r	   r   ÚLCÚas_exprÚ
is_Integerr   r,   ÚTÚlevelr   rc   r}   r   ra   r   r   r   r[   r3   r   )r   r?   ÚcQr8   r_   Ú
parametricÚdaÚdbÚdcÚalphar#   rm   rn   Út1rk   rl   r}   ÚzaÚzdrq   r   ro   Úaar/   Úbetarr   rs   r[   ÚdeltaÚlams   &&&f&&                        r'   Úbound_degreer“     s‚  ø€ ð( ˆv„~Ø�w‰wˆà	
�‰�"—$‘$‹€BØ	
�‰�"—$‘$‹€B÷ ÜÔ,©Ó,Ó,‰à�Y‰Y�r—t‘t‹_ˆä�A—I‘I˜bŸd™d“O×&Ñ&Ó(×0Ñ0Ó2Ð2Ø	�	‰	�"—$‘$‹×ÑÓ×$Ñ$Ó&õ'ó (€Eð ˆv„~Ü��2œ˜B Q¥›Õ'Ó(ˆØ�a•Œ<˜E×,×,Ð,Ü�A�u 2�gÓ&ˆAð\ €HðY 
�Õ	ØŒ7Ü�A�r•w“‰Aä�A�r•w •{Ó#ˆAä˜RŸT™T 2§4¡4¨¯©°1­Õ#5Ó6‰
ˆà�T‰TˆÜ˜B×ÕÜ$ U¨B¯D©DÓ1‰NˆFØ˜!•VŒ|Ý3ð%Ù"3°FÀdÀ\ÀNØó#‘K‘H�R˜˜aô
 ˜1“v ”{Ü(Ð)BÓCÐCÜ˜A˜q �t›’Aà•õ
 DÙ5°fÀbÓI�Ø’=Ø‘E�B˜Ø˜Q”wØ!"¤:¨a°Ó#4×#<Ñ#<¸RÓ#@Õ!@Ø˜aŸi™i¨›m�Oõ",ß-/©R«Tð 2Ø34·9±9³;¸q¿t¹t»vÕ3Eõ G˜ä'.¨t°R·T±TÓ':™˜˜uÝ;ð7Ù*;¸EÀ5Ø"&  °ó+4™K™H˜R  aô
  # 1›v¨œ{Ü&0Ð1JÓ&KÐ KÜ # A q¨¥t§|¡|£~Ó 6˜A÷K  ðF €Hð9 
�ŒÝ.ä��2œ˜B›Õ#Ó$ˆØŒ8Ü  §¡§¡¬$¨r¯t©t°R·T±TÓ*:Ó!;¸R¿T¹TÀ"Ç(Á(ÈQÅ,Õ=OÓP‰JˆDÜ ×#Õ#Ü!(¨°·±Ó!5‘�Ù(¨¸ÀRÓH�Ø’=ð  ‘G�A�q˜!Ø˜A”vÜ  1›I˜÷ $ð, €Hð1 ð0 €Hð 
Ð+Ô	+Ø—‘—‘˜BŸD™DÓ!ˆØ�d‰d�g‰g‹iˆÜ�u˜S•yÓ!ˆÜ��2œ˜B �J¨�N¨BÓ/Õ/Ó0ˆØ�e•˜a•Ô E×$4×$4Ð$4Ü�A�u 2�gÓ&ˆAð €Hô ð 2Ø48õ9ó :ð 	:øôq 6ô Úðûô0  >ô !Ú ð!ú÷A  ÖðF €Hú÷- $Ö#ð, €Húsb   Ç2,U"ÈT>È1C-U"ÌUÌ2<U"Ð!A U6Ô>UÕ	U"ÕUÕU"ÕUÕU"ÕUÕU"Õ"U3	Õ6V	c                óH  € \        ^ VP                  4      p\        ^VP                  4      p\        ^ VP                  4      p VP                  '       d   WU^ WW3# V^ 8  RJ d   \        hV P	                  V4      pVP                  V4      P                  '       g   \        hV P                  V4      VP                  V4      VP                  V4      r!p V P                  VP                  4      ^ 8X  dD   VP                  4       P                  V 4      pVP                  4       P                  V 4      pWW6V3# \        WV4      w  ršV\        W4      ,          pV
\        W”4      ,
          pW0P                  VP                  4      ,          pWvV	,          ,          pW`,          pEKa  )az  
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.
T)r   r   r   r   r   r   r3   r+   r`   r   r   )r   r?   rP   r#   r8   Úzeror‹   r�   r;   r!   r/   s   &&&&&      r'   Úspder–   ƒ  sE  € ô" ��2—4‘4‹=€Dä��B—D‘D‹M€EÜ��2—4‘4‹=€Dà
Ø�9�9ˆ9Ø  4Ð.Ð.Ø�‰E�d‹?Ü0Ð0à�E‰E�!‹HˆØ�u‰u�Q‹x××ÐÜ0Ð0à—%‘%˜“(˜AŸE™E !›H a§e¡e¨A£hˆaˆà�8‰8�B—D‘D‹>˜QÔØ—
‘
“× Ñ  Ó#ˆAØ—
‘
“× Ñ  Ó#ˆAØ˜! DÐ)Ð)ä   qÓ)‰ˆØ	ŒZ˜ÓÕˆØ”
˜1Ó!Õ!ˆØ	�X‰X�b—d‘d‹^Õˆà˜•	ÕˆØ�
‹r)   c                óx  € \        ^ VP                  4      pVP                  '       Eg   VP                  VP                  4      V P                  VP                  4      ,
          p^ Tu;8:  d   V8:  g    \        h \        h\        VP                  VP                  4      P                  4       V P                  VP                  4      P                  4       ,          VP                  V,          ,          VP                  RR7      pWF,           pV^,
          pV\        Wc4      ,
          W,          ,
          pEK#  V# )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``.
F©Úexpand)r   r   r   r+   r   r   r�   r   ©r?   rP   r#   r8   rB   rq   r   s   &&&&   r'   Úno_cancel_b_larger›   ²  sÖ   € ô 	ˆQ�—‘‹€Aà�i�i‰iØ�H‰H�R—T‘T‹N˜QŸX™X b§d¡d›^Õ+ˆØ�AŽ{˜�{Ü0Ð0ð Ü0Ð0ä�—‘˜2Ÿ4™4“×#Ñ#Ó% a§i¡i°·±£o×&8Ñ&8Ó&:Õ:¸2¿4¹4À½7ÕBÀBÇDÁDØôˆà�EˆØ��EˆØ”
˜1Ó!Õ! A¥CÕ'‹à€Hr)   c                óD  € \        ^ VP                  4      pVP                  '       Egw   V^ 8X  d   ^ pMLVP                  VP                  4      VP                  P                  VP                  4      ,
          ^,           p^ Tu;8:  d   V8:  g    \
        h \
        hV^ 8”  d˜   \        VP                  VP                  4      P                  4       WSP                  P                  VP                  4      P                  4       ,          ,          VP                  V,          ,          VP                  RR7      pEM2V P                  VP                  4      VP                  VP                  4      8w  d   \
        hV P                  VP                  4      ^ 8X  dg   W@P                  VP                  VP                  ^,
          ,          4      VP                  VP                  VP                  ^,
          ,          4      3# \        VP                  VP                  4      P                  4       V P                  VP                  4      P                  4       ,          VP                  RR7      pWF,           pV^,
          pV\        Wc4      ,
          W,          ,
          pEK‰  V# )ah  
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.
Fr˜   )r   r   r   r+   r,   r   r   r�   r„   r…   r   rš   s   &&&&   r'   Úno_cancel_b_smallr�   Ð  sÁ  € ô  	ˆQ�—‘‹€Aà�i�i‰iØ�Œ6Ø‰Aà—‘˜Ÿ™“ §¡§¡¨R¯T©TÓ!2Õ2°QÕ6ˆAà�AŽ{˜�{Ü0Ð0ð Ü0Ð0àˆqŒ5Ü�Q—Y‘Y˜rŸt™t“_×'Ñ'Ó)¨1¯T©T¯\©\¸"¿$¹$Ó-?×-BÑ-BÓ-DÕ+DÕEÀbÇdÁdÈAÅgÕMØ—‘˜Uô$ŠAð �x‰x˜Ÿ™‹~ §¡¨"¯$©$£Ô/Ü4Ð4Ø�x‰x˜Ÿ™‹~ Ô"ØŸ9™9 R§T¡T¨"¯(©(°Q­,Õ%7Ó8Ø—I‘I˜bŸd™d 2§8¡8¨a¥<Õ0Ó1ð3ð 3ä�Q—Y‘Y˜rŸt™t“_×'Ñ'Ó)¨!¯)©)°B·D±D«/×*<Ñ*<Ó*>Õ>ÀÇÁØôˆAð �EˆØ��EˆØ”
˜1Ó!Õ! A¥CÕ'‹à€Hr)   c                óð  € \        ^ VP                  4      p\        V P                  VP                  4      P	                  4       ) VP
                  P                  VP                  4      P	                  4       ,          4      pVP                  '       d   VP                  '       d   TpMRpVP                  '       Eg9   \        WaP                  VP                  4      VP
                  P                  VP                  4      ,
          ^,           4      p^ Tu;8:  d   V8:  g    \        h \        h\        WsP
                  P                  VP                  4      P	                  4       ,          V P                  VP                  4      P	                  4       ,           4      pVP                  '       d   WGV3# V^ 8”  d`   \        VP                  VP                  4      P	                  4       V,          VP                  V,          ,          VP                  RR7      p	M§VP                  VP                  4      VP
                  P                  VP                  4      ^,
          8w  d   \        hVP                  VP                  4      P	                  4       V P                  VP                  4      P	                  4       ,          p	WI,           pV^,
          pV\        W“4      ,
          W	,          ,
          pEKK  V# )ai  
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.
Fr˜   r^   )r   r   r	   r   r�   r,   rƒ   Úis_positiver   re   r+   r   r   )
r?   rP   r#   r8   rB   ÚlcÚMrq   Úur   s
   &&&&      r'   Úno_cancel_equalr£   ÿ  sè  € ô  	ˆQ�—‘‹€AÜ	�—‘˜2Ÿ4™4“×#Ñ#Ó%Ð% b§d¡d§l¡l°2·4±4Ó&8×&;Ñ&;Ó&=Õ=Ó	>€BØ	‡}‡}€}˜ŸŸ˜Ø‰àˆà�i�i‰iÜ�—8‘8˜BŸD™D“> B§D¡D§K¡K°·±Ó$5Õ5¸Õ9Ó:ˆà�AŽ{˜�{Ü0Ð0ð Ü0Ð0ä�1—T‘T—\‘\ "§$¡$Ó'×*Ñ*Ó,Õ,¨q¯y©y¸¿¹«×/AÑ/AÓ/CÕCÓDˆØ�9�9ˆ9Ø˜!�9ÐØˆqŒ5Ü�Q—Y‘Y˜rŸt™t“_×'Ñ'Ó)¨!Õ+¨B¯D©D°!­GÕ3°R·T±TÀ%ÔH‰Aà�x‰x˜Ÿ™‹~ §¡§¡¨R¯T©TÓ!2°QÕ!6Ô6Ü4Ð4à—I‘I˜bŸd™d“O×&Ñ&Ó(¨¯©°2·4±4«×);Ñ);Ó)=Õ=�à�EˆØ��EˆØ”
˜1Ó!Õ! A¥CÕ'‹à€Hr)   c           	     óÎ  € ^RI Hp \        V4      ;_uu_ 4        \        WP                  4      w  rVV! WVV4      pVe   Vw  r(V^8X  d   \        R4      hRRR4       VP                  '       d   V# W!P                  VP                  4      8  d   \        h\        ^ VP                  4      p	VP                  '       Eg    VP                  VP                  4      p
W*8  d   \        h\        V4      ;_uu_ 4        \        VP                  4       VP                  4      w  r¼\        XXW¼V4      w  rÞRRR4       \        XP                  4       XP                  4       ,          VP                  V
,          ,          VP                  RR7      pWŸ,          p	V
^,
          pWV,          \        Wó4      ,           ,          pEK  V	#   + '       g   i     ELt; i  + '       g   i     L¬; i)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~   Nz7is_deriv_in_field() is required to  solve this problem.Fr˜   )rc   r   r   r   r   ÚNotImplementedErrorr   r+   r   r   r�   ÚrischDEr‚   r   )r?   rP   r#   r8   r   rS   rT   ro   r/   rB   rq   Úa2aÚa2dÚsarE   Ústms   &&&&            r'   Úcancel_primitiver«   .  sa  € õ 8Ü	˜×	Õ	Ü˜ŸD™DÓ!‰ˆÙ-¨b°bÓ9ˆØŠ=Ø‰DˆAØ�AŒvÜ)ð ++ó ,ð ,÷ 
ð 	‡y‡y€yØˆà�8‰8�B—D‘D‹>ÔÜ,Ð,äˆQ�—‘‹€AØ�i�i‰iØ�H‰H�R—T‘T‹NˆØŒ5Ü0Ð0Ü˜B×ÕÜ˜qŸt™t›v r§t¡tÓ,‰HˆCÜ˜R  S¨rÓ2‰FˆB÷  ô �2—:‘:“< §
¡
£Õ,¨R¯T©T°1­WÕ4°b·d±dÀ5ÔIˆØ	�ˆØ��EˆØ	ˆs�U”Z Ó(Õ(Õ(‹à€H÷A 
×	Ð	ú÷0  ×ús   š;G Ã97GÇ G	ÇG$	c           	     ó\  € ^RI Hp VP                  P                  \	        VP
                  VP
                  4      4      P                  4       p\        V4      ;_uu_ 4        \        WSP
                  4      w  rg\        WP
                  4      w  r‰V! W‰WgV4      p
V
e   V
w  r¼pV^8X  d   \        R4      hRRR4       VP                  '       d   V# W!P                  VP
                  4      8  d   \        h\	        ^ VP
                  4      pVP                  '       Egg   VP                  VP
                  4      pW,8  d   \        hV P                  4       p\        V4      ;_uu_ 4        \        WóP
                  4      w  ppVX,          XV,          \	        WÃP
                  4      ,          ,           pVV,          p\        VP                  4       VP
                  4      w  pp\        VVVVV4      w  ppRRR4       \	        XP                  4       XP                  4       ,          VP
                  V,          ,          VP
                  RR7      pVV,          pV^,
          pWV,          \        VV4      ,           ,          pEKy  V#   + '       g   i     ELÛ; i  + '       g   i     L®; i)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.
rZ   Nz6is_deriv_in_field() is required to solve this problem.Fr˜   )rc   r[   r,   r3   r   r   r‚   r   r   r¥   r   r+   r   r�   r¦   r   )r?   rP   r#   r8   r[   Úetarm   rn   rS   rT   ro   r   rq   r/   rB   r>   Úa1aÚa1dr§   r¨   r©   rE   rª   s   &&&&                   r'   Ú
cancel_expr°   `  sî  € õ +Ø
�$‰$�(‰(”4˜Ÿ™˜bŸd™dÓ#Ó
$×
,Ñ
,Ó
.€Cä	˜×	Õ	Ü˜S§$¡$Ó'‰
ˆÜ˜ŸD™DÓ!‰ˆÙ  ¨°RÓ8ˆØŠ=Ø‰GˆA�!Ø�AŒvÜ)ð +*ó +ð +÷ 
ð 	‡y‡y€yØˆà�8‰8�B—D‘D‹>ÔÜ,Ð,äˆQ�—‘‹€AØ�i�i‰iØ�H‰H�R—T‘T‹NˆØŒ5Ü0Ð0à�Y‰Y‹[ˆÜ˜B×Õä˜r§4¡4Ó(‰HˆC�Ø�d•(˜T #�X¤d¨1¯d©d£mÕ3Õ3ˆCØ�d•(ˆCä˜qŸt™t›v r§t¡tÓ,‰HˆC�ä˜S # s¨C°Ó4‰FˆB�÷  ô �2—:‘:“< §
¡
£Õ,¨R¯T©T°1­WÕ4°b·d±dÀ5ÔIˆØ	ˆS�ˆØ��EˆØ	ˆs�U”Z  RÓ(Õ(Õ(‹Ø€H÷S 
×	Ð	ú÷8  ×ús   Á!AJÅ)BJÊJ	ÊJ+	c                ód  € V P                   '       g‰   VP                  R8X  gU   V P                  VP                  4      \	        ^ VP
                  P                  VP                  4      ^,
          4      8”  d$   V'       d   ^RIHp V! WW#4      # \        WW#4      # V P                   '       gL   V P                  VP                  4      VP
                  P                  VP                  4      ^,
          8  Ed   VP                  R8X  g+   VP
                  P                  VP                  4      ^8¼  dÝ   V'       d   ^RIH	p V! WW#4      # \        WW#4      p\        V\        4      '       d   V# Vw  r‰p
\        V4      ;_uu_ 4        V	P                  VP                  4      V
P                  VP                  4      r©V	f   \        R4      hV
f   \        R4      h\!        WšW#4      P                  VP                  4      pRRR4       W‹,           # VP
                  P                  VP                  4      ^8¼  EdE   V P                  VP                  4      VP
                  P                  VP                  4      ^,
          8X  dû   W P                  VP                  4      P#                  4       ) VP
                  P                  VP                  4      P#                  4       ,          8”  d•   V P                  VP                  4      P#                  4       P$                  '       g   \'        R4      hV'       d   \)        R4      h\+        WW#4      p\        V\        4      '       d   V# Vw  rŒp\!        WWÃ4      pW‹,           # V P                   '       d   \)        R	4      hVP                  R
8X  d    V'       d   \)        R4      h\-        WW#4      # VP                  R8X  d    V'       d   \)        R4      h\/        WW#4      # \)        RVP                  ,          4      h  + '       g   i     TX,           # ; i)zø
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.
r]   )Úprde_no_cancel_b_large)Ú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).rX   zIParametric RDE cancellation hyperexponential case is not yet implemented.r\   zBParametric RDE cancellation primitive case is not yet implemented.zBOther Poly (P)RDE cancellation cases are not yet implemented (%s).)r   r_   r+   r   re   r,   rc   r²   r›   r³   r�   Ú
isinstancer   r   r   ra   Úsolve_poly_rder�   Ú	is_numberÚ	TypeErrorr¥   r£   r°   r«   )r?   r†   r#   r8   r‡   r²   r³   ÚRrO   Úb0Úc0Úyrq   rg   s   &&&&&         r'   rµ   rµ   œ  s-  € ð �9�9ˆ9˜"Ÿ'™' VÔ+Ø�H‰H�R—T‘T‹NœS  B§D¡D§K¡K°·±Ó$5¸Õ$9Ó:Ô:çå4Ù)¨!°Ó7Ð7Ü  ¨Ó.Ð.à
�)�)ˆ)�q—x‘x §¡“~¨¯©¯©°B·D±DÓ(9¸AÕ(=Õ=Ø�W‰W˜Ô "§$¡$§+¡+¨b¯d©dÓ"3°qÔ"8çÝ4Ù)¨!°Ó7Ð7ä˜a QÓ+ˆä�aœ×ÒØˆHð ‰IˆA�2Ü ×#Õ#ØŸ™ B§D¡DÓ)¨2¯:©:°b·d±dÓ+;�BØ’:Ü$Ð%DÓEÐEØ’;Ü$Ð%DÓEÐEÜ" 2¨1Ó1×9Ñ9¸"¿$¹$Ó?�÷ $ð •5ˆLà	�‰�‰�R—T‘TÓ	˜aÕ	 A§H¡H¨R¯T©T£N°b·d±d·k±kÀ"Ç$Á$Ó6GÈ!Õ6KÔ$KØ—‘˜2Ÿ4™4“×#Ñ#Ó%Ð% b§d¡d§l¡l°2·4±4Ó&8×&;Ñ&;Ó&=Õ=Ô=ð �y‰y˜Ÿ™‹×!Ñ!Ó#×-×-Ð-ÜÐ7Ó8Ð8çÜ%ð 'ó  ð  ô ˜A 1Ó)ˆä�aœ×ÒØˆHà‰GˆA�!ä˜q QÓ+ˆAØ•5ˆLð �9�9ˆ9Ü%ð 'Bó Cð Cð �w‰w˜%ÔßÜ-ð /Hó Ið Iä! !¨Ó/Ð/à—‘˜KÔ'ßÜ-ð /Aó Bð Bä'¨¨qÓ5Ð5ô *ð +:Ø<>¿G¹Gõ+Dó Eð E÷e $Ö#ð �q•5ˆLús   ÆA9PÐP/	c                óR  € \        WV4      w  pw  r\        WW#V4      w  pw  rxw  ršp\        WgW‰W¤4      w  rÍrï \        WÍWä4      p\        WÍVVV4      w  rÞpppVP                  '       d   TpM\        WÞVV4      pVV,          V,           W¿,          3#   \         d
    \
        p L`i ; i)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.
)	rF   rU   rv   r“   r¥   r   r–   r   rµ   )rI   rJ   rK   rL   r8   Ú_r   rS   rT   rQ   rR   Úhnro   rf   rg   Úhsr#   rq   r‹   r�   r»   s   &&&&&                r'   r¦   r¦   ù  sº   € ô " "¨"Ó-�K€A�xˆÜ ,¨R°R¸RÓ @Ñ€A�xˆ‘�"˜2Ü  r¨rÓ6�K€Aˆ!ðô ˜˜qÓ%ˆô    a¨¨BÓ/Ñ€Aˆ!ˆU�DØ‡y‡y€yØ‰ä˜1  BÓ'ˆà�!�G�d�N˜B�EÐ"Ð"øô ô ô
 Šðús   ¹B ÂB&Â%B&ry   )rW   )rW   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(   r-   rF   rU   rv   r“   r–   r›   r�   r£   r«   r°   rµ   r¦   © r)   r'   Ú<module>rÊ      sŠ   ðñõ. Ý å Ý #ç -Ó -ç 9Ý 9÷[÷ [ñ [ò(òV	%ô0òf"&ôJQôhtòn-ò^ò<+ò^,ò^/òd9ôxZôz'#r)   