Re: Curious behavior of Taylor series

"William Sit" <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.general
Message-ID <[email protected]>
"Igor Khavkine" <[email protected]> writes:

>OK, but the following definitely looks like a bug.
>
>(279) -> monx := monomial(1,1)$UTS(EXPR INT,x,0)
>   (279)  x
>                         Type: 
>UnivariateTaylorSeries(Expression Integer,x,0)
>(281) -> sqrt(monx*monx)
>(281) ->
>   (281)  1
>                         Type: 

In the Windows version, I get the correct answer. So this 
bug is newly introduced.
                         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) -> )set mess auto off
(1) -> monx := monomial(1,1)$UTS(EXPR INT,x,0)

    (1)  x
                          Type: 
UnivariateTaylorSeries(Expression Integer,x,0)
(2) -> sqrt(monx*monx)

    (2)  x
                          Type: 
UnivariateTaylorSeries(Expression Integer,x,0)
(3) -> x

    (3)  x
                                                            
  Type: Variable x

Note in particular (3), which illustrates that Axiom 
treats undefined identifiers as symbols (or variables). 
Even though x has been used in (1) and (2), it is still 
undefined! The reason is the way UTS (or any univariate 
domain) is constructed in Axiom: since it is univariate, 
Axiom designers decided that it is not necessary to 
associate the main variable to an identifier. The x that 
appears in the output (and input) is external to the UTS 
computing environment and a pure notation in I/O for the 
convenience of the user. Internally, the main variable is 
represented by a place holder (and denoted by the local 
identifier ?). One reason for this set up is to allow 
coefficient domains to include Symbol (that is, all 
identifiers) and since ? is only a local identifier, it 
will not get mixed up with anything in the coefficient 
domain. This explains why in your example, x*y gives x*x 
(which is really x*?). It is important to know that the 
line

y:=taylor x

does NOT define x, only y. You cannot use x to mean the 
main variable until you define it. So you can do this:

(1) -> y:=taylor x

    (1)  x
                          Type: 
UnivariateTaylorSeries(Expression Integer,x,0)
(2) -> x:UTS(EXPR INT,x,0):='x

    (2)  x
                          Type: 
UnivariateTaylorSeries(Expression Integer,x,0)
(3) -> x*y

          2
    (3)  x
                          Type: 
UnivariateTaylorSeries(Expression Integer,x,0)



William
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.