On 5/10/07, max.e.brown at gmail.com <max.e.brown at gmail.com> wrote:
>
> (%i2) is(1/(1-x) = -1/(x-1));
> (%o2) false
...
> I would expect is(1/(1-x) = -1/(x-1)) to evaluate to true. Am I
> missing something obvious here?
>
Maxima has two kinds of equality test, structural equality (represented by
a=b) and mathematical equality (represented by equal(a,b) ). Though it's
confusing to have both around, they are both useful. Of course, even
"equal" isn't perfect, but if it doesn't know, it gives an error (or returns
unknown if prederror = false). It should never give an *incorrect* result.
Examples:
is( x^2 -1 = (x-1)*(x+1) ) => false -- different
structures
is( equal( x^2 -1, (x-1)*(x+1) )) => true -- mathematically
equivalent
is(equal(sin(x)/cos(x),tan(x))) => Maxima was unable to evaluate the
predicate
is(equal(sqrt(2)+1,1/(sqrt(2)-1))) => true
is(equal(sqrt(x+1),sqrt(x^3+x^2)/x)) => unable to evaluate
Sometimes Maxima includes stronger methods for simplifying expressions than
it uses in testing is/equal. For example, trigsimp reduces
sin(x)/cos(x)-tan(x) to zero, and radcan does the same for the last example.
Sometimes these methods can be extremely expensive, so Maxima does not use
them automatically.
-s