Home>Article>Backend Development> How to use python functions to find derivatives
The method of using python function to find derivatives: first, python running environment, import the differential module package; then define symbolic variables and functions; then find the derivative [diff = diff(f,x)]; finally enter diff. Its variable value is displayed.
The operating environment of this tutorial: Windows 7 system, python version 3.9, DELL G3 computer.
How to use python functions to find derivatives:
1. Open the python running environment
2. Import Differential module packagefrom sympy import *
3. Define symbol variablesx = symbols('x')
4. Define a functionf = x**9
5,diff = diff(f,x)
Derivation
6. Finally, enter diff to display the variable value
Related free learning recommendations:python video tutorial
The above is the detailed content of How to use python functions to find derivatives. For more information, please follow other related articles on the PHP Chinese website!