import sympy as sym x = sym.Symbol(\'x\') f = sym.Function(\'f\')(x) y = sym.dsolve(sym.diff(f,x)-sym.exp(2*x-1)*f**2,f) print(y) RecursionError: maximum recursion dept