Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

why does testeq( x = (x^3)^(1/3) ) FAIL ?

15 views
Skip to first unread message

Chris W.

unread,
Dec 2, 2002, 5:21:19 AM12/2/02
to
I am a fairly new maple user, and have been having a problem solving a
not-too-complicated system of equations (maple doesn't give any solution even
though I know one exists). This also introduces problems when trying to plot
the function.

I *think* the problem is that maple isn't happy with things of the form
simplify((x^3)^(1/3));
and so
testeq( x = (x^3)^(1/3) );
FAILs.

Because the functions I have are the results of several steps of algebra and
then using subs, I'd rather not retype them for each case.

Is there a way to help maple recognise that x = (x^3)^(1/3) ? (where x may be
a long expression)

Many thanks, Chris.

Colin Andrew Percival

unread,
Dec 2, 2002, 6:41:31 AM12/2/02
to
Chris W. <chris....@lshtm.ac.uk> wrote:
> Is there a way to help maple recognise that x = (x^3)^(1/3) ? (where x may be
> a long expression)

Explicitly assume that x is real. The simplification isn't valid
otherwise.

Colin Percival

Chris W.

unread,
Dec 2, 2002, 7:18:41 AM12/2/02
to

I get the same problem, no?

> assume(x,real);
> is(x::real);
true


> testeq( x = (x^3)^(1/3) );
FAIL

Possibly I'm being stupid here and need to specify that x is real another way?

C.

Colin Andrew Percival

unread,
Dec 2, 2002, 7:28:04 AM12/2/02
to
Chris W. <chris....@lshtm.ac.uk> wrote:
> Colin Andrew Percival <cper...@sfu.ca> writes:
>> Explicitly assume that x is real. The simplification isn't valid
>> otherwise.

> I get the same problem, no?

Oops. Assume that x is positive. The branch which Maple chooses doesn't
work for negative x.

Colin Percival

Chris W.

unread,
Dec 2, 2002, 10:55:26 AM12/2/02
to
Colin Andrew Percival <cper...@sfu.ca> writes:

> Chris W. <chris....@lshtm.ac.uk> wrote:
> > Colin Andrew Percival <cper...@sfu.ca> writes:
> >> Explicitly assume that x is real. The simplification isn't valid
> >> otherwise.
>
> > I get the same problem, no?
>
> Oops. Assume that x is positive. The branch which Maple chooses doesn't
> work for negative x.

still the same...

> assume(x,real, x>0);
> is(x::real);
true
> is(x>0);


true
> testeq( x = (x^3)^(1/3) );
FAIL

but the above property should hold for x<0 also, no?

Thanks for continuing help, C. (PS, using Maple 8, if that's important)

Colin Andrew Percival

unread,
Dec 2, 2002, 11:20:22 AM12/2/02
to
Chris W. <chris....@lshtm.ac.uk> wrote:
> Colin Andrew Percival <cper...@sfu.ca> writes:
>> Oops. Assume that x is positive. The branch which Maple chooses doesn't
>> work for negative x.
>
> still the same...
>> assume(x,real, x>0);
>> testeq( x = (x^3)^(1/3) );
> FAIL

Works for me:
> assume(x,real,x>0);
> testeq(x=(x^3)^(1/3));
true

But I'm using Maple V Release 4. Evidently someone broke this between
versions.

> but the above property should hold for x<0 also, no?

In Maple V r4:
> assume(x,real,x<0);
> simplify((x^3)^(1/3));
1/2
- 1/2 x~ (1 + I 3 )

Colin Percival

Carl Devore

unread,
Dec 2, 2002, 12:28:31 PM12/2/02
to Chris W.

On 2 Dec 2002, Chris W. wrote:
> still the same...
>
> > assume(x,real, x>0);
> > is(x::real);
> true
> > is(x>0);
> true
> > testeq( x = (x^3)^(1/3) );
> FAIL
>
> but the above property should hold for x<0 also, no?
> Thanks for continuing help, C. (PS, using Maple 8, if that's important)

FAIL does not mean false. It just means that testeq gave up. If you look
at lines 44-46 of testeq, you'll see that it gives up immediately for
expressions with fractional exponents. testeq is a nondeterministic test
performed by evaluating the expression for some large values of the
variables over a finite field. I don't think that it makes any use of
assumptions.

I think the easiest way to show that two expressions are equal is to
simplify their difference and see if you get zero.

> assume(x>0);
> simplify(x - (x^3)^(1/3));
0

Chris W.

unread,
Dec 2, 2002, 2:02:51 PM12/2/02
to
Carl Devore <dev...@math.udel.edu> writes:

> On 2 Dec 2002, Chris W. wrote:
> > still the same...
> >
> > > assume(x,real, x>0);
> > > is(x::real);
> > true
> > > is(x>0);
> > true
> > > testeq( x = (x^3)^(1/3) );
> > FAIL
> >
>

> FAIL does not mean false. It just means that testeq gave up. If you look
> at lines 44-46 of testeq, you'll see that it gives up immediately for
> expressions with fractional exponents. testeq is a nondeterministic test
> performed by evaluating the expression for some large values of the
> variables over a finite field. I don't think that it makes any use of
> assumptions.
>
> I think the easiest way to show that two expressions are equal is to
> simplify their difference and see if you get zero.
>
> > assume(x>0);
> > simplify(x - (x^3)^(1/3));
> 0

I knew FAIL meant fail not false, I was using testeq to show that maple 8
wouldn't simplify (x^3)^(1/3). But it does, with
simplify((x^3)^(1/3), symbolic);
as pointed out to me by email. Which solves my problems.

Many thanks to all who took time to answer.

C.

Chris W.

unread,
Dec 2, 2002, 2:06:41 PM12/2/02
to
Colin Andrew Percival <cper...@sfu.ca> writes:

> Chris W. <chris....@lshtm.ac.uk> wrote:
> > but the above property should hold for x<0 also, no?
>
> In Maple V r4:
> > assume(x,real,x<0);
> > simplify((x^3)^(1/3));
> 1/2
> - 1/2 x~ (1 + I 3 )

surely simplify((x^3)^(1/3)) should give x _and_ both roots with imaginary
parts or give none? Maybe this is why the 'fix' (that simplify((x^3)^(1/3))
doesn't) was introduced between our differing versions.

My original problem is now fixed (see other reply). Thanks for taking the time
to reply, C.

Robert Israel

unread,
Dec 2, 2002, 2:06:57 PM12/2/02
to
In article <Pine.GSO.4.33.02120...@naxos.math.udel.edu>,
Carl Devore <dev...@math.udel.edu> wrote:

|>FAIL does not mean false. It just means that testeq gave up. If you look
|>at lines 44-46 of testeq, you'll see that it gives up immediately for
|>expressions with fractional exponents. testeq is a nondeterministic test
|>performed by evaluating the expression for some large values of the
|>variables over a finite field. I don't think that it makes any use of
|>assumptions.

It certainly can't use assumptions such as positivity, because it's not
working in an ordered field.

In general, I'd be very cautious about using testeq. In some
circumstances it is prone to producing false positive results. For
example, in anything involving a symbolic exponent:

> for i from 1 to 15 do testeq(a^n[i] = (-a)^(n[i])) od;

About half the results will be true, the others false.
What happens basically is that testeq ends up testing
(A^N - (-A)^N) mod p, where A and N are "random"
integers mod p and p-1 respectively, and p is the
prime 979073763359. Of course, the result will be 0
(and testeq will return true) if and only if N is even.
And this will happen with probability 1/2.

Robert Israel isr...@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2

Carl Devore

unread,
Dec 2, 2002, 4:04:17 PM12/2/02
to Chris W.

simplify(..., symbolic) is a dangerous last-ditch effort at
simplification, just like testeq is a last-ditch effort at equality
testing. It may perform invalid simplifications. The following works in
this case, and is safe:

simplify((x^3)^(1/3)) assuming x>0;

C W

unread,
Dec 1, 2002, 6:51:14 PM12/1/02
to
Try example below :

assign('n'=3),(allvalues@readlib(`convert/RootOf`))(x =
(x^n)^(1/n)),assign('n'='n');


Chris

0 new messages