import sympy as sym x = sym.symbols('x') print(sym.limit((sym.log(1+x)-x)/x**2, x, 0)) print(sym.limit((1+x)**(1/x), x, 0))