import sympy
sympy.init_printing()
from sympy import I, pi, oo
import numpy as np
x = sympy.Symbol('x')
y = sympy.Symbol('y')
z = sympy.Symbol('z')
f = sympy.Function('f')(x)
print('diff x:',sympy.diff(f, x))
print('diff x:',sympy.diff(f, x, x))
print('diff x:',sympy.diff(f, x, 3))
g = sympy.Function('g')(x, y)
result = g.diff(x, y)
result = g.diff(x,2,y,3)
expr = x4 + x3 + x**2 + x + 1
result = expr.diff(x)
result = expr.diff(x, x)
expr = (x + 1)**3 * y ** 2 * (z - 1)
result = expr.diff(x, y, z)
expr = sympy.sin(x * y) * sympy.cos(x / 2)
result = expr.diff(x)
expr = sympy.special.polynomials.hermite(x, 0)
result = expr.diff(x).doit()
d = sympy.Derivative(sympy.exp(sympy.cos(x)), x)
result = d.doit()
a, b, x, y = sympy.symbols("a, b, x, y")
f = sympy.Function("f")(x)
result = sympy.integrate(f)
result = sympy.integrate(f, (x, a, b))
result = sympy.integrate(sympy.sin(x))
print('result = ',result)
print('result = ',sympy.integrate(sympy.sin(x), (x, a, b)))
result = sympy.integrate(sympy.exp(-x**2), (x, 0, oo))
print('result = ',result)
result = sympy.integrate(sympy.exp(-x2), (x, 0, oo))
a, b, c = sympy.symbols("a, b, c", positive=True)
result = sympy.integrate(a * sympy.exp(-((x-b)/c)2), (x, -oo, oo))