0

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)
Aniket Tiratkar
  • 798
  • 6
  • 16

1 Answers1

0

resolution

from sympy import *

x = Symbol('x')
f = (x**2 - 612) 

dx = (diff(f,x)) 
r = dx.subs({x:10})

print(r)