assuming
compute the value of an expression under assumptions, or represent that computation using the inert form '%assuming'
Calling Sequence
Parameters
Description
Examples
Details
Compatibility
expression assuming property
expression %assuming property
expression
-
expression or input to be evaluated
property
name; property
The expression assuming property calling sequence evaluates the expression under the assumption property on all names in expression.
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 property parameter can be a type, inequation, or other property to be assumed on a name or expression involving names.
Note: Computations performed using assuming do not affect computations performed before or after calling assuming.
An assuming clause can be included in the condition of an if, elif, while, or until clause. In the latter case, to avoid a syntactic ambiguity, the entire condition, including the assuming clause, must be enclosed in parentheses.
Find the square root of a2 under the assumption that a is a positive, real constant.
sqrt⁡a2assuming0<a
a
sqrt⁡a2
a2
You can determine the value of an expression under the assumption that all its variables are real.
e1≔ln⁡exp⁡−k1⁢t
e1≔ln⁡ⅇ−k1⁢t
e1assumingreal
−k1⁢t
Using the assuming command does not update e1.
e1
ln⁡ⅇ−k1⁢t
The assumptions are valid only during the computation of one input statement, and no assumptions are placed on the variables.
e2≔ln⁡yx−ln⁡y+ln⁡x
simplify⁡e2assumingx::positive
0
simplify⁡e2assumingy::positive
ln⁡1x+ln⁡x
simplify⁡subs⁡x=−x,e2assumingx::posint,y::posint
2⁢I⁢π
about⁡x:
x: nothing known about this object
about⁡y
y: nothing known about this object
Using the value command, you can evaluate an inert integral. This evaluation can be performed under assumptions.
e3≔Int⁡exp⁡−u⁢x⁢x13,x=0..∞
e3≔∫0∞ⅇ−u⁢x⁢x13ⅆx
value⁡e3assuming0≤u
2⁢π⁢39⁢Γ⁡23⁢u43
value⁡e3assumingu<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,
%assuming⁡sqrt⁡`^`⁡a,2,`<`⁡0,a
a2assuming0<a
value⁡
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 variable a is inside the body of f; the assumption that a > 0 is not effectively used when computing f(1).
f≔x↦sqrt⁡a2+x
f≔x↦a2+x
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
For detailed information including:
How to evaluate expressions under assumptions applied to specific variables
Detailed information on how the assuming command computes under assumptions
How to use the assuming command in conjunction with the assume command
see the assuming/details help page.
The assuming command was updated in Maple 2017.
See Also
assume
Physics[Assume]
Physics[Setup]
type
value
Download Help Document