I use Maple to simplify messy algebraic expressions. My problem is that sometimes Maple does not do it and I do not know why.
For example, I know that a given expression is identically zero (checked it by hand several times) and it only contains elementary functions so there is no fancy mathematics.
I type the expression in, apply "simplify", Maple does transform it somewhat but it is still far from zero.
Then I transform a small part of the expression, doing the job for Maple, it goes "Aha!" and finally simplifies to zero.
So for some reason Maple sometimes just does not transform certain very simple expressions. Any idea why does it not?
Here is the example. Expressions L and R call function Q several times. L-R should simplify to zero.
restart;
Q := proc (x1, x2) options operator, arrow; -ln(exp(x1)+exp(x2))-ln(exp(-x1)+exp(-x2)) end proc;
Q := proc (x1, x2) options operator, arrow; -ln(2+exp(x1-x2)+exp(x2-x1)) end proc;
L := ln(exp(x1)+exp(ln(exp(x2)+exp(x3))+Q(x2, x3)))+Q(x1, ln(exp(x2)+exp(x3))+Q(x2, x3));
R := ln(exp(ln(exp(x1)+exp(x2))+Q(x1, x2))+exp(x3))+Q(ln(exp(x1)+exp(x2))+Q(x1, x2), x3);
simplify(L); simplify(R); simplify(L-R);
The first function Q and the second function Q are identical, the only difference is one line elementary transformation going from the first to the second.
If you use the first Q, and then execute the expressions L, R,..., simplify(L-R), that call function Q, you don't get answer 0.
If you use the second Q (after restart of course), the expression simplify(L-R) will become zero, as it should be, checked by manual calculations.
And now the other Q,
The third way above, using
subsindets, does not entail manually applyingexpto the expressionL-Rup front. The call tosubsindetsforces Maple to expand numerator and denominator within anylncall, as a distinct action.And, comparing just Q1 and Q2,
Of course, applying
exp, manipulating, and then applyingln, is a specific trick.