assuming
compute the value of an expression under assumptions, or represent that computation using the inert form '%assuming'
Calling Sequence
Parameters
Basic Information
Description
Examples
Compatibility
expression assuming property
expression assuming x1::property1, x2::property2, ...
expression assuming additionally, x1::property1, x2::property2, ...
expression %assuming ...
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
This help page contains complete information about the assuming command. For basic information on the assuming command, see the assuming help page.
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 π, 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.
e1≔ln⁡exp⁡−k1⁢t
e1≔ln⁡ⅇ−k1⁢t
e1assumingreal
−k1⁢t
Matrix⁡2,2,e1,1,1,0
ln⁡ⅇ−k1⁢t110
assumingt::negative,k1::positive
−k1⁢t110
e2≔ln⁡ax−ln⁡a+ln⁡x
simplify⁡e2assumingx::positive
0
simplify⁡e2assuminga::positive
ln⁡1x+ln⁡x
simplify⁡subs⁡x=−x,e2assumingx::posint,a::posint
2⁢I⁢π
e3≔sin⁡k1⁢π2
e3assumingk1::even
e3assumingk1::odd
−1k12−12
e4≔a⁢x1n⁢n+1nn⁢n−1⁢kx⁢n
simplify⁡e4assumingn::integer,0<x
a⁢n+1nn⁢n−1⁢kn
The simplify command can be called with assumptions.
simplify⁡e4,assume=n,integer,0<x
e5≔Int⁡exp⁡−u⁢x⁢x13,x=0..∞
e5≔∫0∞ⅇ−u⁢x⁢x13ⅆx
value⁡e5assuming0≤u
2⁢π⁢39⁢Γ⁡23⁢u43
value⁡e5assumingu<0
∞
The following is an example of the optional argument 'additionally'.
assume⁡x<1
about⁡x
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.
is⁡1−x2,positiveassuming−1<x
false
Using 'additionally', −1<x is taken into account in addition to the already existing assumption x<1, leading to:
is⁡1−x2,positiveassumingadditionally,−1<x
true
With or without the optional argument 'additionally', any assumptions previously existing on the variables are preserved.
ode≔diff⁡y⁡t,t=2⋅1t+2⁢abs⁡t⁢abs⁡1,t
ode≔ⅆⅆty⁡t=2t+2⁢t⁢abs⁡1,t
Without assumptions, the ODE above is solved in terms of a piecewise function. Assuming t is positive:
odeassumingpositive
ⅆⅆty⁡t=2t+2⁢t
Assuming t is positive, the ODE has the following solution.
dsolve⁡odeassumingpositive
y⁡t=t2+2⁢ln⁡t+c__1
This solution can be tested (see odetest) under assumptions.
odetest⁡,odeassumingpositive
x1≔x2
x1≔x~2
abs⁡sqrt⁡x1assumingpositive
x~
Computing with quoted objects under assuming occurs normally. If quotation marks are placed around x, the information that x1=x2 is ignored.
x1
The assuming command does not place assumptions on integration or summation variables in definite integrals and sums. So, in
expression≔Int⁡1+sinh⁡t212,t=1..4assumingtinRealRange⁡1,4
expression≔∫141+sinh⁡t2ⅆt
no assumptions are placed on the dummy variable t.
depends⁡expression,t
To obtain the simplification of the integrand taking into account that t∈1,4 use simplify.
simplify⁡expression
∫14cosh⁡tⅆt
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
simplify⁡sqrt⁡r2⁢s2⁢t2assumingrealassuming0<r,0<s
r⁢s⁢t
first simplify(sqrt(r^2*s^2*t^2)) assuming real is computed then the result evaluated assuming 0<r,0<s.
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,
%assuming⁡sqrt⁡`^`⁡a,2,`<`⁡0,a
a2assuming0<a
value⁡
a
When using %assuming attention should be given to the order of precedence of operations: assuming and %assuming have higher precedence than the arithmetic operators.
%assuming⁡sqrt⁡`^`⁡a,2,`<`⁡0,a+%assuming⁡sqrt⁡`^`⁡a,2,`<`⁡a,0
a2assuming0<a+a2assuminga<0
The assuming command does not scan programs regarding the presence of assumed variables; for that purpose use assume. Consider
f≔x↦sqrt⁡a2+x
f≔x↦a2+x
The variable a is inside the body of f; the assumption that 0<a is not effectively used when computing f⁡1.
f⁡1assuming0<a
a2+1
For these purposes, you can use the Physics:-Setup command with its assuminguseseAssume keyword, or use assume itself. For example
Physics:-Setup⁡assumingusesAssume=true
assumingusesAssume=true
a+1
Alternatively,
Physics:-Setup⁡assumingusesAssume=false
assumingusesAssume=false
assume⁡0<a
f⁡1
a~+1
The assuming command was updated in Maple 2017.
See Also
about
abs
assume
diff
dsolve
Int
irem
limit
ln
Maple initialization file
odetest
operators/precedence
Physics[Assume]
Physics[Setup]
proc
simplify
sin
sqrt
type
value
Download Help Document