 Detailed Information - Maple Help

Home : Support : Online Help : Mathematics : Evaluation : assume : assuming : Detailed Information

assuming

compute the value of an expression under assumptions, or represent that computation using the inert form '%assuming' Calling Sequence expression assuming property expression assuming x1::property1, x2::property2, ... expression assuming additionally, x1::property1, x2::property2, ... expression %assuming ... Parameters

 expression - valid expression or Maple input to be evaluated property - name: property x1, x2, ... - names; names in or referenced by expression property1, property2, ... - names; property1 is the property assumed on x1, property2 is the property assumed on x2, ... additionally - (optional); computes placing the received assumptions on x1, x2, ... without discarding previous assumptions on these variables Basic Information

 • This help page contains complete information about the assuming command. For basic information on the assuming command, see the assuming help page. Description

 • The expression assuming property calling sequence evaluates the expression under the assumption property on all names in expression. This is similar to the assume=property option of the simplify command.
 • The expression %assuming property is the inert form of assuming and returns unevaluated, with the expression and the related assumptions encapsulated within the %assuming structure. This permits, for instance, to compute with different conditions on the same variable or expression, all appearing within the same worksheet, each of them represented by %assuming structures with different conditions. All of is, coulditbe, simplify, diff and int commands know about these %assuming structures, that can be activated when desired using the value command.
 • The expression assuming x1::property1, x2::property2, ... calling sequence evaluates the expression under the assumption(s) property1, property2, ... on the name(s) x1, x2, ..., respectively. By default, previously existing assumptions on x1, x2, and so forth, if any, are ignored when computing the result. To override this behavior use the optional argument 'additionally', which can be placed anywhere to the right of assuming - see the Examples section of this help page.
 • The output is the same as that received by successively doing the following (exceptions noted further below).
 1. Calling assume (to enter assumptions on names).
 2. Entering (and so evaluating under the assumptions) the expression depending on these names.
 3. Removing the assumptions.
 The use of the assuming routine simplifies the process to one step. Thus, it facilitates experiments concerning the value of the expression under different assumptions.
 • To perform computations under assumptions, the assuming routine identifies the names that are assumed to have special properties, then replaces them with equivalent names that have these properties. The evaluation uses these new names in the computation, then restores the original names before returning the output. This process ensures that no assumptions are made to the original names in the expression. Therefore, the computations performed using assuming do not affect computations performed before or after calling assuming.
 • assuming is a left-associative operator with precedence between ,  and :=.
 Notes: The assuming command does not place assumptions on constants like $\mathrm{\pi }$, nor on integration or summation dummy variables in definite integrals and sums, nor in limit or product dummy variables, because all these variables already have their domain restricted by the integration, summation or product range or by the method used to compute a limit. To obtain the simplification of the expression being summed, integrated or subject to a product taking into account the restriction on the values of the dummy variable implicit in the integration/summation/product range, use the simplify command -- see the Examples section of this help page.
 The assuming command does not scan Maple programs regarding the potential presence of assumed variables. To compute taking into account assumptions on variables found in the bodies of programs, use assume -- see the Examples section. Examples

 > $\mathrm{e1}≔\mathrm{ln}\left({ⅇ}^{-{k}_{1}t}\right)$
 ${\mathrm{e1}}{≔}{\mathrm{ln}}{}\left({{ⅇ}}^{{-}{{k}}_{{1}}{}{t}}\right)$ (1)
 > $\mathrm{e1}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{real}$
 ${-}{{k}}_{{1}}{}{t}$ (2)
 > $\mathrm{Matrix}\left(2,2,\left[\mathrm{e1},1,1,0\right]\right)$
 $\left[\begin{array}{cc}{\mathrm{ln}}{}\left({{ⅇ}}^{{-}{{k}}_{{1}}{}{t}}\right)& {1}\\ {1}& {0}\end{array}\right]$ (3)
 > $\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}t::\mathrm{negative},\left({k}_{1}\right)::\mathrm{positive}$
 $\left[\begin{array}{cc}{-}{{k}}_{{1}}{}{t}& {1}\\ {1}& {0}\end{array}\right]$ (4)
 > $\mathrm{e2}≔\mathrm{ln}\left(\frac{a}{x}\right)-\mathrm{ln}\left(a\right)+\mathrm{ln}\left(x\right)$
 ${\mathrm{e2}}{≔}{\mathrm{ln}}{}\left(\frac{{a}}{{x}}\right){-}{\mathrm{ln}}{}\left({a}\right){+}{\mathrm{ln}}{}\left({x}\right)$ (5)
 > $\mathrm{simplify}\left(\mathrm{e2}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}x::\mathrm{positive}$
 ${0}$ (6)
 > $\mathrm{simplify}\left(\mathrm{e2}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}a::\mathrm{positive}$
 ${\mathrm{ln}}{}\left(\frac{{1}}{{x}}\right){+}{\mathrm{ln}}{}\left({x}\right)$ (7)
 > $\mathrm{simplify}\left(\mathrm{subs}\left(x=-x,\mathrm{e2}\right)\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}x::\mathrm{posint},a::\mathrm{posint}$
 ${2}{}{I}{}{\mathrm{\pi }}$ (8)
 > $\mathrm{e3}≔\mathrm{sin}\left(\frac{{k}_{1}\mathrm{Pi}}{2}\right)$
 ${\mathrm{e3}}{≔}{\mathrm{sin}}{}\left(\frac{{{k}}_{{1}}{}{\mathrm{\pi }}}{{2}}\right)$ (9)
 > $\mathrm{e3}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\left({k}_{1}\right)::\mathrm{even}$
 ${0}$ (10)
 > $\mathrm{e3}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\left({k}_{1}\right)::\mathrm{odd}$
 ${\left({-1}\right)}^{\frac{{{k}}_{{1}}}{{2}}{-}\frac{{1}}{{2}}}$ (11)
 > $\mathrm{e4}≔\frac{{\left(\frac{a{x}^{\frac{1}{n}}\left(n+1\right)}{n}\right)}^{n}\left(n-1\right)k}{xn}$
 ${\mathrm{e4}}{≔}\frac{{\left(\frac{{a}{}{{x}}^{\frac{{1}}{{n}}}{}\left({n}{+}{1}\right)}{{n}}\right)}^{{n}}{}\left({n}{-}{1}\right){}{k}}{{x}{}{n}}$ (12)
 > $\mathrm{simplify}\left(\mathrm{e4}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}n::\mathrm{integer},0
 $\frac{{\left(\frac{{a}{}\left({n}{+}{1}\right)}{{n}}\right)}^{{n}}{}\left({n}{-}{1}\right){}{k}}{{n}}$ (13)

The simplify command can be called with assumptions.

 > $\mathrm{simplify}\left(\mathrm{e4},\mathrm{assume}=\left[n,\mathrm{integer},0
 $\frac{{\left(\frac{{a}{}\left({n}{+}{1}\right)}{{n}}\right)}^{{n}}{}\left({n}{-}{1}\right){}{k}}{{n}}$ (14)
 > $\mathrm{e5}≔{{∫}}_{0}^{\mathrm{∞}}{ⅇ}^{-ux}{x}^{\frac{1}{3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}x$
 ${\mathrm{e5}}{≔}{{\int }}_{{0}}^{{\mathrm{\infty }}}{{ⅇ}}^{{-}{u}{}{x}}{}{{x}}^{{1}}{{3}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (15)
 > $\mathrm{value}\left(\mathrm{e5}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}0\le u$
 $\frac{{2}{}{\mathrm{\pi }}{}\sqrt{{3}}}{{9}{}{\mathrm{\Gamma }}{}\left(\frac{{2}}{{3}}\right){}{{u}}^{{4}}{{3}}}}$ (16)
 > $\mathrm{value}\left(\mathrm{e5}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}u<0$
 ${\mathrm{\infty }}$ (17)

The following is an example of the optional argument 'additionally'.

 > $\mathrm{assume}\left(x<1\right)$
 > $\mathrm{about}\left(x\right)$
 Originally x, renamed x~:   is assumed to be: RealRange(-infinity,Open(1))

As default behavior, the existing assumption $x<1$ is disregarded when computing using assuming with assumptions on $x$.

 > $\mathrm{is}\left(1-{x}^{2},\mathrm{positive}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}-1
 ${\mathrm{false}}$ (18)

Using 'additionally', $-1 is taken into account in addition to the already existing assumption $x<1$, leading to:

 > $\mathrm{is}\left(1-{x}^{2},\mathrm{positive}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{additionally},-1
 ${\mathrm{true}}$ (19)

With or without the optional argument 'additionally', any assumptions previously existing on the variables are preserved.

 > $\mathrm{about}\left(x\right)$
 Originally x, renamed x~:   is assumed to be: RealRange(-infinity,Open(1))
 > $\mathrm{ode}≔\frac{ⅆ}{ⅆt}y\left(t\right)=\frac{2\cdot 1}{t}+2\left|t\right|\mathrm{abs}\left(1,t\right)$
 ${\mathrm{ode}}{≔}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({t}\right){=}\frac{{2}}{{t}}{+}{2}{}\left|{t}\right|{}{\mathrm{abs}}{}\left({1}{,}{t}\right)$ (20)

Without assumptions, the ODE above is solved in terms of a piecewise function. Assuming $t$ is positive:

 > $\mathrm{ode}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{positive}$
 $\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({t}\right){=}\frac{{2}}{{t}}{+}{2}{}{t}$ (21)

Assuming $t$ is positive, the ODE has the following solution.

 > $\mathrm{dsolve}\left(\mathrm{ode}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{positive}$
 ${y}{}\left({t}\right){=}{{t}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({t}\right){+}\mathrm{c__1}$ (22)

This solution can be tested (see odetest) under assumptions.

 > $\mathrm{odetest}\left(,\mathrm{ode}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{positive}$
 ${0}$ (23)
 > $\mathrm{x1}≔{x}^{2}$
 ${\mathrm{x1}}{≔}{{\mathrm{x~}}}^{{2}}$ (24)
 > $\left|\sqrt{\mathrm{x1}}\right|\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{positive}$
 ${\mathrm{x~}}$ (25)

Computing with quoted objects under assuming occurs normally. If quotation marks are placed around $x$, the information that $\mathrm{x1}={x}^{2}$ is ignored.

 > $\left|\sqrt{'\mathrm{x1}'}\right|\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{positive}$
 $\sqrt{{\mathrm{x1}}}$ (26)

The assuming command does not place assumptions on integration or summation variables in definite integrals and sums. So, in

 > $\mathrm{expression}≔{{∫}}_{1}^{4}{\left(1+{\mathrm{sinh}\left(t\right)}^{2}\right)}^{\frac{1}{2}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}t\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}t\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{RealRange}\left(1,4\right)$
 ${\mathrm{expression}}{≔}{{\int }}_{{1}}^{{4}}\sqrt{{1}{+}{{\mathrm{sinh}}{}\left({t}\right)}^{{2}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{t}$ (27)

no assumptions are placed on the dummy variable $t$.

 > $\mathrm{depends}\left(\mathrm{expression},t\right)$
 ${\mathrm{false}}$ (28)

To obtain the simplification of the integrand taking into account that $t\in \left[1,4\right]$ use simplify.

 > $\mathrm{simplify}\left(\mathrm{expression}\right)$
 ${{\int }}_{{1}}^{{4}}{\mathrm{cosh}}{}\left({t}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{t}$ (29)

You can call assuming with assuming as argument (nested computation under different assumptions). In doing so, note assuming is left-associative, so for instance in

 > $\mathrm{simplify}\left(\sqrt{{r}^{2}{s}^{2}{t}^{2}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{real}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}0
 ${r}{}{s}{}\left|{t}\right|$ (30)

first simplify(sqrt(r^2*s^2*t^2)) assuming real is computed then the result evaluated assuming $0.

It is sometimes useful to place an assumption on a variable or expression, encapsulated, independent of the rest of the computations on the worksheet. One example of that is when the value of expressions depend on where are some variables being evaluated. For this purpose you can use the inert form %assuming. For example,

 > $\mathrm{%assuming}\left(\left[\sqrt{{a}^{2}}\right],\left[0
 ${\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{%assuming}}{}\left(\left[{\mathrm{sqrt}}{}\left({{a}}^{{2}}\right)\right]{,}\left[{0}{<}{a}\right]\right)\right]\right)$ (31)
 > $\mathrm{value}\left(\right)$
 ${a}$ (32)

When using %assuming attention should be given to the order of precedence of operations: assuming and %assuming have higher precedence than the arithmetic operators.

 > $\mathrm{%assuming}\left(\left[\sqrt{{a}^{2}}\right],\left[0
 $\left({\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{%assuming}}{}\left(\left[{\mathrm{sqrt}}{}\left({{a}}^{{2}}\right)\right]{,}\left[{0}{<}{a}\right]\right)\right]\right)\right){+}\left({\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{%assuming}}{}\left(\left[{\mathrm{sqrt}}{}\left({{a}}^{{2}}\right)\right]{,}\left[{a}{<}{0}\right]\right)\right]\right)\right)$ (33)
 > $\mathrm{value}\left(\right)$
 ${0}$ (34)

The assuming command does not scan programs regarding the presence of assumed variables; for that purpose use assume. Consider

 > $f≔x→\sqrt{{a}^{2}}+x$
 ${f}{≔}{x}{↦}\sqrt{{{a}}^{{2}}}{+}{x}$ (35)

The variable a is inside the body of f; the assumption that $0 is not effectively used when computing $f\left(1\right)$.

 > $f\left(1\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}0
 $\sqrt{{{a}}^{{2}}}{+}{1}$ (36)

For these purposes, you can use the Physics:-Setup command with its assuminguseseAssume keyword, or use assume itself. For example

 > $\mathrm{Physics}:-\mathrm{Setup}\left(\mathrm{assumingusesAssume}=\mathrm{true}\right)$
 $\left[{\mathrm{assumingusesAssume}}{=}{\mathrm{true}}\right]$ (37)
 > $f\left(1\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}0
 ${a}{+}{1}$ (38)

Alternatively,

 > $\mathrm{Physics}:-\mathrm{Setup}\left(\mathrm{assumingusesAssume}=\mathrm{false}\right)$
 $\left[{\mathrm{assumingusesAssume}}{=}{\mathrm{false}}\right]$ (39)
 > $f\left(1\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}0
 $\sqrt{{{a}}^{{2}}}{+}{1}$ (40)
 > $\mathrm{assume}\left(0
 > $f\left(1\right)$
 ${\mathrm{a~}}{+}{1}$ (41) Compatibility

 • The assuming command was updated in Maple 2017.