I'm trying to use the derivative function found using sympy.diff
to calculate other values. For some reason I get this message when I try my code:
ValueError: First variable cannot be a number: 4
Here is my code:
import sympy as sp
def f(x):
return (x**2-3)/2
x = sp.Symbol('x')
def df(x):
return sp.diff(f(x), x, 1)
print('la dérivée de f(x) est:', df(x))
print(df(4))
question from:https://stackoverflow.com/questions/66055141/cant-use-the-derivative-function-found-with-sympy-diff