I have two complicated mathematical expressions. How can I compare them, to find if they express the same using Maxima?
Asked
Active
Viewed 4,650 times
1 Answers
12
is(equal(e1, e2))
. Note that "=" is identity (i.e. same expression), while "equal" is equivalence. E.g. is(equal(x*(x + 1), x^2 + x))
=> true
while is(x*(x + 1) = x^2 + x)
=> false
. Note also that is(equal(e1, e2))
actually computes ratsimp(e1 - e2)
and looks to see if the result is 0. Maxima cannot reduce all equivalent expressions to 0 so there are cases in which it will incorrectly return false
.

Robert Dodier
- 16,905
- 2
- 31
- 48