Sympy : Symbolic Mathematics in Python

http://www.scipy-lectures.org/packages/sympy.html


In [3]:
from sympy import *
x = Symbol('x')
y = Symbol('y')

In [4]:
integrate(x**3, (x, -1, 1))


Out[4]:
0

In [5]:
integrate( 1/x )


Out[5]:
log(x)

In [7]:
integrate( 1/(1 +2*x) )


Out[7]:
log(2*x + 1)/2

In [8]:
integrate( 1/(1 - 2*x) )


Out[8]:
-log(2*x - 1)/2

In [ ]: