MTM - Maple Programming Help

Home : Support : Online Help : Connectivity : MTM Package : MTM/compose

MTM

 compose
 compose functions

 Calling Sequence compose(f,g) compose(f,g,z) compose(f,g,x,z) compose(f,g,x,y,z)

Parameters

 f - expression g - expression z - symbol x - symbol y - symbol

Description

 • The function compose(f,g) interprets the expressions f and g as functions of s and t, respectively, and returns an expression that represents the function f(g(t)). Here, s and t are the default symbols of f (given by findsym(f,1)) and g (given by findsym(g,1)), respectively.
 • The function compose(f,g,z) treats f and g as functions of s and t, as described above, and returns an expression that represents the function f(g(z)).
 • The function compose(f,g,x,z) treats f as a function of x, g as a function of the default symbol, and returns an expression that represents the function f(g(z)).
 • The function compose(f,g,x,y,z) treats f as a function of x, g as a function of y, and returns an expression that represents the function f(g(z)).

Examples

 > $\mathrm{with}\left(\mathrm{MTM}\right):$
 > $f≔n-{n}^{2}-p$
 ${f}{:=}{-}{{n}}^{{2}}{+}{n}{-}{p}$ (1)
 > $g≔\mathrm{cos}\left(m\right)-{q}^{-\frac{1}{2}}$
 ${g}{:=}{\mathrm{cos}}{}\left({m}\right){-}\frac{{1}}{\sqrt{{q}}}$ (2)

For f(p) and g(q), compute f(g(q));

 > $\mathrm{compose}\left(f,g\right)$
 ${-}{{n}}^{{2}}{+}{n}{-}{\mathrm{cos}}{}\left({m}\right){+}\frac{{1}}{\sqrt{{q}}}$ (3)

For f(p) and g(q), compute f(g(r));

 > $\mathrm{compose}\left(f,g,r\right)$
 ${-}{{n}}^{{2}}{+}{n}{-}{\mathrm{cos}}{}\left({m}\right){+}\frac{{1}}{\sqrt{{r}}}$ (4)

For f(n) and g(q), compute f(g(r));

 > $\mathrm{compose}\left(f,g,n,r\right)$
 ${-}{\left({\mathrm{cos}}{}\left({m}\right){-}\frac{{1}}{\sqrt{{r}}}\right)}^{{2}}{+}{\mathrm{cos}}{}\left({m}\right){-}\frac{{1}}{\sqrt{{r}}}{-}{p}$ (5)

For f(n) and g(m), compute f(g(r));

 > $\mathrm{compose}\left(f,g,n,m,r\right)$
 ${-}{\left({\mathrm{cos}}{}\left({r}\right){-}\frac{{1}}{\sqrt{{q}}}\right)}^{{2}}{+}{\mathrm{cos}}{}\left({r}\right){-}\frac{{1}}{\sqrt{{q}}}{-}{p}$ (6)