3

Is there a way to work around integration over Boole being mysteriously flaky like examples show below? Is there a meaningful explanation for this behaviour?

First, rather obvious integral stays unevaluated:

Integrate[Boole[u^2 + v^2 < 1], {u,-1,1}, {v,-1,x}, Assumptions -> -1 < x < 1]

(* Integrate[Boole[u^2 + v^2 < 1], {u,-1,1}, {v,-1,x}, Assumptions -> -1 < x < 1] *)

(EDIT: This actually behaves much better in v12, although needs FullSimplify to reach the result below.)

While the following succeeds to produce a meaningful result:

Integrate[Boole[u^2 + v^2 < 1], {u,-1,1}, {v,-1,x}, Assumptions -> -1 < x < 0]

(* Pi + x Sqrt[1 - x^2] - ArcCos[x] *)

Why this succeeds particularly puzzles me, when the first one fails:

Integrate[Boole[u^2 + v^2 < 1], {u,-1,1}, {v,-1,x},
  Assumptions -> -1 < x < Infinity] // FullSimplify

(* Pi + x Sqrt[1 - x^2] - ArcCos[x]             x <= 0
   Pi                                           x >= 1
   x Sqrt[1 - x^2] + ArcCos[x] + 2 ArcSin[x]    True *)
kirma
  • 19,056
  • 1
  • 51
  • 93
  • 1
    Whenever integration fails over a domain, I always do something like this: FullSimplify@ Integrate[Boole[u^2 + v^2 < 1], {u, -1, 1}, {v, -1, EulerGamma}] /. EulerGamma -> x – Greg Hurst Sep 17 '13 at 17:11

1 Answers1

2

It works if you do one integration at a time :

Integrate[Integrate[Boole[u^2 + v^2 < 1], {u, -1, 1}], {v, -1, x}, 
  Assumptions -> -1 < x < 1]
(* 1/2 (\[Pi] + 2 x Sqrt[1 - x^2] + 2 ArcSin[x]) *)
b.gates.you.know.what
  • 20,103
  • 2
  • 43
  • 84
  • It would also appear that swapping order to Integrate[Boole[u^2 + v^2 < 1], {v,-1,x}, {u,-1,1}, Assumptions -> -1 < x < 1] does the trick. Can someone explain why these tricks work? – kirma Sep 17 '13 at 16:36
  • This answer doesn't give a perfect solution but... I hope your answer helps people stumbling to these same issues. :) – kirma Sep 24 '13 at 20:31