Search notes:

Python library: SymPy

SymPy is a Python library, written entirely in Python, for symbolic mathematics whose goal is to become a full-featured computer algebra system (CAS).
>>> import sympy
>>> sympy.sqrt(8)
2*sqrt(2)

Example: Differentiation of a polynomial function

The following function differentiates the polynomial ax2+bx+c. When run, it prints 2*a*x + b.
import sympy

x, a, b, c = sympy.symbols('x a b c')
f = a * x**2 + b * x + c
dfdx = sympy.diff(f, x)
print(dfdx)

Index