combine terms - Maple Help

# Online Help

###### All Products    Maple    MapleSim

combine

combine terms into a single term

 Calling Sequence combine(f) combine(f, n) combine(f, n, opt1, opt2, ...)

Parameters

 f - any expression, or set or list of expressions n - name or a list or set of names opt1, opt2, ... - (optional) names of options

Description

 • The combine function applies transformations which combine terms in sums, products, and powers into a single term. This function is applied recursively to the components of lists, sets, and relations; that is, f and n may be lists (or sets) of expressions and names, respectively.
 • For many functions, the transformations applied by combine are the inverse of the transformations that are applied by expand. For example, consider the well-known identity

$\mathrm{sin}\left(a+b\right)=\mathrm{sin}\left(a\right)\mathrm{cos}\left(b\right)+\mathrm{cos}\left(a\right)\mathrm{sin}\left(b\right)$

The combine function applies the identity from right to left, whereas the expand function does the reverse.

 • Subexpressions involving Int, Sum, and Limit are combined into one expression where possible using linearity; that is,  $\mathrm{c1}f\left(a,\mathrm{range}\right)+\mathrm{c2}f\left(b,\mathrm{range}\right)$ ==> $f\left(\mathrm{c1}a+\mathrm{c2}b,\mathrm{range}\right)$.
 • A specific set of transformations is obtained by specifying a second (optional) argument n (a name) which is one or a list of the following:

 For additional information and examples about the transformations applied by each of these, see combine[n] where n is an argument (a name) from the above list.
 • The symbolic option can be included to specify that formal symbolic manipulation of expressions is allowed without regard to the analytical issue of branches for multi-valued functions. For example, the expression sqrt(x)*sqrt(y) simplifies to sqrt(x*y) under the symbolic option. Without this option, the simplified result must take into account the different possible values of the (complex) sign of x and y.
 Note: When the symbolic option is specified, any branch of a multi-valued function can be chosen during the simplification process. The result of such an operation is in general not valid over the whole complex plane and can lead to incorrect results if you assume the expressions represent analytical functions.
 • The combine function maps over functions. Therefore combine(f(a)) is the same as map(combine,f(a)).

Examples

 > $\mathrm{combine}\left(\mathrm{Int}\left(x,x=a..b\right)-\mathrm{Int}\left({x}^{2},x=a..b\right)\right)$
 ${{\int }}_{{a}}^{{b}}\left({-}{{x}}^{{2}}{+}{x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (1)
 > $\mathrm{combine}\left(\left(\mathrm{Limit}\left(x,x=a\right)\right)\left(\mathrm{Limit}\left({x}^{2},x=a\right)\right)+c\right)$
 $\underset{{x}{\to }{a}}{{lim}}{}\left({{x}}^{{3}}{+}{c}\right)$ (2)

The use of the inert Limit function can lead to errors.

 > $\mathrm{combine}\left(\left(\mathrm{Limit}\left(\frac{1}{x},x=0\right)\right)\left(\mathrm{Limit}\left(x,x=0\right)\right)\right)$
 $\underset{{x}{\to }{0}}{{lim}}{}{1}$ (3)
 > $\mathrm{combine}\left(\left(\mathrm{limit}\left(\frac{1}{x},x=0\right)\right)\left(\mathrm{limit}\left(x,x=0\right)\right)\right)$
 ${\mathrm{undefined}}$ (4)
 > $\mathrm{combine}\left(\mathrm{abs}\left({x}^{2}\right)\mathrm{abs}\left(y+1\right),\mathrm{abs}\right)$
 ${\left|{x}\right|}^{{2}}{}\left|{y}{+}{1}\right|$ (5)
 > $\mathrm{f1}≔\mathrm{sqrt}\left(3\right)\mathrm{sqrt}\left(2\right)+\mathrm{sqrt}\left(y\right)\mathrm{sqrt}\left({x}^{2}-1\right)$
 ${\mathrm{f1}}{≔}\sqrt{{3}}{}\sqrt{{2}}{+}\sqrt{{y}}{}\sqrt{{{x}}^{{2}}{-}{1}}$ (6)
 > $\mathrm{combine}\left(\mathrm{f1},\mathrm{radical}\right)$
 $\sqrt{{6}}{+}\sqrt{{y}}{}\sqrt{{{x}}^{{2}}{-}{1}}$ (7)
 > $\mathrm{combine}\left(\mathrm{f1},\mathrm{radical},\mathrm{symbolic}\right)$
 $\sqrt{{6}}{+}\sqrt{{y}{}\left({{x}}^{{2}}{-}{1}\right)}$ (8)
 > $\mathrm{combine}\left(4{\mathrm{sin}\left(x\right)}^{3},\mathrm{trig}\right)$
 ${-}{\mathrm{sin}}{}\left({3}{}{x}\right){+}{3}{}{\mathrm{sin}}{}\left({x}\right)$ (9)
 > $\mathrm{combine}\left({\left(\mathrm{exp}\left(x\right)\right)}^{2}\mathrm{exp}\left(y\right),\mathrm{exp}\right)$
 ${{ⅇ}}^{{2}{}{x}{+}{y}}$ (10)
 > $\mathrm{combine}\left(\mathrm{exp}\left(\mathrm{sin}\left(a\right)\mathrm{cos}\left(b\right)\right)\mathrm{exp}\left(\mathrm{cos}\left(a\right)\mathrm{sin}\left(b\right)\right),\left[\mathrm{trig},\mathrm{exp}\right]\right)$
 ${{ⅇ}}^{{\mathrm{sin}}{}\left({a}{+}{b}\right)}$ (11)
 > $\mathrm{combine}\left(\left[2\mathrm{sin}\left(x\right)\mathrm{cos}\left(x\right),2{\mathrm{cos}\left(x\right)}^{2}-1\right],\mathrm{trig}\right)$
 $\left[{\mathrm{sin}}{}\left({2}{}{x}\right){,}{\mathrm{cos}}{}\left({2}{}{x}\right)\right]$ (12)
 > $\mathrm{assume}\left(0
 > $\mathrm{combine}\left(2\mathrm{ln}\left(y\right)-\mathrm{ln}\left(z\right),\mathrm{ln}\right)$
 ${\mathrm{ln}}{}\left(\frac{{{\mathrm{y~}}}^{{2}}}{{\mathrm{z~}}}\right)$ (13)
 > $\mathrm{combine}\left({\left({x}^{a}\right)}^{2},\mathrm{power}\right)$
 ${{x}}^{{2}{}{a}}$ (14)
 > $\mathrm{combine}\left(\mathrm{\Psi }\left(-x\right)+\mathrm{\Psi }\left(x\right),\mathrm{\Psi }\right)$
 ${2}{}{\mathrm{\Psi }}{}\left({x}\right){+}{\mathrm{\pi }}{}{\mathrm{cot}}{}\left({x}{}{\mathrm{\pi }}\right){+}\frac{{1}}{{x}}$ (15)

Compare the following examples. The extra arguments restrict the combining transformations.

 > $\mathrm{combine}\left(4{\mathrm{sin}\left(x\right)}^{3}+\mathrm{exp}\left(y\right)\mathrm{exp}\left(x\right)\right)$
 ${{ⅇ}}^{{\mathrm{y~}}{+}{x}}{-}{\mathrm{sin}}{}\left({3}{}{x}\right){+}{3}{}{\mathrm{sin}}{}\left({x}\right)$ (16)
 > $\mathrm{combine}\left(4{\mathrm{sin}\left(x\right)}^{3}+\mathrm{exp}\left(y\right)\mathrm{exp}\left(x\right),\mathrm{trig}\right)$
 ${{ⅇ}}^{{\mathrm{y~}}}{}{{ⅇ}}^{{x}}{-}{\mathrm{sin}}{}\left({3}{}{x}\right){+}{3}{}{\mathrm{sin}}{}\left({x}\right)$ (17)
 > $\mathrm{combine}\left(4{\mathrm{sin}\left(x\right)}^{3}+\mathrm{exp}\left(y\right)\mathrm{exp}\left(x\right),\mathrm{exp}\right)$
 ${4}{}{{\mathrm{sin}}{}\left({x}\right)}^{{3}}{+}{{ⅇ}}^{{\mathrm{y~}}{+}{x}}$ (18)

 See Also