MathGroup Archive 2010

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

Search the Archive

Re: Integrate bug

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108264] Re: [mg108232] Integrate bug
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Fri, 12 Mar 2010 07:09:19 -0500 (EST)
  • References: <201003111136.GAA06024@smc.vnet.net>

Note that if you integrate this separately from -4 to 0 and from 0 to -4 
and add, you will get the right answer:

Integrate[1/(6 (4 - Y)^(1/3)), {Y, -4, 0}] +
 Integrate[1/(6 (4 - Y)^(1/3)), {Y, 0, 4}]

1

Another clearly related observation is that when you attempt to compute 
this integral with general limits the explicit answer excludes the range 
of limits over which you want to compute your integral:

 Integrate[1/(6*(4 - Y)^(1/3)), {Y, a, b},
   Assumptions -> Element[a | b, Reals] && b > a]

(1/6)*If[a > 4, (3/4)*I*(Sqrt[3] + I)*
       ((a - 4)^(2/3) - (b - 4)^(2/3)),
     Integrate[1/(4 - Y)^(1/3), {Y, a, b},
       Assumptions -> (b <= 4 && a < b) ||
           (b > 4 && a <= 4)]]

However, when you compute the integrals from  a to 0 and from 0 to b, 
the conditions for the explicit answer are compatible with the values  
of your limits (-4 and 4):

Integrate[1/(6*(4 - Y)^(1/3)), {Y, a, 0},
   Assumptions -> Element[a, Reals]]

(1/6)*If[a <= 4, (3/2)*(4 - a)^(2/3) - 3*2^(1/3),
     Integrate[1/(4 - Y)^(1/3), {Y, a, 0},
       Assumptions -> a > 4]]

 p = % /. a -> -4;

Integrate[1/(6*(4 - Y)^(1/3)), {Y, 0, b},
   Assumptions -> Element[b, Reals]]

(1/6)*If[b <= 4, 3*2^(1/3) - (3/2)*(4 - b)^(2/3),
     Integrate[1/(4 - Y)^(1/3), {Y, 0, b},
       Assumptions -> b > 4]]

q = % /. b -> 4;

Simplify[p + q]

1

Andrzej Kozlowski


On 11 Mar 2010, at 12:36, Daniel wrote:

> Hello,
>
> I was working with the following probability distribution
>
> P(Y) = 1/(6 (4 - Y)^(1/3)), for -4 < Y < 4
>
> and I tried to check whether it would sum up to 1. But it didn't work
> with Integrate:
>
> Integrate[1/(6 (4 - Y)^(1/3)), {Y, -4, 4}] = 0
>
> Clearly, the integral is 1. It is surprising that NIntegrate gives the
> right answer:
>
> NIntegrate[1/(6 (4 - Y)^(1/3)), {Y, -4, 4}] = 1.
>
> Wolfram Alpha seems to have the bug as well:
>
> =
http://www.wolframalpha.com/input/?i=integrate+1%2F%286+%284+-+Y%29%5E%2=
81%2F3%29%29+from+-4+to+4
>
> Cheers,
> Daniel
>



  • References:
  • Prev by Date: superimposed plots using SHOW command
  • Next by Date: Re: Re: elementary questio about packages
  • Previous by thread: Re: Re: Integrate bug
  • Next by thread: Re: Integrate bug