This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Algebraic Computation / Formula Manipulation  /
Cancel

  • Cancel[ expr ] cancels out common factors in the numerator and denominator of expr.
  • Example: Cancel[(x^2-1)/(x-1)].
  • Cancel is Listable.
  • Cancel cancels out the greatest common divisor of the numerator and denominator.
  • Cancel[ expr , Modulus-> p ] generates a result modulo p.
  • Cancel[ expr , Extension->Automatic] allows operations to be performed on algebraic numbers in expr.
  • Cancel[ expr , Trig -> True] treats trigonometric functions as rational functions of exponentials, and manipulates them accordingly.
  • See the Mathematica book: Section 1.4.5Section 3.3.3.
  • See also: Apart, GCD.

    Further Examples

    This cancels common factors in each fraction.

    In[1]:=

    Out[1]=

    This uses multiple-angle formulas.

    In[2]:=

    Out[2]=

    This cancels over the integers modulo .

    In[3]:=

    Out[3]=

    To cancel out common factors in the numerator and denominator, you can set Extension -> Automatic.

    In[4]:=

    Out[4]=

    In[5]:=

    Out[5]=