Together[expr]
puts terms in a sum over a common denominator, and cancels factors in the result.
Together
Together[expr]
puts terms in a sum over a common denominator, and cancels factors in the result.
Details and Options
- Together makes a sum of terms into a single rational function.
- The denominator of the result of Together is typically the lowest common multiple of the denominators of each of the terms in the sum.
- Together avoids expanding out denominators unless it is necessary.
- Together is effectively the inverse of Apart.
- Together 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 - Together[expr,Extension->Automatic] allows operations to be performed on algebraic numbers in expr.
- Together[expr,Trig->True] treats trigonometric functions as rational functions of exponentials and manipulates them accordingly.
- Together automatically threads over lists, as well as equations, inequalities and logic functions.
Examples
open all close allBasic Examples (2)
Scope (8)
Combine a sum of any number of terms:
Together[(1/x) + (1/x + 1) + (1/x + 2) + (1/x + 3)]Here all factors of the denominator divide the numerator:
Together[x ^ 2 / (x - y) - x y / (x - y)]Together threads over lists:
Together[{(1/x) + (1/x + 1), (1/x + 2) + (1/x + 3)}]Together threads over equations and inequalities:
Together[1 < 1 / x + 1 / (1 + x) < 2]Compute over the algebraic extension generated by the coefficients:
Together[x ^ 2 / (x - Sqrt[2]) - 2 / (x - Sqrt[2]), Extension -> Automatic]Compute over the integers modulo
:
Together[5x / (3x ^ 2 - y ^ 2) + 3y / (3x ^ 2 - y ^ 2), Modulus -> 3]ℱ = FiniteField[17, 3];Together[x(ℱ[1]x + ℱ[246]) / (ℱ[3]x ^ 2 + ℱ[1771]) + ℱ[4436] / (ℱ[3]x ^ 2 + ℱ[1771])]Together[Sin[x] ^ 2 / Cos[x] + Cos[x], Trig -> True]Options (7)
Extension (3)
By default, Together treats algebraic numbers as independent variables:
Together[(x ^ 2 - 2) / (Sqrt[2] + x)]Together[1 / (Sqrt[2] + x) + 1 / (x ^ 2 - 2)]With Extension->Automatic, Together recognizes algebraically dependent coefficients:
Together[(x ^ 2 - 2) / (Sqrt[2] + x), Extension -> Automatic]Together[1 / (Sqrt[2] + x) + 1 / (x ^ 2 - 2), Extension -> Automatic]Combine terms and cancel common factors over a finite field:
ℱ = FiniteField[2, 3];Together[x ^ 4 / (x + 1) + 1 / (x + 1), Extension -> ℱ]Modulus (2)
Computations over rational numbers:
Together[1 / x + 1 / (1 + x)]Together[(x - 1)(x - 2) / ((x - 3)(x - 4)(x - 5))]The same computations over integers modulo 2:
Together[1 / x + 1 / (1 + x), Modulus -> 2]Together[(x - 1)(x - 2) / ((x - 3)(x - 4)(x - 5)), Modulus -> 2]Applications (1)
Properties & Relations (3)
Apart acts as a partial inverse of Together:
Together[a / b + c / d]Apart[%]Together combines terms over a common denominator and cancels common factors:
r = (x - 1) / (x ^ 2 - 1) + (x - 2) / (x ^ 2 - 4);Together[r]Cancel only cancels common factors between numerators and denominators:
Cancel[r]Use Numerator and Denominator to extract numerators and denominators:
expr = Together[1 / x + 1 / y]Numerator[expr]Denominator[expr]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), Together, Wolfram Language function, https://reference.wolfram.com/language/ref/Together.html (updated 2023).
CMS
Wolfram Language. 1988. "Together." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/Together.html.
APA
Wolfram Language. (1988). Together. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Together.html
BibTeX
@misc{reference.wolfram_2026_together, author="Wolfram Research", title="{Together}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/Together.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_together, organization={Wolfram Research}, title={Together}, year={2023}, url={https://reference.wolfram.com/language/ref/Together.html}, note=[Accessed: 13-June-2026]}