7
$\begingroup$

Recently I came across an interesting article by Daniel Lichtblau, where the integral

Integrate[Abs[x - y]^n, {x, 0, 1}, {y, 0, 1}]

Piecewise[{2/((1 + n)*(2 + n)),Re[n] > -2 }}, Integrate[ Abs[x - y]^n, {x, 0, 1}, {y, 0, 1}, Assumptions -> Re[n] <= -2]]

(The same result is obtained in 12.2 and with RealAbs instead of Abs.) is presented.

As I understand it, the conditions Re[n] > -1 and Re[n] <= -1 should be in the above. Here are my arguments. First, the expression 2/((1 + n)*(2 + n)) is negative for n < -1, n > -2, whereas the integrand is positive. Second, if n < 0, then we deal with an improper integral. Let us calculate its half by

Integrate[RealAbs[x - y]^(-n), {x, 0, 1}, {y, x + \[Epsilon], 1}, 
Assumptions -> \[Epsilon] > 0 && \[Epsilon] < 1/2]

ConditionalExpression[((-2 + n)^(-1) + \[Epsilon]^(1 - n))/ (-1 + n), Re[n] < 1]

Limit[%,\[Epsilon]->0,Direction->"FromAbove"]

ConditionalExpression[(2 - 3*n + n^2)^(-1), Re[n] < 1]

Is it a bug or am I missing something?

$\endgroup$
3
  • 1
    $\begingroup$ This must be a bug indeed. The integral does not exist for R[n]<=-1. This can be seen by a substitution y -> x + w which turns the integral into something like $\int \int w^{n} \, \mathrm{d} w \, \mathrm{d} x$. $\endgroup$ Commented Mar 30, 2021 at 7:32
  • 1
    $\begingroup$ Please report it to Wolfram Support and keep us posted on their answers! $\endgroup$
    – MarcoB
    Commented Mar 30, 2021 at 12:26
  • 1
    $\begingroup$ @MarcoB: "Thank You! We have received your message and will respond shortly." $\endgroup$
    – user64494
    Commented Mar 30, 2021 at 14:00

1 Answer 1

9
$\begingroup$

Yes this must be a bug. Splitting the integral "by hand" gives the correct result:

Integrate[Integrate[(x - y)^n, {y, 0, x} ], {x, 0, 1}] +Integrate[Integrate[( y - x)^n, {x, 0, y} ], {y, 0, 1}]    
(*ConditionalExpression[2/(2 + 3 n + n^2), Re[n] > -1]*)

addendum

Mathematica v12.2 evaluates the integral OP asked for only correct if GenerateConditions -> True or GenerateConditions -> False is included

Integrate[Abs[x - y]^n, {x, 0, 1}, {y, 0, 1},GenerateConditions -> True]

enter image description here

Case GenerateConditions -> Automatic gives the wrong result.

$\endgroup$
2
  • $\begingroup$ Thank you for the workaround with GenerateConditions->True. $\endgroup$
    – user64494
    Commented Mar 30, 2021 at 10:53
  • $\begingroup$ You're welcome ! $\endgroup$ Commented Mar 30, 2021 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.