Cancel[expr]
cancels out common factors in the numerator and denominator of expr.
Cancel
Cancel[expr]
cancels out common factors in the numerator and denominator of expr.
Details and Options
- Cancel cancels out the greatest common divisor of the numerator and denominator.
- Cancel takes the following options:
-
Extension None coefficient field to be used Modulus 0 modulus to assume for integers Trig False whether to do trigonometric as well as algebraic transformations - 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.
- Cancel automatically threads over lists, as well as equations, inequalities and logic functions.
Examples
open all close allBasic Examples (1)
Scope (3)
Cancel threads over sums:
Cancel[(x - y) / (x ^ 2 - y ^ 2) + (x ^ 3 - 27) / (x ^ 2 - 9) + (x ^ 3 + 1) / (x ^ 2 - x + 1)]Cancel threads over Boolean combinations of equations and inequalities:
Cancel[(x - a) / (x ^ 2 - a ^ 2) == 0 && (x ^ 2 - 2x + 1) / (x - 1) ≥ 0]ℱ = FiniteField[17, 3];Cancel[(ℱ[1]x ^ 2 + ℱ[246]x + ℱ[4436]) / (ℱ[3]x ^ 2 + ℱ[1771])]Options (4)
Extension (2)
By default, Cancel treats algebraic numbers as independent variables:
r = (x ^ 2 - 2) / (Sqrt[2] + x);Cancel[r]With Extension->Automatic, Cancel recognizes algebraically dependent coefficients:
Cancel[r, Extension -> Automatic]Cancel common factors over a finite field:
ℱ = FiniteField[2, 3];Cancel[(x ^ 4 + 1) / (x + 1), Extension -> ℱ]Modulus (1)
Properties & Relations (1)
See Also
Related Guides
History
Introduced in 1988 (1.0) | Updated in 1996 (3.0) ▪ 2007 (6.0) ▪ 2023 (13.3)
Text
Wolfram Research (1988), Cancel, Wolfram Language function, https://reference.wolfram.com/language/ref/Cancel.html (updated 2023).
CMS
Wolfram Language. 1988. "Cancel." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/Cancel.html.
APA
Wolfram Language. (1988). Cancel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Cancel.html
BibTeX
@misc{reference.wolfram_2026_cancel, author="Wolfram Research", title="{Cancel}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/Cancel.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_cancel, organization={Wolfram Research}, title={Cancel}, year={2023}, url={https://reference.wolfram.com/language/ref/Cancel.html}, note=[Accessed: 13-June-2026]}