MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Another strange bug in Mathematica 4.0's Integrate

  • To: mathgroup at
  • Subject: [mg25438] Re: Another strange bug in Mathematica 4.0's Integrate
  • From: Hendrik van Hees <h.vanhees at>
  • Date: Sun, 1 Oct 2000 02:44:22 -0400 (EDT)
  • References: <8q21lp$> <ztgz5.89556$> <8qlo62$> <8r19m2$>
  • Sender: owner-wri-mathgroup at

Ok, then please tell me, _how_ Integrate is defined in Mathematica
because this will help me a lot in more difficult problems. Let me again
cite the really strange behaviour for this very simple Integral:

Mathematica 4.0 for Students: Linux Version
Copyright 1988-1999 Wolfram Research, Inc.
 -- Motif graphics initialized -- 

In[1]:= Integrate[Sqrt[(r-x)(r+x)],{x,-r,r},Assumptions->{r>0}]

        Pi r Sqrt[r ]
Out[1]= -------------

Of course the result should be twice as big and this result you get
indeed from a _mathematically identical expression for the integrand_:

In[2]:= In[2]:= Integrate[Sqrt[r^2-x^2],{x,-r,r},Assumptions->{r>0}]

        Pi r
Out[2]= -----

Ok. Let's look what happens with the indefinite integrals:

        x Sqrt[(r - x) (r + x)]
Out[3]= ----------------------- - 
      2                                 Sqrt[r - x] x
     r  Sqrt[(r - x) (r + x)] ArcTan[--------------------]
                                     (-r + x) Sqrt[r + x]
>    -----------------------------------------------------
                   2 Sqrt[r - x] Sqrt[r + x]

In[4]:=  Integrate[Sqrt[r^2-x^2],x,Assumptions->{r>0}]

                                            2    2
                           2        x Sqrt[r  - x ]
                          r  ArcTan[---------------]
                2    2                   2    2
        x Sqrt[r  - x ]                -r  + x
Out[4]= --------------- - --------------------------
               2                      2

This explains a lot! As you see in the first expression Mathematica
splits the square root! I guess for the definite integral the boundaries
of the integral are naively put in and of course at the boundaries in
the first expression you are running in trouble because you are
evaluating the square root along the branch cut which runs along the
negative real axis. If Mathematica would handle branch cuts and so on
correctly it should at least print a warning that it is running into
that problems.

My only way out in really serious calculations is to take the indefinite
integrals (checking by differentiation if they are correct) and then to
take the correct expression by putting it on the right Riemann sheet by

Hendrik van Hees		Phone:  ++49 6159 71-2751
c/o GSI-Darmstadt SB3 3.183	Fax:    ++49 6159 71-2990
Planckstr. 1			mailto:h.vanhees at
D-64291 Darmstadt

  • Prev by Date: Re: List element manipulation
  • Next by Date: Re: Re: winding number
  • Previous by thread: NDSolve with a function which calls N
  • Next by thread: Tex conversion