Maple says that e^(a*ln(b)) is not the same as b^a
but when I replace a by (1/3) it says yes.
is this a bug?
>restart;
> is(exp( a*ln(b)) = b^a);
false
>is(exp((1/3)*ln(b)) = b^(1/3));
true
tried to tell it to assume a>0, but this did not help:
>assume(a>0);
>is(exp( a*ln(b)) = b^a);
false
>testeq((exp(a*ln(b))=(b^a)));
true
nma...@hotmail.com (steve_H) wrote in message news:<8db3d6c8.04010...@posting.google.com>...
Perhaps this could be false when b=0?
> exp( a*ln(b)) = b^a;
a
exp(a ln(b)) = b
> subs(b=0,%);
exp(a ln(0)) = 0
> simplify(%);
Error, (in ln) numeric exception: division by zero
in Maple 7:
> is(exp( a*ln(b)) = b^a);
FAIL
> is(simplify(exp( a*ln(b)) = b^a));
true
But testeq is not at all reliable with symbolic exponents.
See for example my article of 12 December 2002 on the subject
"Re: why does testeq( x = (x^3)^(1/3) ) FAIL ?"
Robert Israel isr...@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
> eval(subs({a=1,b=1},(exp(a*ln(b))=b^a)));
1 = 1
Of course it's not a proof, but it's a logical starting place.
isr...@math.ubc.ca (Robert Israel) wrote in message news:<bt8177$k6r$1...@nntp.itservices.ubc.ca>...
IMO, the best, most general, way to verify identities in Maple is to
simplify their difference to 0.
> simplify(exp(a*ln(b)) - b^a);
0
This is not meant to excuse the bug in `is`, but rather my intention
is just to show you the better way. I have reported this bug in `is`
long ago in this context: In any case where simplify(a - b) returns 0,
is(a=b) should return true.
That could not consistently be the basis for Maple's objection because
of the following example:
> ls:= (a^2-2*a*b+b^2)/(a-b);
(a^2-2*a*b+b^2)/(a-b)
Note that there is no automatic simplification.
> rs:= a-b:
> is(ls=rs);
true
That is, `is` will verify an identity even though there may some
values of the variables that cause invalid operations on only one side
of the identity. IMO, this is an okay way to handle this.
I suppose that your attitude in this regard may be commonplace.
Nonetheless, I do not understand why some people consider it acceptable
to say ls=rs is true when, for some values of the variable, one side is
defined while the other side is not. Of course, in the example you gave,
the only question occurs when a = b. But using the same principle (or so
it seems to me), we would be placed in the awkward position of saying that
it's acceptable to say, for example, that
0/(1 - sin^2(x) - cos^2(x)) = 5
is true. [I don't have access to Maple, but I'm assuming that it considers
the left side (i.e., 0/0) to be undefined.]
David Cantrell
I do not quite agree with your example since i am
used write for example x^2/x = x (i e lifting a
singularity which is not the case with yours).
I do not quite agree with your example since i am
Well, I was trying to give a provocative example...
> since i am
> used write for example x^2/x = x (i e lifting a
> singularity which is not the case with yours).
That's understandable, and perhaps it's actually what Carl had in mind:
Suppose, for example, that f(x) is undefined at certain points at which
it has removable singularities. Let g(x) be the same function except that
it has those singularities removed. Then it's acceptable to say that
f(x) = g(x) is true.
I don't like doing that. But, as I said, it's understandable, perhaps
especially for the purposes of computer algebra systems.
David Cantrell
In fact, x^2/x = x , (x^2-y^2)/(x-y) = x + y, etc. are correct in the field
Q(x,y) of rational functions in the indeterminates x and y over Q. It is
only if you think of these expressions as functions do you have any
problems. But then, Maple does distinguish between functions (procedures in
Maplese) and expressions.
--Edwin
You mean that you "do not understand why" it is acceptable to say that
x^2/x = x? We are simplifying expressions here, not numbers.
> Of course, in the example you gave,
> the only question occurs when a = b. But using the same principle (or so
> it seems to me),
I said "even though there MAY BE some values". I did not say that it
would do it in all cases. It is reasonable to say x^2/x - x = 0. It
is not reasonable to say 0/(1-sin(x)^2-cos(x)^2) - 5 = 0. To be
reasonable, the set of values where the expression is undefined must
be a "small". How small? I guess measure 0. I am being
intentionally vague by not specifying a measure.
I would be happy with continuity. As Edwin Clark pointed out
one can read that identity in the field of rational functions
which is to work with equivalence classes. Writing x^2/x - x
= 0 is just to write the equivalence realtion.
Now Maple (and perhaps other CAS) does not automatically see
a defined mapping IR -> IR through an expression (remember the
problems of students to understand that a polynom is _not the
same_ as a polynomial mapping).
Now take a rational function and any representation f(x)/g(x)
of its equivalance class (for example either x or x^2/x).
After that one can define a map IR -> IR up to isolated pts
for which numerical identies make sense.
For the larger field of elementary functions there is a bridge
to the original question: what is the limit of x^y if both
run to 0? Which is to ask for continuity. Even for the case
of taking the function x^(1/2) one has to make a choise to
give a map.
If 'is' and 'simplify' differ in that sense in does make
sense. But i find it somewhat unclear for handling a system
and a user may see it this way only in rare occasions -
whether s/he uses Maple or another CAS.