I need to compute the number $ \sigma_U $ for every open bounded subset of $ n $-dimensional Euclidean space defined as

$$ \sigma_U=\iint_Ud(x,y)\mathrm dx\mathrm dy $$

How can I compute this?

For $ n=1 $, at first I thought that, if we define reg as a valid region, for example, reg = RegionUnion[Interval[{-3,-1}], Interval[{1,3}]], then

Integrate[Abs[x-y],{x,y} ∈ RegionProduct[reg,reg]]


Integrate[Integrate[Abs[x-y], {x} ∈ reg], {y} ∈ reg]

would result in the same value, but they don't, so, which is it?

I believe it is the latter, but I thought that the first one results in the same value. Thanks.

  • 1
    $\begingroup$ In what sense is the result of the second integral problematic? Also, you haven't specify reg, yet. $\endgroup$ Jan 21 '19 at 12:43
  • $\begingroup$ Does Integrate[ Integrate[Abs[x - y], {x} ∈ reg, Assumptions -> {y} ∈ reg], {y} ∈ reg] give the same answer as Integrate[Abs[x-y],{x,y} ∈ RegionProduct[reg,reg]]? $\endgroup$
    – Greg Hurst
    Jan 21 '19 at 14:59
  • $\begingroup$ @HenrikSchumacher reg could be, for example, RegionUnion[Interval[{-3,-1}],Interval[{1,3}]], which gives different answers, one says its $24$, and the other one $112/3$. $\endgroup$
    – Garmekain
    Jan 21 '19 at 17:10
  • $\begingroup$ @ChipHurst Check the previous comment. It does give different results for the given example. $\endgroup$
    – Garmekain
    Jan 21 '19 at 17:13
  • $\begingroup$ Please write a title that actually applies to your specific problem and which will help others find it and its associated answers. $\endgroup$ Jan 21 '19 at 18:30

Not an answer, just some observations that take up too much room for a comment.

Integrate and NIntegrate give two different answers. Since your integral evaluates to a number, it is always easy to do a spot check on the symbolics side of the house:

Integrate[Abs[x-y],{x,y} ∈ RegionProduct[reg,reg]]
 (* 24 *)

NIntegrate[Abs[x-y],{x,y} ∈ RegionProduct[reg,reg]]
 (* 37.3333 = N[112/3] *)

Your second integral didn't evaluate cleanly for me until a let MMA know y was a real number for the inner integral.

 Assuming[y∈Reals,Integrate[Integrate[Abs[x - y],{x}∈reg],{y}∈reg]]
 (*  112/3 *)

The plot of the region rp=RegionProduct[reg,reg] is a little odd, although the area computation comes out right. Couldn't figure out if the clipped corners are an artifact or not. Doesn't seem like enough area to make up the difference between 24 and 37.333, but suggests something odd is going on behind the curtain.

 (* 16 *)
 Region[rp, PlotRange -> All]

enter image description here

Both integrals do fine if the function is just 1.

 Integrate[1, {x, y} ∈ rp]
 Integrate[Integrate[Abs[x - y],{x}∈reg],{y}∈reg]
  (* 16 *)
  • $\begingroup$ I don't get those clippings using RegionPlot[RegionProduct[reg,reg]], but yes, something odd is happening, I also tried using Norm instead of Abs, but I get the same results. $\endgroup$
    – Garmekain
    Jan 21 '19 at 18:11
  • $\begingroup$ II am using v11.3.0.0, just for reference. $\endgroup$
    – MikeY
    Jan 21 '19 at 18:13
  • $\begingroup$ My version is $\endgroup$
    – Garmekain
    Jan 21 '19 at 18:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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