# [Maxima] Representing the case "no result"

Dieter Kaiser drdieterkaiser at web.de
Sat Jun 6 09:30:10 CDT 2009

```I think it would be a good idea to remove the call of merror in cases
like a definite integral which is divergent, e.g.

(%i25) integrate(x,x,0,inf);
defint: integral is divergent.
-- an error.  To debug this try debugmode(true);

There are two reasons:
First, we get problems with the assume database see bug report ID
[626607] "Defint doesn't clean up asksign db"
Second, it is no error in Maxima to get a divergent integral.

It is easy to remove the call to merror and do something like:

(%i27) integrate(x,x,0,inf);
defint: The integral is divergent.
(%o27) 'divergent

But it is problematic to return a symbol, because we get a lot of wrong
results, when the integral is part of an expression (I think the
problems are known). This is the case for 'inf and 'minf too.

Furthermore, it is not a good idea to return a noun form for a divergent
integral, because the noun form represents the case that Maxima is not
able to solve the integral.

I think we have no convention for cases like this: We have NO RESULT,
but we have NO ERROR too.

I have tried the following solution: The case NO RESULT is represented
by an empty list.

(%i29) integrate(x,x,0,inf);
defint: The integral is divergent.
(%o29) []

One advantage is, that the standard arithmetic will not change the
result "NO RESULT". The empty list simplifies to the empty list.

(%i33) a*(integrate(x,x,0,inf))^b;
defint: The integral is divergent.
(%o33) []

We have a problem with functions. Because functions do not automatically
map over lists we get something like

(%i34) sin(integrate(x,x,0,inf))^b;
defint: The integral is divergent.
(%o34) sin([])^b

When we introduce the automatic mapping of functions over lists we can
improve this e.g.

(%i35) expintegral_ei(integrate(x,x,0,inf))^b;
defint: The integral is divergent.
(%o35) []

(%i36) expintegral_e(order,integrate(x,x,0,inf))^b;
defint: The integral is divergent.
(%o36) []

So we have two questions to discuss:

1.

Is it a good idea to use the empty list [] to represent the case that we
have NO RESULT, but NO ERROR?

2.

Should we introduce in addition the convention, that functions may map
automatically over lists, e.g. sin([a,b,c]) --> [sin(a),sin(b),sin(c)]?

I think it is important to have a consistent convention to represent
situations like a divergent integral. The empty list might be a way to
do it.

The automatic mapping of functions over lists could be implemented step
by step and would help to get consistent results, when we introduce the
empty list to represent a divergent integral.

Dieter Kaiser

```