Method on @sym: simplify (x)

Simplify an expression.

Example:

syms x
p = x^2 + x + 1
  ⇒ p = (sym)
       2
      x  + x + 1
q = horner (p)
  ⇒ q = (sym) x⋅(x + 1) + 1

d = p - q
  ⇒ d = (sym)
       2
      x  - x⋅(x + 1) + x

isAlways(p == q)
  ⇒ 1

simplify(p - q)
  ⇒ (sym) 0

Please note that simplify is not a well-defined mathematical operation: its precise behaviour can change between software versions (and certainly between different software packages!)

See also: @sym/isAlways, @sym/factor, @sym/expand, @sym/rewrite.

Package: symbolic