SymPy
by SymPy Development Team · Library
Pure-Python computer algebra system for symbolic algebra, calculus, equation solving, matrices, physics modules, code generation and LaTeX output
Overview
SymPy is an open-source computer algebra system written entirely in Python and released under the BSD 3-Clause license; its only hard dependency is mpmath for arbitrary-precision arithmetic. It performs symbolic simplification, expansion and factorization, calculus (limits, derivatives, integrals, series), equation solving (algebraic, Diophantine, inequalities, ODEs and PDEs), linear algebra with dense, sparse and symbolic matrices, number theory, combinatorics and statistics, with physics modules for mechanics, vectors, quantum mechanics, optics, control and unit systems. Expressions print to LaTeX, MathML and plain text, and the code-generation module emits C, Fortran, Python and other targets, which lets researchers derive a model symbolically and then compile it for numerical work.
Version 1.14.0 is current in the documentation at the time of writing. SymPy is used for deriving first-order conditions, checking algebra in theoretical papers and generating equations for simulation code; it is far slower than compiled systems such as Mathematica or Maple on heavy symbolic computation and has weaker built-in plotting and notebook interfaces, so it is typically paired with Jupyter and NumPy.
Capabilities
- Symbolic simplification, expansion and factorization
- Calculus: limits, derivatives, integrals, series
- Solvers for algebraic, Diophantine, ODE and PDE problems
- Symbolic and numeric matrices
- Physics modules: mechanics, vectors, quantum, control, units
- Code generation to C, Fortran and Python
- LaTeX and MathML printing
Typical workflows
- Deriving and checking first-order conditions for a theory paper
- Generating LaTeX equations from derived expressions
- Symbolic derivation compiled to NumPy or C for simulation
Strengths
- BSD-licensed, pure Python, easy to install
- Integrates with the scientific Python stack
- Readable, extensible codebase
Limitations
- Slower than compiled computer algebra systems
- Limited plotting and GUI
- Some algorithms less complete than Mathematica or Maple
Prerequisites
- Python 3 with mpmath
Who it is for
- Theorists deriving models
- Educators teaching algebra and calculus
- Developers generating numerical code
Alternatives & comparison
Mathematica is the proprietary benchmark for symbolic computation with broader algorithms and notebooks; SciPy is numeric rather than symbolic; Lean proves theorems rather than manipulating expressions. SymPy's niche is free symbolic math inside Python.
- Julia
Dynamically typed, JIT-compiled language for numerical and scientific computing that aims to combine high-level syntax with compiled-code speed
Open sourceOpen source - Lean
Open-source functional programming language and interactive theorem prover with dependent types, the Mathlib mathematics library and VS Code tooling, stewarded by the Lean FRO
Open sourceFree - SciPy
Core open-source Python library for scientific computing on NumPy arrays: optimization, integration, interpolation, linear algebra, sparse matrices, statistics, signal processing
Open sourceFree - Wolfram Mathematica
Wolfram Research's proprietary technical computing system built on the Wolfram Language, with notebooks, symbolic and numeric computation, visualization, machine learning and curated data
ProprietaryPaid
Sources & verification
Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.
- Licensesympy/sympy LICENSEchecked Nov 1, 2026
https://github.com/sympy/sympy/blob/master/LICENSE
Supports: license_spdx, source_model
- Official documentationSymPy 1.14.0 documentationchecked Nov 1, 2026
https://docs.sympy.org/latest/index.html
Supports: capabilities, description
- Official sitechecked Nov 1, 2026
- Confidence
- High
- Reviewed
- Nov 1, 2026
- Links
- Verified · Nov 2, 2026
Spotted an error?
More in Mathematical & statistical computing
pandas
pandas development team (NumFOCUS) · DataFrames & array computing
The standard Python DataFrame library for labeled tabular data, time series and I/O to CSV, Excel, SQL, Parquet and more
Python
Python Software Foundation · Programming languages & runtimes
General-purpose, dynamically typed programming language with a large standard library and the dominant ecosystem for data science and machine learning
QuantLib
QuantLib project (Luigi Ballabio and contributors) · Financial analysis & investing
Open-source C++ library for quantitative finance covering instruments, term structures, pricing engines and calendars, with Python and other bindings
statsmodels
statsmodels developers (NumFOCUS) · Econometrics & causal inference
Python library for estimating statistical and econometric models with R-style formulas, rich result summaries and tests: OLS, GLM, discrete choice, ARIMA, state space, VAR and more
Stata
StataCorp LLC · Mathematical & statistical computing
Commercial statistical software from StataCorp widely used in economics and social science, with editions BE/SE/MP, a command language, Mata and comprehensive PDF manuals
Positron
Posit Software, PBC · Mathematical & statistical computing
Posit's multi-language data-science IDE built on Code OSS, with first-class R and Python consoles, variables and plots panes, under the Elastic License 2.0