Skip to content

FullSimplify ​

Simplify expr harder than Simplify, trying a wider set of transformations including special-function identities. Provided by @enumeratio/analytic.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageFullSimplify!
FullSimplify(expr)compute-engine's own simplify(), plus a few extra targeted passes.
SageMathSR(expr).simplify_full()SymPysimplify(expr)
Typed signatures
TypePackageApplies
(expression) -> expressionanalyticalways

Domain: Transformations

Details
  • Starts from compute-engine's native simplify(), which already folds the Pythagorean identity and a double-angle product on its own.
  • Adds exactly four passes: the Gamma functional equation Γ(a)/Γ(b) for a concrete integer a−b; the hyperbolic Pythagorean identity cosh²(u) − sinh²(u) = 1; denesting Sqrt(a + 2·Sqrt(b)) for concrete rational a, b with a rational discriminant; and ExpToTrig everywhere in the tree (which is how a (e^x − e^(−x))/2 shows up as Sinh(x), with no separate 'looks like a hyperbolic definition' rule needed).
  • NOT a general simplifier: no broader special-function identity table beyond the one Gamma shift above, no general nested-radical denesting past the one quadratic form, and no trigonometric identities beyond what simplify() already has. An expression needing more than this list is left exactly as simplify() leaves it.

Examples

2 more kept as data, checked against the oracles
Basic #

The Pythagorean identity

live ↗
InFullSimplify(sin⁡(x)2+cos⁡(x)2)\mathrm{FullSimplify}(\sin(x)^2+\cos(x)^2)Out11

Recognizes the definition of Sinh

live ↗
InFullSimplify(12(ex−e−x))\mathrm{FullSimplify}(\frac{1}{2}(e^{x}-e^{-x}))Outsinh⁡(x)\sinh(x)
Scope #

Folds the double-angle product

live ↗
InFullSimplify(2sin⁡(x)cos⁡(x))\mathrm{FullSimplify}(2\sin(x)\cos(x))Outsin⁡(2x)\sin(2x)

The functional equation of Gamma

live ↗
InFullSimplify(Γ(x+1)Γ(x))\mathrm{FullSimplify}(\frac{Γ(x+1)}{Γ(x)})Outxx

Denests 5+26=2+3\sqrt{5 + 2\sqrt6} = \sqrt2 + \sqrt3

live ↗
InFullSimplify((2+3)−5+26)\mathrm{FullSimplify}((\sqrt{2}+\sqrt{3})-\sqrt{5+2\sqrt{6}})Out00

The hyperbolic Pythagorean identity

live ↗
InFullSimplify(cosh⁡(x)2−sinh⁡(x)2)\mathrm{FullSimplify}(\cosh(x)^2-\sinh(x)^2)Out11

A difference of squares multiplies out to x20−1x^{20}-1

live ↗
InFullSimplify((x10−1)(x10+1))\mathrm{FullSimplify}((x^{10}-1)(x^{10}+1))Outx20−1x^{20}-1

A Machin-type identity collapses to exactly π\pi

live ↗
InFullSimplify(16arctan⁡(15)−4arctan⁡(1239))\mathrm{FullSimplify}(16\arctan(\frac{1}{5})-4\arctan(\frac{1}{239}))Outππ

A trigonometric polynomial is only partly rewritten

live ↗
InFullSimplify(4sin⁡(x)cos⁡(x)+4sin⁡(x)2cos⁡(x)2+1)\mathrm{FullSimplify}(4\sin(x)\cos(x)+4\sin(x)^2\cos(x)^2+1)Out2sin⁡(2x)+4sin⁡(x)2cos⁡(x)2+12\sin(2x)+4\sin(x)^2\cos(x)^2+1
live ↗
InFullSimplify((1−i)eix+(1+i)e−ix)\mathrm{FullSimplify}((1-i)e^{i x}+(1+i)e^{-i x})Out2sin⁡(x)+2cos⁡(x)2\sin(x)+2\cos(x)
live ↗
InAssuming(Re(x)>0,FullSimplify(eGammaLn(x)))\mathrm{Assuming}(\mathrm{Re}(x)\gt0, \mathrm{FullSimplify}(e^{\mathrm{GammaLn}(x)}))OutΓ(x)Γ(x)

ExpToTrig is kept only where it shortens the expression: exe^x is no simpler as cosh⁡x+sinh⁡x\cosh x+\sinh x

live ↗
InFullSimplify(ex)\mathrm{FullSimplify}(e^{x})Outexe^{x}
live ↗
InAssuming(ℜ(x)>0,FullSimplify(eGammaLn(x)))\mathrm{Assuming}(\Re(x)\gt0, \mathrm{FullSimplify}(e^{\mathrm{GammaLn}(x)}))OutΓ(x)Γ(x)
About
Examples15
Checked againstWolfram Language 14 agree1 differSageMath 11 agree2 differSymPy 10 agree3 differ
CrosswalkWolfram LanguageSageMathSymPy

Implementation

mappedsympypackages/oracle/src/mappings.ts

SymPy has no stronger simplifier than simplify, so FullSimplify maps to the same call as Simplify. The scan compares what each answers by value (the difference simplifies to zero, or agrees at sample points), not by form; an answer ours leaves as written is no agreement unless SymPy leaves it too. Assumptions (a second operand) are not mapped.

mappedsagepackages/oracle/src/mappings.ts

See also: FunctionExpand, ExpToTrig