MathGroup Archive 2005

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

Search the Archive

Re: Bug in Mathematica ?


Klaus G. schrieb:
> Strangely enough, Integrate[Min[x, y], {x, 0, a}, {y, 0, b}] results in
> a^3/6.
> Must be a bug?!
> 
> Klaus G.
> 
Hi Klaus,

not really a bug:

In[1]:=
Assuming[{a, b} \[Element] Reals,
   Integrate[Min[x, y], {x, 0, a}, {y, 0, b}]]// InputForm
Out[1]//InputForm=
Piecewise[
 {{a^3/3, a - b == 0 && a < 0 && b == 0},
  {(a^2*b)/2, a < 0 && b > 0 && a - b < 0},
  {(a*b^2)/2, a > 0 && a - b > 0 && b < 0},
  {b^3/6, a - b == 0 && b == 0 && a > 0},
  {b^3/3, a > 0 && b > 0 && a - b >= 0},
  {(-a^3 + 3*a^2*b)/6, a > 0 && b >= 0 && a - b < 0},
  {(2*a^3 + 3*a^2*b)/6, a < 0 && b > 0 && a - b == 0},
  {(a^3 + 3*a*b^2)/6, a - b > 0 && a < 0 && b <= 0},
  {(-a^3 + 3*a^2*b + 3*a*b^2)/6, a > 0 && a - b < 0 && b < 0},
  {(a^3 + 3*a^2*b + 3*a*b^2)/6, a < 0 && b > 0 && a - b > 0},
  {(3*a*b^2 - 2*b^3)/6, a > 0 && a - b > 0 && b > 0},
  {(a^3 + b^3)/3, a - b == 0 && a < 0 && b < 0},
  {(3*a^2*b + b^3)/6, a - b < 0 && b < 0 && a < 0},
  {(3*a*b^2 + b^3)/6, a - b == 0 && a > 0 && b < 0}},
 0
]
In[2]:=
FullSimplify[%,{a,b}\[Element]Reals]//InputForm
Out[2]//InputForm=
Piecewise[
 {{(a^2*b)/2, b > 0 && a < 0 && a < b},
  {(a*b^2)/2, a > 0 && a > b && b < 0},
  {b^3/3, a > 0 && b > 0 && a >= b},
  {-(a^2*(a - 3*b))/6, a > 0 && b >= 0 && a < b},
  {(a^3 + 3*a*b^2)/6, a > b && a < 0 && b <= 0},
  {(a^3 + b^3)/3, a == b && a < 0 && b < 0},
  {(3*a^2*b + b^3)/6, a < 0 && a < b && b < 0}},
 0
]


  • Prev by Date: Re: Re: question about HoldForm
  • Next by Date: Re: Import-Function buggy in Version 5.2 ?
  • Previous by thread: Re: Bug in Mathematica ?
  • Next by thread: Multicore Calculations