axiom-developer
[Top][All Lists]

## RE: [Axiom-developer] [Q] How to classify # integrate(log(%i+z^2), z)

 From: Bill Page Subject: RE: [Axiom-developer] [Q] How to classify # integrate(log(%i+z^2), z) -> 2 ? Date: Mon, 14 Feb 2005 12:23:32 -0500

```On Monday, February 14, 2005 9:16 AM William Sit wrote:
>
>
> Bill Page wrote:
> >
> > On Friday, February 11, 2005 9:56 AM Vladimir Bondarenko wrote:
> > > ...
> > > ===> Case 2.
> > >
> > > -> integrate(log(%i+z^2), z)
> > > ...
> > > But why the user really needs 2 forms of the same answer?
> > >
> >
> > I think you should report it as a bug.
> >
> I'm not sure, because you can use
>
> (4) -> complexIntegrate(log(%i+z^2),z)
> ...
> to obtain one form.

That is true, but it is a different problem and it doesn't make
the first result correct (returning two equivalent expressions).
To me, this is still a bug - although admittedly not a very serious
bug since Axiom only claims to "return all possible values" - not
that these answers would necessarily all be unique.

> Using integrate when the integrand involves complex values and
> ask for real forms does not sound correct.

I don't understand your objection. The expression `log(%i+z^2)'
does not contain any parameters. It makes perfectly good sense
to me to integrate this complex-valued function over the real
line z. I don't think that using `integrate' is "asking for real
forms". What are "real forms"? The expressions returned by Axiom
for both `integrate' and `complexIntegrate' can involve complex
quantities and both (implicitly) assume that the variable of
integration is real-valued.

[Aside: Here is yet another place where it would be desirable
if Axiom implemented the notion of typed variables instead of
just symbols.]

The Axiom Book has the following to say about integration (page
110):

"When real parameters are present, the form of the integral can
depend on the signs of some expressions. Rather than query the user
or make sign assumptions, Axiom returns all possible answers.
...
The integrate operation generally assumes that all parameters are
real. The only exception is when the integrand has complex valued
quantities.

If the parameter is complex instead of real, then the notion of
sign is undefined and there is a unique answer. You can request
this answer by "prepending" the word "complex" to the command name
..."

So the issue has to do only with assumptions about parameters.

Page 370:

"The package FunctionSpaceIntegration provides the top-level
integration operation, integrate, for integrating **real-valued
elementary functions**."

Since `log(%i+z^2)' is of type 'Expression Complex Integer' it
might be considered a bug that there is an `integrate' function
with the signature

)di op integrate

[7] (D2,Symbol) -> Union(D2,List D2) from FunctionSpaceIntegration(
D4,D2)
if D4 has Join(EuclideanDomain,OrderedSet,
CharacteristicZero,RetractableTo Integer,
LinearlyExplicitRingOver Integer) and D2 has Join(
TranscendentalFunctionCategory,PrimitiveFunctionCategory,
AlgebraicallyClosedFunctionSpace D4)

--------

Since Expression Complex Integer apparently has the required
properties and the intepreter chooses this function

(11) -> integrate(%% 10,z)

Function Selection for integrate
Arguments: (EXPR COMPLEX INT,VARIABLE z)

[1]  signature:   (EXPR COMPLEX INT,SYMBOL) -> Union(
EXPR COMPLEX INT,
LIST EXPR COMPLEX INT)
implemented: slot (Union (Expression (Complex (Integer)))
(List (Expression (Complex (Integer)))))
(Expression (Complex (Integer)))(Symbol) from
FSINT(COMPLEX INT,EXPR COMPLEX INT)

---------

In contrast

(12) -> complexIntegrate(%% 10,z)

Function Selection for complexIntegrate
Arguments: (EXPR COMPLEX INT,VARIABLE z)

[1]  signature:   (EXPR COMPLEX INT,SYMBOL) -> EXPR COMPLEX INT
implemented: slot (Expression (Complex (Integer)))
(Expression (Complex (Integer)))(Symbol) from
FSCINT(COMPLEX INT,EXPR COMPLEX INT)

-----------

It is not clear to me what exactly is the intended difference
between the domains FSINT(COMPLEX INT,EXPR COMPLEX INT) and
FSCINT(COMPLEX INT,EXPR COMPLEX INT).

Further on page 372 the Book says:

"If the parameters and the variables of integration can be
complex numbers rather than real, then the notion of sign is
not defined. In this case all the possible answers can be
expressed as one complex function. To get that function, rather
than a list of real functions, use complexIntegrate, ..."

I think the reference to "variables of integration" must be
incorrect here, otherwise we would be talking about contour
integrals, residuals, etc. and that seems like a very different
subject - one that unfortunately Axiom doesn't seem to address :(

> Axiom may (I am not sure) have interpreted %i as a parameter
> with no special property.

If that is true, then surely that is a bug. Right?

Regards,
Bill Page.

```