#NEWLINE# def no_cancel_b_large( b , c , n , DE ) : #NEWLINE# #INDENT# '\n    Poly Risch Differential Equation - No cancellation: deg(b) large enough.\n\n    Given a derivation D on k[t], n either an integer or +oo, and b, c\n    in k[t] with b != 0 and either D == d/dt or\n    deg(b) > max(0, deg(D) - 1), either raise NonElementaryIntegralException, in\n    which case the equation Dq + b*q == c has no solution of degree at\n    most n in k[t], or a solution q in k[t] of this equation with\n    deg(q) < n.\n    ' #NEWLINE# q = Poly ( 0 , DE . t ) #NEWLINE# while ( not c . is_zero ) : #NEWLINE# #INDENT# m = ( c . degree ( DE . t ) - b . degree ( DE . t ) ) #NEWLINE# if ( not ( 0 <= m <= n ) ) : #NEWLINE# #INDENT# raise NonElementaryIntegralException #NEWLINE# #UNINDENT# p = Poly ( ( ( c . as_poly ( DE . t ) . LC ( ) / b . as_poly ( DE . t ) . LC ( ) ) * ( DE . t ** m ) ) , DE . t , expand = False ) #NEWLINE# q = ( q + p ) #NEWLINE# n = ( m - 1 ) #NEWLINE# c = ( ( c - derivation ( p , DE ) ) - ( b * p ) ) #NEWLINE# #UNINDENT# return q