Algebra (50)

Polynomial arithmetic and symbolic manipulation.

apart
Partial fraction decomposition; univariate rationals with distinct rational roots decompose via residues, everything else falls back to numeric-only
Syntax
apart(expr)
cancel
Cancel common factors; univariate integer-coefficient rationals cancel exactly via polynomial GCD (e.g. (x^2-1)/(x-1) → x + 1), everything else falls back to numeric-only
Syntax
cancel(expr)
coefficientList
Extract coefficients
Syntax
coefficientList(expr, var)
collect
Collect like terms
Syntax
collect(expr, var)
combine
Combine fractions
Syntax
combine(expr)
complexExpand
Expand complex expressions
Syntax
complexExpand(expr)
degree
Polynomial degree
Syntax
degree(coeffs)
derivative
The factory layer adds the expression-tree functions simplify, simplifyConstant, simplifyCore, derivative, rationalize, symbolicEqual, resolve, leafCount, and node constructors via parse.
Syntax
derivative(…)
descartesSignChanges
Sign changes of the coefficient sequence: an upper bound on the number of positive real roots
Syntax
descartesSignChanges(coeffs)
Typesnumber[]
differences
nth finite differences
Syntax
differences(arr[, n])
discriminant
Discriminant
Syntax
discriminant(coeffs)
element
Extract a sub-expression
Syntax
element(expr, i)
eliminate
Eliminate a variable from a system
Syntax
eliminate(system, var)
expand
Expand (distribute) and collect like terms; polynomials in one OR MORE variables expand exactly (e.g. (x+y)^2 → x^2+2xy+y^2), non-polynomial pieces fall back to distribute-only
Syntax
expand(expr)
expToTrig
Convert between exp and trig forms
Syntax
expToTrig(expr)
factor
Factor completely into irreducibles over ℤ/ℚ, both univariate and multivariate. Univariate via the Zassenhaus algorithm (x^4-1 → (x-1)*(x+1)*(x^2+1); ℚ-irreducibles like x^4+1 returned unchanged). Multivariate via Kronecker substitution onto the univariate engine (x^2-y^2 → (x-y)*(x+y), (x+y+1)(x+2y+3) expanded → its two linear factors, (x+y)^2*(x+2y)), with the content/common-monomial/difference-of-squares fast path preserved for the cases it already handled. Bounded by a substituted-degree cap (Wang/EEZ is the future performance upgrade for very high-degree many-variable inputs)
Syntax
factor(expr)
fullSimplify
Full algebraic simplification
Syntax
fullSimplify(expr)
functionExpand
Expand special functions
Syntax
functionExpand(expr)
isolateRealRoots
Disjoint intervals [lo, hi] that each contain exactly one real root (Cauchy bound plus bisection by Sturm counts)
Syntax
isolateRealRoots(coeffs[, { bound, minWidth }])
Typesnumber[]
leafCount
The factory layer adds the expression-tree functions simplify, simplifyConstant, simplifyCore, derivative, rationalize, symbolicEqual, resolve, leafCount, and node constructors via parse.
Syntax
leafCount(…)
normalForm
Canonical normal form
Syntax
normalForm(expr)
parse
Parse an expression into an AST node
Syntax
parse(expr)
polyadd
Polynomial add / multiply
Syntax
polyadd(a, b)
polyder
nth polynomial derivative
Syntax
polyder(coeffs[, n])
polymul
Polynomial add / multiply
Syntax
polymul(a, b)
polynomialGCD
Polynomial GCD / LCM
Syntax
polynomialGCD(a, b)
polynomialLCM
Polynomial GCD / LCM
Syntax
polynomialLCM(a, b)
polynomialQuotient
Polynomial division
Syntax
polynomialQuotient(a, b)
polynomialRemainder
Polynomial division
Syntax
polynomialRemainder(a, b)
polynomialRoot
Polynomial roots (factory layer)
Syntax
polynomialRoot(coeffs)
polyval
Evaluate a polynomial (Horner)
Syntax
polyval(coeffs, x)
powerExpand
Expand powers
Syntax
powerExpand(expr)
rationalize
The factory layer adds the expression-tree functions simplify, simplifyConstant, simplifyCore, derivative, rationalize, symbolicEqual, resolve, leafCount, and node constructors via parse.
Syntax
rationalize(…)
realRoots
All real roots, ascending: isolate with Sturm counts, then refine each interval (default tol 1e-10); repeated roots are reduced to the squarefree part first; zero polynomial throws RangeError
Syntax
realRoots(coeffs[, tol])
Typesnumber[]
resolve
The factory layer adds the expression-tree functions simplify, simplifyConstant, simplifyCore, derivative, rationalize, symbolicEqual, resolve, leafCount, and node constructors via parse.
Syntax
resolve(…)
resultant
Resultant of two polynomials
Syntax
resultant(p, q)
simplify
The factory layer adds the expression-tree functions simplify, simplifyConstant, simplifyCore, derivative, rationalize, symbolicEqual, resolve, leafCount, and node constructors via parse.
Syntax
simplify(…)
simplifyConstant
The factory layer adds the expression-tree functions simplify, simplifyConstant, simplifyCore, derivative, rationalize, symbolicEqual, resolve, leafCount, and node constructors via parse.
Syntax
simplifyConstant(…)
simplifyCore
The factory layer adds the expression-tree functions simplify, simplifyConstant, simplifyCore, derivative, rationalize, symbolicEqual, resolve, leafCount, and node constructors via parse.
Syntax
simplifyCore(…)
sturmRootCount
Number of distinct real roots in the half-open interval (a, b] from sign changes of the Sturm chain
Syntax
sturmRootCount(coeffs, a, b)
Typesnumber[]
sturmSequence
Sturm chain of the polynomial (coefficients ascending, the polyval order)
Syntax
sturmSequence(coeffs)
Typesnumber[]
substitute
Variable substitution
Syntax
substitute(expr, var, val)
symbolicEqual
The factory layer adds the expression-tree functions simplify, simplifyConstant, simplifyCore, derivative, rationalize, symbolicEqual, resolve, leafCount, and node constructors via parse.
Syntax
symbolicEqual(…)
symbolicPartialDerivative
Symbolic partial derivative
Syntax
symbolicPartialDerivative(expr, var)
tangentLine
Tangent line
Syntax
tangentLine(expr, var, point)
together
Combine into a single fraction; univariate rationals combine exactly over a common denominator, everything else falls back to numeric-only
Syntax
together(expr)
trigExpand
Trig expansion / reduction
Syntax
trigExpand(expr)
trigReduce
Trig expansion / reduction
Syntax
trigReduce(expr)
trigToExp
Convert between exp and trig forms
Syntax
trigToExp(expr)
variables
Free variables of an expression
Syntax
variables(expr)