In [1]:
import sympy
sympy.init_printing(use_latex='mathjax')

In [2]:
a, b, c = sympy.symbols('a b c')

In [3]:
x = sympy.symbols('x')

In [4]:
quadratic = a * x**2 + b * x + c
quadratic


Out[4]:
$$a x^{2} + b x + c$$

In [5]:
sympy.solve(quadratic, x)


Out[5]:
$$\left [ \frac{1}{2 a} \left(- b + \sqrt{- 4 a c + b^{2}}\right), \quad - \frac{1}{2 a} \left(b + \sqrt{- 4 a c + b^{2}}\right)\right ]$$

In [6]:
%run nbconvert.ipynb