4
$\begingroup$
Clear["Global`*"];

f[x_, y_] := 9 - x^2 - y^2;

Integrate[f[x, y], {x, -1, 1}, {y, -Sqrt[1 - x^2], Sqrt[1 - x^2]}]

Integrate[f[x, y], {x, y} ∈ Disk[]]

Both give:

(17 π)/2


Visualization:

p1 = Plot3D[f[x, y], {x, -3, 3}, {y, -3, 3}
   , PlotStyle -> None
   , PlotRange -> {{-3, 3}, {-3, 3}, {0, 10}}
   , ClippingStyle -> None
   , ImageSize -> 400
   ];
p2 = Plot3D[f[x, y], {x, y} ∈ Disk[]
   , Filling -> Bottom
   , FillingStyle -> Opacity[0.5]
   , PlotRange -> {0, 9}
   ];
Show[p1, p2]

enter image description here


Question

How can the same problem be set up and solved using polar coordinates? i.e., by manually performing double integration as well as by integrating over a polar region using Mathematica' s syntax?


Thanks for your help.

$\endgroup$

3 Answers 3

7
$\begingroup$
f[x_, y_] := 9 - x^2 - y^2;
Integrate[f[x, y], {x, -1, 1}, {y, -Sqrt[1 - x^2], Sqrt[1 - x^2]}]
(* (17 π)/2 *)

IntegrateChangeVariables[
 Inactive[Integrate][f[x, y], {x, -1, 1}, {y, -Sqrt[1 - x^2], Sqrt[1 - x^2]}], {r, θ},
 "Cartesian" -> "Polar"]
(* Inactive[Integrate][-r (-9 + r^2), {r, 0, 1}, {θ, -π, π}] *)

Activate[%]
(* (17 π)/2 *)
$\endgroup$
1
  • $\begingroup$ Thanks. Can 9 - r^2 also be integrated over a polar region? e.g., Integrate[ r ( 9 - r^2), {θ, r} ∈ reg]? So far I haven't been able to do this. $\endgroup$
    – Syed
    Feb 10 at 15:31
5
$\begingroup$
  • Method-1
f[x_, y_] := 9 - x^2 - y^2;
reg = ParametricRegion[
  r {Cos[t], Sin[t]}, {{t, 0, 2 π}, {r, 0, 1}}]
Integrate[f[x, y], {x, y} ∈ reg]

(17 π)/2.

  • Mehtod-2
Clear[x,y];
f[x_, y_] := 9 - x^2 - y^2;
x[r_, t_] := r*Cos[t];
y[r_, t_] := r*Sin[t];
Integrate[
 f[x[r, t], y[r, t]]*Abs@Det@Grad[{x[r, t], y[r, t]}, {r, t}], {t, 0, 
  2 π}, {r, 0, 1}]

(17 π)/2.

  • Another example is ellipsoid.
Clear[f, a, b];
f[x_, y_] := 9 - x^2 - y^2;
{a, b} = {3, 2};
Integrate[f[x, y], {x, y} ∈ Ellipsoid[{0, 0}, {a, b}]]

Clear[x, y];
x[r_, t_] := a*r*Cos[t];
y[r_, t_] := b*r*Sin[t];
Integrate[
 f[x[r, t], y[r, t]]*Abs@Det@Grad[{x[r, t], y[r, t]}, {r, t}], {t, 0, 
  2  π}, {r, 0, 1}]

(69 π)/2.

(69 π)/2.

$\endgroup$
3
  • $\begingroup$ Thanks. Can 9 - r^2 also be integrated over a polar region? Integrate[ r ( 9 - r^2), {θ, r} ∈ reg]? So far I don't know how to do this. $\endgroup$
    – Syed
    Feb 10 at 15:33
  • $\begingroup$ @Syed Do you mean Integrate[ r (9 - r^2), {r, θ} ∈ Rectangle @@ Transpose@{{0, 1}, {0, 2 π}}] ? $\endgroup$
    – cvgmt
    Feb 10 at 15:41
  • $\begingroup$ This is interesting but no. I mean, with the polar region reg you have defined above. $\endgroup$
    – Syed
    Feb 10 at 15:52
1
$\begingroup$

Thanks for the nice answers by @David G. Stork and @cvgmt

Since IntegrateChangeVariables is a promising (but a recent) addition, I would like to add this workaround:

f[x_, y_] := 9 - x^2 - y^2;
tf = TransformedField[ "Cartesian" -> "Polar", 
   f[x, y], {x, y} -> {r, θ}] // Simplify

9 - r^2

Integrate[ r tf, {r, 0, 1}, {θ, 0, 2 π}]

(17 π)/2

where the calculations for limits of r and θ are being done manually, something that IntegrateChangeVariables provides.


$\endgroup$

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.