Sharedsupport / 2018-04-25-sympy tutorial.ipynbOpen in CoCalc
Examples for support purposes...
import sympy
sympy.sqrt(3)
sqrt(3)
x, y = symbols('x y')
expr = x + 2*y
expr
x + 2*y
from sympy import expand, factor
expanded_expr = expand(x*expr)
expanded_expr
x**2 + 2*x*y
factor(expanded_expr)
x*(x + 2*y)