I have the function (x ** 2 - 612)
,
Its derivative is (2*x)
, in which sympy
.
However, I would like to assign a value for x
.
example: (2*10)
import sympy as sp
x = sp.Symbol('x')
func = (x**2 - 612)
dx = (sp.diff(func,x))
print(dx)
I have the function (x ** 2 - 612)
,
Its derivative is (2*x)
, in which sympy
.
However, I would like to assign a value for x
.
example: (2*10)
import sympy as sp
x = sp.Symbol('x')
func = (x**2 - 612)
dx = (sp.diff(func,x))
print(dx)
from sympy import *
x = Symbol('x')
f = (x**2 - 612)
dx = (diff(f,x))
r = dx.subs({x:10})
print(r)