Here is an example that uses SymPy to factor polynomials.
In [ ]:
from ipywidgets import interact
In [ ]:
from sympy import Symbol, Eq, factor
In [ ]:
x = Symbol('x')
In [ ]:
def factorit(n):
return Eq(x**n-1, factor(x**n-1))
In [ ]:
factorit(12)
In [ ]:
interact(factorit, n=(2,40));
In [ ]: