MathGroup Archive 1997

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

Search the Archive

Re: False result with Integrate ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8756] Re: [mg8711] False result with Integrate ?
  • From: seanross at worldnet.att.net
  • Date: Sat, 20 Sep 1997 22:28:21 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

> Gilles BARBIER wrote:
> >
> >      Help !
> >
> >      Why : 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
> 
> Are you sure?  Sqrt[(x-y)^2]=x-y and
> Integrate[x,{x,0,1}]-Integrate[y,{y,0,1}]=0.

Gilles BARBIER wrote:
> 
>      No, Sqrt[(x-y)^2]=Abs[x-y]
> 
>      Moreover, I do not understand how the integral of an
>      always positive function can be 0.
> 
>      In mathemetics, we can then demonstrate that, in this case,
>      the function has to be null "nearly everywhere". This is
>      obviously not the case here.
> 
>      Gilles.
>      EDF/DER.
>

Upon looking at the problem further, I don't think that the symbolic
integrator is smart enough to split up the limits.  In order to
symbolically do this integral correctly, 

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

That is a pretty subtle trick for a symbolic processor to do. 
Apparently, Mma isn't up to the task. 

Another side note to this is that Sqrt[] is a multivalued function being
both positive and negative, hence any integral of Sqrt of anything is
zero.  The symbolic processor was not up to the task of integrating
Abs[Sqrt[]].

By the way, NIntegrate[Sqrt[(x-y)^2],{x,0,1},{y,0,1}] returns 0.3333333.


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