| 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 : |
o
�8Va.j � @ s d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m
Z
mZmZm
Z
ddlmZmZmZ ddlmZmZmZmZmZmZmZ d d
� Zdd� Zd(dd�Zdd� Zd)dd�Zd*dd�Zdd� Z dd� Z!dd� Z"dd� Z#d d!� Z$d"d#� Z%d+d$d%�Z&d&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)�sqrt�re�im)�gcdex_diophantine�frac_in�
derivation�splitfactor�NonElementaryIntegralException�DecrementLevel�recognize_log_derivativec C s� | j rtS |t||�kr| �|��� d d S g }|}| �|�}d}|j r<|�||f� || }|d9 }| �|�}|j s%d}td|�}t|�dkri|�� } || d }
| �|
�}|j rc|| d 7 }|
}t|�dksI|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�productf� r( �5/usr/lib/python3/dist-packages/sympy/integrals/rde.py�order_at( s2
�
�r* c C s | j rtS |�|�| �|� 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 r( r( r) �order_at_ooS s r- Nc sF |pt d�}t|� �\}}t||�� j��}|�|�}|�t||���t|����� j���� j���� j��\}} �t|� j�t �� � �� j��
��� j��}
t|
|�}
|
j�|�sgtd� j��|ffS dd� |
�
� D �}tt� ��fdd�|D �td� j��}t |� �}
|� ||
}|| }|j|dd�\}}|||ffS )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 S s g | ]}|t v r|d kr|�qS )r )r ��.0�ir( r( r) �
<listcomp>� s z#weak_normalizer.<locals>.<listcomp>c s, g | ]}t �t|� j�t�� � ���qS r( )r r r r )r0 r$ ��DEr �d1r( r) r2 � s , T��include)r r r �diffr �quor
r r r � resultant�expr�has�
real_rootsr r r )r r, r4 r. �dn�ds�g�
d_sqf_part�a1�br"