This is my code
from sympy import *
x=symbols('x',positive=True ,real=True)
h=symbols('h', positive=True, real=True)
expr=input('Enter the expression: ')
expr2=expr.replace('x','(x+h)')
actualexp=f"(({expr2})-({expr}))/{h}"
print(limit(actualexp,h,0))
As you see im trying to take a derivative using sympy’s limit function, but this raises a Valueerror and a Syntax error
i tried googling, no result
New contributor
Ficolats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.