# HP Forums

Full Version: [CAS] Potential Bug with given (|). [SOLVED]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good evening/morning to the good folk at HP,
For some maths questions, I have to restrict the domain. So I use the given symbol (|) in CAS. I would have something like:
solve(x^2-8=0,x)|(x>0)
That works perfectly.

But when I add another condition like so:
solve(x^2-8=0,x)|((x>0) AND (x<10))
The calculator creates a CAS variable called x, in the form of a matrix. And from this point on, the variable x will always have the "temporary" domain imposed onto it.
solve(x^2-8=0,x) will start to return 2*root(2) only.
solve(x+3=0,x) will give [].
and so on.

Unless this is an actual feature, can you guys fix this bug ASAP. Because I can already imagine how dangerous this would be for examinations...
This would appear to be by design. The CAS system is converting the compound given statement into the following explicit assumptions:

assume(x>0) -> x

This creates the following permanent assumptions on x:

Which provides the correct solution:

solve((x^2-8) = 0,x) -> {2*√2}

To avoid future use of the assumptions on x, they must be purged:

purge(x) -> assume[[],[line[0,10]],[0,10]]

Mark Hardman
(10-30-2016 05:03 PM)Mark Hardman Wrote: [ -> ]This would appear to be by design. The CAS system is converting the compound given statement into the following explicit assumptions:

assume(x>0) -> x

This creates the following permanent assumptions on x:

Which provides the correct solution:

solve((x^2-8) = 0,x) -> {2*√2}

To avoid future use of the assumptions on x, they must be purged:

purge(x) -> assume[[],[line[0,10]],[0,10]]

Mark Hardman

If this is intentional I think it is a bad idea. I think of the "|" operator as making a temporary assignment to a variable or applying a temporary restriction and I suspect that most people would feel this way too.

TI CAS calculators have got a menu function that clears single-character variable names (a-z). It would be a good idea to advise users to implement their own such function on the Prime, and to use it regularly! Thanks to CH3791 for pointing out this potential pitfall.

Nigel (UK)
Well spotted, I'm fixing that in giac source.
Wow... guys... Seeing this genuinely put a smile onto my face. Time and time again, you have read over my queries (no matter how stupid they may be), and within a day have come up with an awesome response! For me as a highschool student, it was quite a gamble to move from the Casio Classpad to this mysterious, high-powered machine, but so far everything has played out flawlessly.

Part of that of course, is due to the hospitality of this community and I can't thank you guys enough for that.
Alphabetic variables capitalized does not work.

solve(X^2-8 = 0,X) | X>0 AND X<10; [enter] {-2*√(2),2*√(2)}