This wiki is in the process of being archived due to lack of usage and the resources necessary to serve it — predominately to bots, crawlers, and LLM companies. Edits are discouraged.
Pages are preserved as they were at the time of archival. For current information, please visit python.org.
If a change to this archive is absolutely needed, requests can be made via the infrastructure@python.org mailing list.

SymPy is a symbolic manipulation package, written in pure Python. Its aim is to become a full featured CAS in Python, while keeping the code as simple as possible in order to be comprehensible and easily extensible.

http://sympy.org/media/logo.png

Homepage: http://sympy.org/

Source Code: http://github.com/sympy/sympy

Mailing list: https://groups.google.com/forum/?fromgroups#!forum/sympy

Examples

>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)

>>> integrate(exp(x)*x**2, x)
βŽ› 2          ⎞  x
⎝x  - 2β‹…x + 2βŽ β‹…β„―

>>> expand((x + y)**3)
 3      2          2    3
x  + 3β‹…x β‹…y + 3β‹…xβ‹…y  + y
>>> factor(_)
       3
(x + y)

>>> Sum((-1)**n*x**n/factorial(n), (n, 0, oo))
  ∞
 ____
 β•²
  β•²       n  n
   β•²  (-1) β‹…x
   β•±  ────────
  β•±      n!
 β•±
 β€Ύβ€Ύβ€Ύβ€Ύ
n = 0
>>> _.doit()
 -x
β„―

2026-02-14 16:13