Thread: Why can't I evaluate improper integrals in maxima?

1. Why can't I evaluate improper integrals in maxima?

It doesn't allow me. Here's an example:

Maxima 5.13.0 Maxima, a Computer Algebra System
Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
(%i1) integrate(1/(x^2), x, 0, INF);
Is INF positive, negative, or zero?

positive
;
Integral is divergent
-- an error. To debug this try debugmode(true);
(%i2)

I would be really grateful if someone could tell me how to do it.
Thanks!

2. You ARE doing it and it IS giving you the correct answer. Why do you want a divergent integral to give some other result? Perhaps it is your expectation that is in need of repair.

3. Originally Posted by s3a
It doesn't allow me. Here's an example:

Maxima 5.13.0 Maxima, a Computer Algebra System
Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
(%i1) integrate(1/(x^2), x, 0, INF);
Is INF positive, negative, or zero?

positive
;
Integral is divergent
-- an error. To debug this try debugmode(true);
(%i2)

I would be really grateful if someone could tell me how to do it.
Thanks!
1. Maxima is case sensitive INF and inf are not the same thing.

2. It is the lower bound not the upper where the problem lies.

3. The latest stable version is something over 5.20 (not that there appears to be much change between versions, but the latest version of the front end wxmaxima is significantly different from the older versions.

CB

4. I see. So what is the difference between INF and inf? INF is positive infinity, negative infinity and 0 (unless I am mistaken) but what is inf? Also, is there any way that I can make Maxima tell me what type of divergent integral it is? (=whether the outcome is positive or negative infinity)

Another question I have is: why does it say "error" if it's giving the right answer and I am entering the question properly?

5. Originally Posted by s3a
I see. So what is the difference between INF and inf? INF is positive infinity, negative infinity and 0 (unless I am mistaken) but what is inf? Also, is there any way that I can make Maxima tell me what type of divergent integral it is? (=whether the outcome is positive or negative infinity)

Another question I have is: why does it say "error" if it's giving the right answer and I am entering the question properly?
Try:

integrate(1/x^2,x,a,inf)

you will be asked if a is positive, negative or zero, tell it positive and it returns 1/a.

Now ask for the limit as a goes to zero, and you must specify if from both sides, the left or right.

If you say from both then you get no result as the limit from the right is +inf and from the left -inf.

(INF is not anything, if you use it it will be treated as an unassigned variable)

CB

6. Ok so integrate(1/x^2,x,a,inf) returns 1/a but integrate(1/x^2,x,0,inf) for example gives an error. Why?

7. Originally Posted by s3a
Ok so integrate(1/x^2,x,a,inf) returns 1/a but integrate(1/x^2,x,0,inf) for example gives an error. Why?
Because it is undefined

CB

8. I see. I was plugging in values blindly. Thanks!

Edit: Just something I wanted to add: Every time the integral is divergent, will it give me the word "error" and "Integral is divergent" along with the debugging message?
For example, will it always say the following (like is it normal or part of the process for it to say that a divergent integral is an error and suggest debugging)?:

"Integral is divergent
-- an error. To debug this try debugmode(true);" ?

9. Originally Posted by s3a
I see. I was plugging in values blindly. Thanks!

Edit: Just something I wanted to add: Every time the integral is divergent, will it give me the word "error" and "Integral is divergent" along with the debugging message?
For example, will it always say the following (like is it normal or part of the process for it to say that a divergent integral is an error and suggest debugging)?:

"Integral is divergent
-- an error. To debug this try debugmode(true);" ?
Probably, but CAS systems are too complex to be able to make absolutely categorical statements like that.

CB