def no_cancel_b_large(b, c, n, DE):
 q = Poly(0, DE.t)
 while (not c.is_zero):
  m = (c.degree(DE.t) - b.degree(DE.t))
  if (not (0 <= m <= n)):
   raise NonElementaryIntegralException
  p = Poly(((c.as_poly(DE.t).LC() / b.as_poly(DE.t).LC()) * (DE.t ** m)), DE.t, expand=False)
  q = (q + p)
  n = (m - 1)
  c = ((c - derivation(p, DE)) - (b * p))
 return q

def no_cancel_b_large ( b , c , n , DE ) : q = Poly ( 0 , DE . t ) while ( not c . is_zero ) : m = ( c . degree ( DE . t ) - b . degree ( DE . t ) ) if ( not ( 0 <= m <= n ) ) : raise NonElementaryIntegralException p = Poly ( ( ( c . as_poly ( DE . t ) . LC ( ) / b . as_poly ( DE . t ) . LC ( ) ) * ( DE . t ** m ) ) , DE . t , expand = False ) q = ( q + p ) n = ( m - 1 ) c = ( ( c - derivation ( p , DE ) ) - ( b * p ) ) return q
poly risch differential equation - no cancellation: deg(b) large enough .