depends - Maple Programming Help

Home : Support : Online Help : Programming : Logic : Boolean : depends

depends

check for mathematical dependence

 Calling Sequence depends(f, x)

Parameters

 f - expression, or list or set of expressions x - name, or list or set of names

Description

 • The function depends returns true if any of the expressions contained in f are mathematically dependent on any of the names contained in x.
 • The expression f is mathematically dependent on the name x if it contains at least one instance of x which is not simply a dummy variable.  Examples of dummy variables are index variables in sums, products, integrals, and limits.  Dummy variables also appear in integral transforms.
 • If f is a complicated expression, then depends may not be able to determine that it is independent of x.  In such cases, f should simplified before depends is called.
 • There is a facility for the user to add additional functions to depends. If the function depends/myfunc is defined, then depends will use this function to check for dependence whenever it encounters myfunc.  The function depends/myfunc should accept as its parameters the arguments that myfunc expects in the same order, followed by a final parameter which will be a set containing all the names that dependence is being checked against.  Note that myfunc may be either a user-defined function or a standard library function.
 • Unrelated to the above, there is also a procedure parameter modifier, depends, that can be used in declaration to indicate that a parameter's type depends on the value of another parameter.

Examples

 > $\mathrm{depends}\left(\mathrm{sin}\left(x\right)+\mathrm{cos}\left(z\right),\left\{x,y\right\}\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{depends}\left(\mathrm{sin}\left(x\right)+\mathrm{cos}\left(z\right),\left[x,z\right]\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{depends}\left(\mathrm{sin}\left(x\right)+\mathrm{cos}\left(z\right),\left[y,z\right]\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{depends}\left({∫}_{a}^{b}f\left(x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx,x\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{depends}\left({∫}_{a}^{b}f\left(x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx,a\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{depends}\left(\underset{x→0}{lim}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\frac{1}{x},x\right)$
 ${\mathrm{false}}$ (6)
 > $\mathrm{depends}\left(\sum _{x=1}^{n}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}\frac{1}{x},x\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{depends}\left(\sum _{x=1}^{n}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}\frac{1}{x},n\right)$
 ${\mathrm{true}}$ (8)
 > $\mathrm{depends}\left(\mathrm{laplace}\left(f\left(t\right),t,s\right),t\right)$
 ${\mathrm{false}}$ (9)

In some cases f must be simplified before depends is called to get the correct answer.

 > $\mathrm{depends}\left({\mathrm{sin}\left(x\right)}^{2}+{\mathrm{cos}\left(x\right)}^{2},x\right)$
 ${\mathrm{true}}$ (10)
 > $\mathrm{depends}\left(\mathrm{simplify}\left({\mathrm{sin}\left(x\right)}^{2}+{\mathrm{cos}\left(x\right)}^{2},\mathrm{trig}\right),x\right)$
 ${\mathrm{false}}$ (11)