axiom-math
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-math] Axiom's integration non-deterministic?


From: William Sit
Subject: Re: [Axiom-math] Axiom's integration non-deterministic?
Date: Sun, 26 Mar 2006 05:45:13 -0500


Igor Khavkine wrote:
> 
> Start up Axiom, and type in the following integral
> 
>   integrate(sqrt(1+x^(-2/3)),x)
> 
> Then type in the same integral again. Maybe try the same integral a
> few more times. Do you get the same answer each time?
> 
> I don't. I see the same behavior from axiom-20050901-4.1 (Debian sid)
> and axiom-20050201-1 (Debian sarge).
> 
> I get two possible answers, one is (x^(3/2)+1)*sqrt(x^(3/2)+1) and the
> other one is a much more complicated radical expression. Ironically,
> the longer expression takes less time to compute. Differentiating both
> answers gets me back to the original integrand. Also, their curves
> coincide when plotted. It seems that each time the answer is correct.
> However, the shorter one is obviously more attractive because it looks
> simpler.
> 
> Clearly, Axiom takes two different paths through the integration
> algorithm, even when give identical input. What is the cause of the
> branch? Is there a non-deterministic step somewhere in the algorithm?
> 
> Incidentally, is there a canonical form for radical expressions in
> which the two forms of the answer can be compared and directly shown
> to be the same?
> 
> Thanks in advance.
> 
> Igor

I vaguely remembered that Axiom does caching. So the first time the command
above is done, it gives an unsimplified answer and the second time it may be
doing the simplification using the previous answer. Simplifying radical
expresssion is expensive (I think it requires constructing towers of algebraic
extensions). The two answers are identical (on my Windows version)

                        AXIOM Computer Algebra System
              Version of Tuesday November 30, 2004 at 21:11:14
-----------------------------------------------------------------------------
   Issue )copyright to view copyright notices.
   Issue )summary for a summary of useful system commands.
   Issue )quit to leave AXIOM and return to shell.
-----------------------------------------------------------------------------

(1) -> a:=integrate(sqrt(1+x^(-2/3)),x)

                                +---------+
            3+-+2    3+-+       |3+-+2         3+-+2     3+-+     2
        (4x \|x   + 3\|x  + 7x)\|\|x   + 1  + 6\|x   + 9x\|x  + 4x  + 1
   (1)  ---------------------------------------------------------------
                                  +---------+
                       3+-+2      |3+-+2         3+-+
                     (4\|x   + 1)\|\|x   + 1  + 3\|x  + 4x
                                          Type: Union(Expression Integer,...)
(2) -> b:=integrate(sqrt(1+x^(-2/3)),x)

                    +---------+
         3+-+2      |3+-+2
   (2)  (\|x   + 1)\|\|x   + 1
                                          Type: Union(Expression Integer,...)
(3) -> c:=integrate(sqrt(1+x^(-2/3)),x)

                    +---------+
         3+-+2      |3+-+2
   (3)  (\|x   + 1)\|\|x   + 1
                                          Type: Union(Expression Integer,...)
(4) -> t:Boolean:=(a=b)

   (4)  false
                                                                Type: Boolean
(5) -> a-b

   (5)  0
                                                     Type: Expression Integer
(6) -> a-c

   (6)  0
                                                     Type: Expression Integer

Two comments: (2) and (3) took longer than (1). (4) is not compatible with (5)
or (6) (the reason may be because the domain is a Union, and equality there may
be by data representation. In general, equality and zero testing are different.)

William




reply via email to

[Prev in Thread] Current Thread [Next in Thread]