Back to Symbolic Math (SymEngine)
sym.simplify
Simplifies an expression using heuristic algorithms.
Syntax
sym.simplify(expr, assumptions?)
Description
Simplifies an expression using heuristic algorithms. Applies various simplification rules to reduce an expression to a simpler equivalent form. This includes combining like terms, canceling common factors, and applying algebraic identities. When assumptions are provided, the expression is first refined using those assumptions before applying simplification rules. This enables simplifications like `sqrt(x^2) → x` when `x` is known to be positive.
Parameters
| Name | Description |
|---|---|
| expr | - The expression to simplify. |
| assumptions(optional) | - Optional assumptions about symbols (e.g., x is positive). |
Returns
Expr