Post Reply 
Result from solve() command shows c_0
03-24-2020, 12:04 PM
Post: #18
RE: Result from solve() command shows c_0
Thank you very much for the response. Yes I do agree that it is not a simple simplification. In fact, my concern was just the fact that the CAS did the complicated part of the job, but not the sign part that was a priori, for a human being, much simpler!

Now I understand that the algorithm is more complex than the "human" one. In fact the CAS does not realize directly that
x^2-6*x*sqrt(x-2)+9*x-18 = (x-3*sqrt(x-2))^2
so that the calculation of the square root is not so easy. It uses what it knows better: polynomial and rational functions. If it uses a polynomial representation, I can imagine that it defines a=sqrt(x-2) in order to get a simple polynomial:
x^2-6*x*sqrt(x-2)+9*x-18 = a^4-6*a^3+13*a^2-12*a+4
Then it uses its (powerful) root finder of polynomial functions to get
a^4-6*a^3+13*a^2-12*a+4 = (a-2)^2*(a-1)^2
Then it can take the square root to obtain
|(a-2)*(a-1)|
Then it can go back to x with a=sqrt(x-2)
|(sqrt(x-2)-2)*(sqrt(x-2)-1)|
Finally it can expand the product to obtain:
||x-2|-3*sqrt(x-2) +2|
Normally there is no sign problem in this path. I presume that the CAS does it in a similar way but the substitution is more complicated than a=sqrt(x-2) so that there is a choice of branch which can lead to a sign problem for some values of x.

I can imagine that the problem is the same for the solve command for these algebraic expressions. As long as the CAS chooses a branch, there is a loss of generality and potentially sign errors.

Maybe a warning message during the CAS calculation could be welcome. The trick of using "assume" to force the CAS to go to the relevant part in the x domain is very nice; it could also be a good idea to say something about it in the warning message.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Result from solve() command shows c_0 - jfdHP - 03-24-2020 12:04 PM



User(s) browsing this thread: 1 Guest(s)