 Pretty-printing will use unicode symbols when available in the current environment, otherwise it will fall back to ASCII characters.»> from sympy import pprint, init_printing, Symbol, sin, cos, exp, sqrt, series, Integral, Function
»> x = Symbol("x")
»> y = Symbol("y")
»> f = Function('f')
»> # pprint will default to unicode if available
»> pprint( x**exp(x) )
x 
»> # An output without unicode
»> pprint(Integral(f(x), x), use_unicode=False)
/ 
»> # Compare with same expression but this time unicode is enabled
»> pprint(Integral(f(x), x), use_unicode=True)
⎮ f(x) dx
»> # Alternatively, you can call init_printing() once and pretty-print without the pprint function.»> init_printing()
»> sqrt(sqrt(exp(x)))
4 ╱ x 
╲╱ ℯ 
»> (1/cos(x)).series(x, 0, 10)
1 + ── + ──── + ───── + ────── + O⎝x ⎠

»> from sympy import init_printing, Symbol, expand
»> init_printing()
»> a = Symbol('a')
»> b = Symbol('b')
»> e = (a + b)**5
»> e
(a + b) 
»> e.expand()
a + 5⋅a ⋅b + 10⋅a ⋅b + 10⋅a ⋅b + 5⋅a⋅b + b 

»> from sympy import Rational, pprint
»> e = 2**50 / Rational(10)**50
»> pprint(e)
1/88817841970012523233890533447265625

»> from sympy import init_printing, symbols, ln, diff
»> init_printing()
»> x, y = symbols('x y')
»> f = x**2 / y + 2 * x - ln(y)
»> diff(f, x)
»> diff(f, y)
»> diff(diff(f, x), y)
»> from sympy import symbols, cos
»> from sympy.plotting import plot3d
»> x, y = symbols('x y')
»> plot3d(cos(x*3)*cos(y*5)-y, (x, -1, 1), (y, -1, 1))


»> from sympy import init_printing, Symbol, limit, sqrt, oo
»> init_printing()
»> x = Symbol('x')
»> limit(sqrt(x**2 - 5*x + 6) - x, x, oo)
-5/2
»> limit(x*(sqrt(x**2 + 1) - x), x, oo)
1/2
»> limit(1/x**2, x, 0)
»> limit(((x - 1)/(x + 1))**x, x, oo)
ℯ

»> from sympy import init_printing, Symbol, Function, Eq, dsolve, sin, diff
»> init_printing()
»> x = Symbol("x")
»> f = Function("f")
»> eq = Eq(f(x).diff(x), f(x))
»> eq
d 
──(f(x)) = f(x)
dx 
»> dsolve(eq, f(x))
f(x) = C₁⋅ℯ
»> eq = Eq(x**2*f(x).diff(x), -3*x*f(x) + sin(x)/x)
»> eq
x ⋅──(f(x)) = -3⋅x⋅f(x) + ──────
»> dsolve(eq, f(x))
f(x) = ───────────

»> from sympy import init_printing, integrate, Symbol, exp, cos, erf
»> init_printing()
»> x = Symbol('x')
»> # Polynomial Function
»> f = x**2 + x + 1
»> f
x + x + 1
»> integrate(f,x)
x x 
── + ── + x
3 2 
»> # Rational Function
»> f = x/(x**2+2*x+1)
»> f
x + 2⋅x + 1

»> integrate(f, x)
log(x + 1) + ─────
»> # Exponential-polynomial functions
»> f = x**2 * exp(x) * cos(x)
»> f
x ⋅ℯ ⋅cos(x)
»> integrate(f, x)
x ⋅ℯ ⋅sin(x) x ⋅ℯ ⋅cos(x) x ℯ ⋅sin(x) ℯ ⋅cos(x)
──────────── + ──────────── - x⋅ℯ ⋅sin(x) + ───────── - ─────────
»> # A non-elementary integral
»> f = exp(-x**2) * erf(x)
»> f
ℯ ⋅erf(x)
»> integrate(f, x)

╲╱ π ⋅erf (x)

»> from sympy import Symbol, cos, sin, pprint
»> x = Symbol('x')
»> e = 1/cos(x)
»> pprint(e)
cos(x)
»> pprint(e.series(x, 0, 10))
1 + ── + ──── + ───── + ────── + O⎝x ⎠
»> e = 1/sin(x)
»> pprint(e)
sin(x)
»> pprint(e.series(x, 0, 4))
1 x 7⋅x ⎛ 4⎞
─ + ─ + ──── + O⎝x ⎠
x 6 360 

»> from sympy import *
»> x = Symbol('x')
»> y = Symbol('y')
»> facts = Q.positive(x), Q.positive(y)
»> with assuming(*facts)