HP Forums
[BUG] Comparison fails - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: [BUG] Comparison fails (/thread-728.html)

[BUG] Comparison fails - Stefan - 02-20-2014 10:56 PM

The following comparison fails (which is true when you do it by hand):
$$\frac{\partial \left( \frac{x^n}{n^3\cdot\left(1+x^n\right)}\right)}{\partial x} =\frac{x^{n-1}}{n^2\cdot(x^n)^2+2\cdot n^2\cdot x^n+n^2}== \frac{x^{n-1}}{n^2\cdot\left(1+x^n\right)^2}$$

(The term in the middle is what the differential is solved to by the Prime. It doesn't matter whether it is compared directly to the differential or to the solution).
It also doesn't matter whether you make the following assumptions about x and n:
n Integer and >0
x >0

RE: [BUG] Comparison fails - parisse - 02-21-2014 07:18 AM

It's not a bug. == checks if the expressions are the same, not if they are mathematically equivalent. To do that the easiest is to simplify the difference between both sides and check if it's 0 or not. The reason is that automatic simplification may fail and would cost time, it's better to leave the programmer/user simplify himself (here factor should work for example), and that's what all CAS do.

RE: [BUG] Comparison fails - Stefan - 02-21-2014 07:01 PM

Thanks for the advice.
I think it would be a good idea to include somewhere in the manual, that the Test Functions should not be used to compare expressions with each other (of course together with a hint how to do it properly)

And how much time are we talking about usually? Maybe the CAS could attempt a simplification and if doesn't suceed after say 50ms, go the "traditional" way. (on the other hand this would lead to the behaviour that sometimes the simplification (and hence the test) succeeds, and sometimes not. So maybe its better if it almost never works and one gets used to the not so intuitive but always working method mentioned by parisse).