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:  # n < 0 or m < 0 or 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.
dataset/ETHPy150Open sympy/sympy/sympy/integrals/rde.py/no_cancel_b_large