How does integrate handle %i?



Dear list,

The following session seems to indicate that integrate "chooses"
different square roots of negative one depending on the context (note
that the last output is precisely minus the penultimate output).  Is
there any flag to set which would ensure that I get the same answer
from integrating both f and g from 9 to 16?  Thank you!

Maxima 5.19post http://maxima.sourceforge.net
using Lisp SBCL 1.0.24
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) f:sqrt(25-x)*sqrt(1+1/(4*(25-x)));
                                1
(%o1)                  sqrt(---------- + 1) sqrt(25 - x)
                            4 (25 - x)
(%i2) integral(f,x);
                                  1
(%o2)           integral(sqrt(---------- + 1) sqrt(25 - x), x)
                              4 (25 - x)
(%i3) integrate(f,x);
                       sqrt(4 x - 101) (4 %i x - 101 %i)
(%o3)                  ---------------------------------
                                      12
(%i4) radcan(f);
                              %i sqrt(4 x - 101)
(%o4)                         ------------------
                                      2
(%i5) g:%$

(%i6) integrate(g,x);
                                             3/2
                               %i (4 x - 101)
(%o6)                          -----------------
                                      12
(%i7) domain;
(%o7)                                real
(%i8) integrate(f,x,9,16);
                                   3/2     3/2
                                 65      37
(%o8)                            ----- - -----
                                  12      12
(%i9) integrate(g,x,9,16);
                                 3/2        3/2
                               65    %i   37    %i
                           %i (-------- - --------)
                                  6          6
(%o9)                      ------------------------
                                      2