Re: Bug in Mathematica ?

• To: mathgroup at smc.vnet.net
• Subject: [mg60840] Re: Bug in Mathematica ?
• From: Peter Pein <petsie at dordos.net>
• Date: Fri, 30 Sep 2005 03:57:08 -0400 (EDT)
• References: <dhdbeu\$8fk\$1@smc.vnet.net> <dhgf81\$20o\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```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