9
$\begingroup$

I am trying to calculate a integral over a region defined by

enter image description here

But I dont really know how to do it, I dont know if I have to work in cartesian coordinates or polar coordinates.

The function that I want to integrate is

$\qquad f(x,y) = x^2+y^2-2ax+ \frac{2b^2ax}{x^2+y^2}-b^2$.

$\endgroup$
17
$\begingroup$

Mathematica makes this fairly simple. We can define a region

region = RegionDifference[Disk[{a, 0}, a], Disk[{0, 0}, b]]
(* BooleanRegion[#1 && ! #2 &, {Disk[{a, 0}, a], 
  Disk[{0, 0}, b]}] *)

You can visualise this quite simply, for specific values of a and b with the following line

Block[{a = 3, b = 1}, Region[region]]

and an integrand

integrand = x^2 + y^2 - 2 a x + 2 b^2 a x/(x^2 + y^2) - b^2;

and simply apply Integrate. I hope you find the result informative!

Assuming[0 < b < a, 
 Integrate[integrand, {x, y} ∈ region]]
(* 1/24 (-6 a^2 b Sqrt[4 a^2 - b^2] - 
   21 b^3 Sqrt[4 a^2 - b^2] - 12 a^4 π + 8 b^4 π - 
   48 a^2 b^2 ArcCos[Sqrt[b/a]/Sqrt[2]] + 
   48 b^4 ArcCot[b/Sqrt[4 a^2 - b^2]] - 20 a^4 ArcCsc[(2 a)/b] - 
   4 b^4 ArcSec[(2 a)/b] + 44 a^4 ArcSin[b/(2 a)] + 
   48 a^2 b^2 ArcSin[b/(2 a)] - 
   48 a^2 b^2 ArcSin[Sqrt[b/a]/Sqrt[2]] + 
   96 a^2 b^2 ArcTan[Sqrt[-1 + (4 a^2)/b^2]] - 
   48 b^4 ArcTan[Sqrt[-1 + (4 a^2)/b^2]] - 
   16 b^4 ArcTan[b/Sqrt[4 a^2 - b^2]]) *)
| improve this answer | |
$\endgroup$
  • $\begingroup$ Assuming[0 < b < a, Integrate[integrand, {x, y} \[Element] region] // FullSimplify] will provide a much simpler form. $\endgroup$ – Bob Hanlon Dec 7 '19 at 21:41
  • $\begingroup$ @BobHanlon shorter, certainly and worth looking at. But I'm not sure it it would seem simpler and more meaningful to the author (it introduces logs of complex numbers for one thing) $\endgroup$ – mikado Dec 7 '19 at 21:47
  • $\begingroup$ My version (12) returns 1/24 (-4 (6 a^4 + 12 a^2 b^2 + b^4) ArcSec[(2 a)/b] + b (-6 a^2 Sqrt[4 a^2 - b^2] - 21 b^2 Sqrt[4 a^2 - b^2] + 32 b^3 \[Pi] - 48 b (-2 a^2 + b^2) ArcTan[Sqrt[-1 + (4 a^2)/b^2]] - 64 b^3 ArcTan[b/Sqrt[4 a^2 - b^2]])) which I have verified is equivalent to your shown result for 0 < b < a $\endgroup$ – Bob Hanlon Dec 7 '19 at 21:50
  • $\begingroup$ @BobHanlon interesting. I'm using V12 too. I guess that it's an example of one of the reasons why I'm a little reluctant to recommend FullSimplify too blindly. $\endgroup$ – mikado Dec 7 '19 at 22:04
  • 6
    $\begingroup$ I guess we do not need to learn multivariable calculus any more because Mathematica makes this easy to do :) $\endgroup$ – Nasser Dec 7 '19 at 23:59

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.