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

  • Together[ expr ] puts terms in a sum over a common denominator, and cancels factors in the result.
  • Example: Together[1/x + 1/(1-x)].
  • 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[ expr , Modulus-> p ] generates a result modulo p.
  • 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.
  • See the Mathematica book: Section 1.4.5Section 3.3.3.
  • See also: Cancel, Collect, Factor, PolynomialGCD.

    Further Examples

    Here is a simple example.

    In[1]:=

    Out[1]=

    Here is another simple example.

    In[2]:=

    Out[2]=

    Together explicitly makes it clear that this expression is indeterminate.

    In[3]:=

    1
    Power::infy: Infinite expression - encountered.
    0

    Infinity::indet: Indeterminate expression 0 ComplexInfinity encountered.

    Out[3]=

    Together simplifies this nasty expression.

    In[4]:=

    Out[4]=

    No cancellation is done here.

    In[5]:=

    Out[5]=

    You can cancel out a common factor by setting Extension -> Automatic.

    In[6]:=

    Out[6]=

    Here are two modular examples.

    In[7]:=

    Out[7]=

    In[8]:=

    Out[8]=

    The setting Trig -> True here gives a better result.

    In[9]:=

    Out[9]=

    In[10]:=

    Out[10]=

    Here is a more dramatic difference.

    In[11]:=

    Out[11]=

    In[12]:=

    Out[12]=

    In[13]:=

    We want to show that this expression is zero, verifying an identity of Dedekind.

    In[14]:=

    We want to show that this expression is zero, verifying an identity of Dedekind.

    In[15]:=

    Out[15]=

    Seeing that the result is in terms of algebraic numbers leads us to set the Extension option to Automatic.

    In[16]:=

    Out[16]=

    In[17]:=