You must parse (recursively) the output expression, and tchack that tour tree does not contain any integrate call (i. e. a subexpression whose operator is sage.all.integrate. This must be recursive because integrate may return a sum or a product whose one term or factr is an unevaluated integrate call...