def _handle_Integral(expr, func, order, hint):
 global y
 x = func.args[0]
 f = func.func
 if (hint == '1st_exact'):
  sol = expr.doit().subs(y, f(x))
  del y
 elif (hint == '1st_exact_Integral'):
  sol = Eq(Subs(expr.lhs, y, f(x)), expr.rhs)
  del y
 elif (hint == 'nth_linear_constant_coeff_homogeneous'):
  sol = expr
 elif (not hint.endswith('_Integral')):
  sol = expr.doit()
 else:
  sol = expr
 return sol

def _handle_Integral ( expr , func , order , hint ) : global y x = func . args [ 0 ] f = func . func if ( hint == '1st_exact' ) : sol = expr . doit ( ) . subs ( y , f ( x ) ) del y elif ( hint == '1st_exact_Integral' ) : sol = Eq ( Subs ( expr . lhs , y , f ( x ) ) , expr . rhs ) del y elif ( hint == 'nth_linear_constant_coeff_homogeneous' ) : sol = expr elif ( not hint . endswith ( '_Integral' ) ) : sol = expr . doit ( ) else : sol = expr return sol
converts a solution with integrals in it into an actual solution .