MathGroup Archive 1997

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

Search the Archive

Re: False result with Integrate ?

  • To: mathgroup at
  • Subject: [mg8745] Re: [mg8711] False result with Integrate ?
  • From: David Withoff <withoff>
  • Date: Sat, 20 Sep 1997 22:28:11 -0400
  • Sender: owner-wri-mathgroup at

>      Why : Integrate[Integrate[ Sqrt[(x-y)^2],{x,0,1}],{y,0,1}]
>      gives 0 with math2.2 or math3.0.
>      The exact result is 1/3 !!
>      Gilles
>      EDF/DER

You can get a correct result for this integral by breaking it
up into pieces, to allow for the singularity in the range of
integration.  For example:

In[1]:= Integrate[Integrate[ Sqrt[(x-y)^2],{x,0,y}],{y,0,1}] +
        Integrate[Integrate[ Sqrt[(x-y)^2],{x,y,1}],{y,0,1}]

Out[1]= -

The easiest way to understand what goes wrong if you don't break the
integral up into pieces is to look at the integrals one at a time.
Here is the inner integral:

In[2]:= Integrate[ Sqrt[(x-y)^2],{x,0,1}]

        Sqrt[(-1 + y) ] (-1 + 2 y)
Out[2]= --------------------------
                2 (-1 + y)

In this integral, the symbol y is an unknown parameter.  The Integrate
function does not know if this parameter is positive or negative or
complex, and must make assumptions about this parameter in order to
proceed.  A close look at this result shows that the Integrate function
effectively assumes that y is negative.  This assumption causes a problem
when that result is used in the integral over y, since the integral over
y requires a result that is valid for y between 0 and 1.  

There have been dramatic improvements in the Integrate function in
Version 3.0, both in reporting assumptions about parameters, and in
the handling of singularities in the range of integration.  This is
a very difficult problem, however, and there are a few examples,
such as this one, where singularities are missed, or where assumptions
are not reported.

There are some additional notes about definite integration in the
technical support section of the Wolfram Research web site

Dave Withoff
Wolfram Research

  • Prev by Date: Re: When to use Compile[]
  • Next by Date: Re: A Recreational Endeavour
  • Previous by thread: Re: False result with Integrate ?
  • Next by thread: Re: False result with Integrate ?