Table of Contents

Together


Description

Examples

Combine terms over a common denominator:

println Together >> 'f_m / a + g_m / b'.t
   > (b*f_m + a*g_m)/(a*b)


Together automatically takes care about dummy indices relabelling

println Together >> '(f_m*f^m) / (a_n*a^n) + (b_n*b^n) / (c_m*c^m)'.t
   > (f_m*f^m*c_a*c^a+a_a*a^a*b_n*b^n)/(a_c*a^c*c_b*c^b)


Together does not perform factorisation:

println Together >> 'x**2/(x**2 - 1) + x/(x**2 - 1)'.t
   > (x**2-1)**(-1)*(x**2+x)
Use Together & Factor:
println( (Together & Factor) >> 'x**2/(x**2 - 1) + x/(x**2 - 1)'.t )
   > (-1+x)**(-1)*x

See also