ó
    Š*£h¥  ã                   óT   • S r SSKJr  SSKJr  SSKJr  SSKJr  \" S5      S 5       r	g)	zZ
This module implements the Residue function and related tools for working
with residues.
é    )ÚMul)ÚS)Úsympify)ÚtimethisÚresiduec                 ó†  • SSK Jn  SSKJn  [	        U 5      n US:w  a  U R                  XU-   5      n S H>  nU R                  XS9nUR                  U5      (       a  UR                  5       S:¼  d  M>    O   U" WR                  5       U5      nUR                  (       a  UR                  nOU/n[        R                  nU H}  n	U	R                  U5      u  p«[        U6 nU[        R                   U4;   d:  UR"                  (       a  UR$                  R&                  (       d  [)        SU-  5      eUSU-  :X  d  My  XŠ-  nM     U$ )aÇ  
Finds the residue of ``expr`` at the point x=x0.

The residue is defined as the coefficient of ``1/(x-x0)`` in the power series
expansion about ``x=x0``.

Examples
========

>>> from sympy import Symbol, residue, sin
>>> x = Symbol("x")
>>> residue(1/x, x, 0)
1
>>> residue(1/x**2, x, 0)
0
>>> residue(2/sin(x), x, 0)
2

This function is essential for the Residue Theorem [1].

References
==========

.. [1] https://en.wikipedia.org/wiki/Residue_theorem
r   )ÚOrder)Úcollect)r   é   é   é   é   é   é    )Únzterm of unexpected form: %sr   )Úsympy.series.orderr	   Úsympy.simplify.radsimpr
   r   ÚsubsÚnseriesÚhasÚgetnÚremoveOÚis_AddÚargsr   ÚZeroÚas_coeff_mulr   ÚOneÚis_PowÚexpÚ
is_IntegerÚNotImplementedError)ÚexprÚxÚx0r	   r
   r   Úsr   ÚresÚargÚcÚms               ÚR/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sympy/series/residues.pyr   r      s  € õN )Ý.Ü�4‹=€DØ	ˆQƒwØ�y‰y˜ ™FÓ#ˆÛ$ˆØ�L‰L˜ˆLÐ ˆØ�u‰u�U�|‰|˜qŸv™v›x¨1�}Ùñ %ñ 	�—	‘	“˜QÓ€AØ‡x‡xØ�v‰v‰àˆsˆÜ
�&‰&€CÛˆØ×Ñ Ó"‰ˆÜ�ˆGˆØ”a—e‘e˜Q�Z“ A§H§H°·±×1A×1AÜ%Ð&CÀaÑ&GÓHÐHØ��!‘�8Ø‰HŠCñ ð €Jó    N)
Ú__doc__Úsympy.core.mulr   Úsympy.core.singletonr   Úsympy.core.sympifyr   Úsympy.utilities.timeutilsr   r   © r+   r*   Ú<module>r2      s1   ðñõ
 Ý "Ý &Ý .ñ 
ˆ)Óñ<ó ñ<r+   