Error, (in ...) cannot determine if this expression is true or false: ...
Description
Examples
Maple cannot determine whether something is true or false in an if statement or while clause.
A typical occurrence happens when a procedure that requires numeric arguments is called with symbolic arguments:
f:=proc(x)ifx<0thenx^3elsex^2endifendproc
f:=procxifx<0thenx^3elsex^2end ifend proc
plotfx,x= −1..1;
Error, (in f) cannot determine if this expression is true or false: x < 0
evalf⁡Int⁡(f⁡x,x=−1..1);
fsolve⁡f⁡x=−1,x;
Solution:
Maple evaluates the inputs to a procedure such as plot before it calls the procedure, resulting in f being called with the symbolic argument x. Since x has not yet been assigned a value, Maple cannot determine if x is less than 0. You can either delay the evaluation of the input using unevaluation quotes, or you can supply the arguments with operator form. For details, see uneval.
plot⁡'f'x,x= −1..1;
plotf,−1..1
fsolve'f'x=−1,x
−1.000000000
fsolve'f'x,x=−1..1
0.
evalf⁡Int⁡f,−1..1;
0.08333333333
evalfInt'f'x,x=−1..1;
See Also
fsolve
Numerical Integration
plot
uneval
Download Help Document
What kind of issue would you like to report? (Optional)