# SymPy

Open\-source Python library for symbolic mathematics, expression manipulation and links to numerical evaluation\.

ID: Q174 · Revision: 158

Type: software · License: BSD license[^sympy-home] · Status: active

Website: https://www.sympy.org/en/index.html



SymPy is a Python library for symbolic mathematics\. It represents mathematical expressions as objects that can be manipulated, differentiated, integrated or passed to supported solvers\. It can participate in a Python application or interactive workflow without requiring a separate proprietary computer\-algebra system\.[^sympy-home]

## Symbolic objects and Python rules

Symbols must be represented explicitly, and ordinary Python syntax still applies\. Exponentiation, assignment and equality do not automatically acquire the conventions of a handwritten mathematical expression\. In particular, structural equality is different from establishing a mathematical identity\. Exact symbolic inputs also need to be distinguished from floating\-point calculations performed before an expression reaches SymPy\.[^sympy-gotchas]

## Connecting symbolic and numerical work

The lambdify facility turns supported symbolic expressions into functions for numerical evaluation with selected libraries\. This provides a bridge from a derived expression to repeated calculation on numerical inputs\. It is not a universal compiler for every symbolic construct, and its documentation warns that it uses executable code generation and should not process untrusted, unsanitized input\.[^sympy-lambdify]

## Mathematica expression import

SymPy's Mathematica parser translates supported expression strings into SymPy objects\. If it cannot find a suitable equivalent, it can preserve a Mathematica\-style full\-form tree using generic function objects\. That fallback retains structure without proving that the original operation has been implemented\. Parsing an expression is consequently a narrower capability than running a Wolfram notebook or translating a complete application\.[^sympy-parser]

## Library licensing and environment

SymPy is distributed under a BSD license and is designed to be used as a library\. The user supplies the surrounding Python environment and any additional interface or numerical dependencies required by the project\. Its licensing model permits reuse under its terms, but availability of the source is not a guarantee that every desired expression has a closed\-form solution\.[^sympy-home][^sympy-lambdify]

## Substitution considerations

SymPy can substitute for [Wolfram Mathematica](/wolframmathematica) for supported symbolic manipulation and equation\-solving tasks embedded in Python\. It does not replace the complete Mathematica notebook interface or every Wolfram Language service\. The useful comparison is the expressions, assumptions, solvers and downstream numerical code a project needs, with unsupported parser results and differing expression semantics checked explicitly\.[^sympy-home][^sympy-parser][^mathematica-home]

## Capabilities and substitutions

### Symbolic mathematics — supported

Python expression objects support symbolic manipulation and documented mathematical operations\.[^sympy-home]

Use case: Computer algebra in Python · Platforms: Runtime, platform and dependency dependent · Region: License eligibility, platform support, package dependencies and hosted\-service terms apply\.

### Mathematica parser — limited

Unsupported operations may remain generic function trees rather than executable equivalents\.[^sympy-parser]

Use case: Expression migration · Platforms: Runtime, platform and dependency dependent · Region: License eligibility, platform support, package dependencies and hosted\-service terms apply\.

### [Substitute for Wolfram Mathematica](/wolframmathematica) — limited

Assessment: supported symbolic tasks can use SymPy; this does not replace native notebooks or the whole Wolfram Language ecosystem\.[^sympy-home][^sympy-parser][^mathematica-home]

Use case: Symbolic mathematics in Python · Platforms: Runtime, platform and dependency dependent · Region: License eligibility, platform support, package dependencies and hosted\-service terms apply\.

## References

[^sympy-home]: [SymPy overview](<https://www.sympy.org/en/index.html>) — Python symbolic mathematics library and BSD licensing (vendor; retrieved 2026-10-06T21:57:08Z)

[^sympy-gotchas]: [SymPy introductory gotchas](<https://docs.sympy.org/latest/tutorials/intro-tutorial/gotchas.html>) — Explicit symbols, Python syntax, structural equality and exact numbers (vendor; retrieved 2026-10-06T21:58:10Z)

[^sympy-lambdify]: [SymPy lambdify](<https://docs.sympy.org/latest/modules/utilities/lambdify.html>) — Symbolic expressions to numeric functions; uses exec, not for untrusted input (vendor; retrieved 2026-10-06T21:58:46Z)

[^sympy-parser]: [SymPy expression parsing](<https://docs.sympy.org/latest/modules/parsing.html>) — Mathematica expression parser preserves unsupported forms as symbolic function nodes; not notebook interpreter (vendor; retrieved 2026-10-06T21:58:46Z)

[^mathematica-home]: [Wolfram Mathematica overview](<https://www.wolfram.com/mathematica/>) — Technical computation, symbolic/numeric methods and notebooks (vendor; retrieved 2026-10-06T21:57:08Z)

Source revision: https://substitutefor.net/entities/Q174?revision=158
