3
$\begingroup$

I'm afraid this is going to be a really stupid question.

Evaluating the following definite integral

Integrate[Sqrt[1 - (x^2 + y^2)], {x, -1, 1}, {y, -1, 1}]

gives

(2/3) (Pi - I (-2 + Log[4]))

I don't want the imaginary part. Adding the option

Assumptions -> x^2 + y^2 <= 1

doesn't work. What did I miss?

$\endgroup$
1
  • $\begingroup$ You try to integrate Sqrt[1 - (x^2 + y^2)] over the region where the integrand becomes imaginary (for {x,y} outside the unit circle}), namely you're integrating over a square (-1,1) x (-1,1). $\endgroup$
    – Artes
    Jun 12, 2013 at 13:07

1 Answer 1

7
$\begingroup$

Good:

Integrate[Sqrt[1 - (x^2 + y^2)] Boole[x^2 + y^2 <= 1], {x, -1, 1}, {y, -1, 1}]

Better:

Integrate[r Sqrt[1 - r^2], {r, 0, 1}, {θ, -π, π}]

Vastly better:

2 π Integrate[r Sqrt[1 - r^2], {r, 0, 1}]

Exercise: why?

$\endgroup$
2
  • 2
    $\begingroup$ Because in the polar coordinates the area outside the integration region is automatically avoided? $\endgroup$
    – Taiki
    Jun 12, 2013 at 13:17
  • $\begingroup$ Good show. You're right, @Taiki. :) $\endgroup$ Jun 12, 2013 at 13:18

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.