def recognize_derivative(a, d, DE, z=None):
 flag = True
 (a, d) = a.cancel(d, include=True)
 (q, r) = a.div(d)
 (Np, Sp) = splitfactor_sqf(d, DE, coefficientD=True, z=z)
 j = 1
 for (s, i) in Sp:
  (delta_a, delta_d, H) = laurent_series(r, d, s, j, DE)
  g = gcd(d, H[(-1)]).as_poly()
  if (g is not d):
   flag = False
   break
  j = (j + 1)
 return flag

def recognize_derivative ( a , d , DE , z = None ) : flag = True ( a , d ) = a . cancel ( d , include = True ) ( q , r ) = a . div ( d ) ( Np , Sp ) = splitfactor_sqf ( d , DE , coefficientD = True , z = z ) j = 1 for ( s , i ) in Sp : ( delta_a , delta_d , H ) = laurent_series ( r , d , s , j , DE ) g = gcd ( d , H [ ( - 1 ) ] ) . as_poly ( ) if ( g is not d ) : flag = False break j = ( j + 1 ) return flag
compute the squarefree factorization of the denominator of f and for each di the polynomial h in k[x] .