SymPy is the foremost symbolic computation library for Python. It is a powerful and fast computer algebra system. See the Sympy Tutorial for a more detailed introduction.
Symbols are created with the sympy.Symbol() constructor or the sympy.symbols() method.
Symbols can generally be treated as numbers with the basic operations +-/*, but math functions have to be from SymPy.
As you can see, SymPy is pretty smart about its simplifications! It will apply various common identities to decrease the number of terms.
As all symbolic computation libraries do, SymPy allows you to substitute in numerical values for symbols
SymPy supports a variety of matrix operations, though for numerical purposes it is much slower than NumPy.
SymPy can calculate matrix exponentials without diagonalizing:
SymPy can also perform many linear algebra matrix decompositions, including the LU, QR, and Cholesky decompositions. Some things you can do are found in the documentation.
SymPy can solve ODEs in the form g(f, f', ...) = 0.
SymPy can perform Laplace transforms and invert them too.