Home > Backend Development > Python Tutorial > How to use python functions to find derivatives

How to use python functions to find derivatives

coldplay.xixi
Release: 2023-01-03 09:28:09
Original
27884 people have browsed it

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.

How to use python functions to find derivatives

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

How to use python functions to find derivatives

2. Import Differential module packagefrom sympy import *

How to use python functions to find derivatives

3. Define symbol variablesx = symbols('x')

How to use python functions to find derivatives

4. Define a function f = x**9

How to use python functions to find derivatives

5, diff = diff(f,x)Derivation

How to use python functions to find derivatives

6. Finally, enter diff to display the variable value

How to use python functions to find derivatives

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template