Answers for "how to return the derivative of a function in python"

2

how to return the derivative of a function in python

#This prints the derivative of a function
import sympy as sym
x = sym.Symbol('x')
function = x ** 4 + 7 * x ** 3 + 8
derivitive = sym.diff(function)
print(derivitive)
Posted by: Guest on August-18-2020
1

python calculate derivative of function

from sympy import Symbol, Derivative

x= Symbol('x')

function= x**4 + 7*x**3 + 8

deriv= Derivative(function, x)
deriv.doit().subs({x:4})
Posted by: Guest on July-27-2020

Code answers related to "how to return the derivative of a function in python"

Python Answers by Framework

Browse Popular Code Answers by Language