6
$\begingroup$

I'm struggling with the integral, $$\iint\sqrt{4a^2-x^2-y^2}dxdy$$ taken over the upper half disk of radius a centered at (a, 0).

When I type it into Mathematica (10.2), Mathematica spits it back out. Here's my code.

Integrate[Sqrt[4a^2-x^2-y^2]Boole[x^2+y^2<2a x], {x, 0, 2a}, {y, 0, a}]

The output Mathematica produces is just the fancy version (2 dimensional) of this. This integration is easy, I've even done it by hand. Why can't Mathematica do it?

$\endgroup$
  • 2
    $\begingroup$ You could put a Assumptions -> a > 0 as an option. $\endgroup$ – wxffles Dec 10 '15 at 19:40
  • 2
    $\begingroup$ Well, unlike Mathematica, you assume that $a$ is real and positive, no? (Thus, follow wxffles's suggestion.) $\endgroup$ – J. M. is away Dec 10 '15 at 19:55
12
$\begingroup$

As J.M. noted, when you do it by hand, you presume that you are working with real variables and, probably, that a > 0. Mathematica doesn't make such assumptions by default, so you need to give it a hint.

For example,

Integrate[Sqrt[4 a^2 - x^2 - y^2] Boole[x^2 + y^2 < 2 a x], 
  {x, 0, 2 a}, {y, 0, a}, Assumptions -> a > 0]

will give

4/9 a^3 (-4 + 3 π)

which is perhaps what you are expecting.

Another way of writing this integral in Mathematica is

Integrate[Sqrt[4 a^2 - x^2 - y^2], 
  {x, y} ∈ ImplicitRegion[x^2 + y^2 < 2 a x && y > 0, {x, y}]]

Here the necessary assumptions are implicit in the region expression and a more complete answer is given.

result

$\endgroup$
7
$\begingroup$

This gives the result without assumptions:

Integrate[Sqrt[4 a^2 - x^2 - y^2] , Element[{x, y},
  RegionIntersection[Disk[{a, 0}, a], ImplicitRegion[y > 0, {x, y}]]]]

Piecewise[{{(4*a^3*(-4 + 3*Pi))/9, a > 0}}, 0]

(A little bit faster than the Boole approach as well )

$\endgroup$
2
$\begingroup$
reg = ImplicitRegion[(x - a)^2 + y^2 <= a^2 && 0 <= y <= a, {x, y}]
Integrate[Sqrt[4*a^2 - x^2 - y^2], {x, y} \[Element] reg, Assumptions -> a > 0]

4/9 a^3 (-4 + 3 Pi)

Interestingly, this should also work, but it runs forever!

reg = Disk[{a, 0}, a, {0, Pi}]
Integrate[Sqrt[4*a^2 - x^2 - y^2], {x, y} \[Element] reg, Assumptions -> a > 0]
$\endgroup$
  • $\begingroup$ This doesn't seem to be an answer; merely an observation. $\endgroup$ – J. M. is away Dec 11 '15 at 11:44

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.