
use Boole[ ] to implement the constraint
It is rather unclear what you want to integrate. Below there are three alternatives with three different values:
NMaximize[{[Integral]!(
*SubsuperscriptBox[\[Integral], (
*SuperscriptBox[x, 2] +
*SuperscriptBox[y, 2]), 36](
*FractionBox[1, \[Pi]] ((
*SuperscriptBox[x, 2] +
*SuperscriptBox[y, 2])) [DifferentialD]x [DifferentialD]y
)), x >= 0, y >= 0, x^2 + y^2 <= 36}, {x, y}]
Out[69]= {25789., {x → 0., y → 6.}}
NMaximize[{[Integral][Integral]1/[Pi] (x^2 +
y^2) [DifferentialD]x [DifferentialD]y, x >= 0, y >= 0,
x^2 + y^2 <= 36}, {x, y}]
Out[70]= {68.7549, {x → 4.24264, y → 4.24264}}
NMaximize[{!(
*SubsuperscriptBox[\[Integral], (
*SuperscriptBox[x, 2] +
*SuperscriptBox[y, 2]), 36](
*SubsuperscriptBox[\[Integral], (
*SuperscriptBox[x, 2] +
*SuperscriptBox[y, 2]), 36]
*FractionBox[1, \[Pi]] ((
*SuperscriptBox[x, 2] +
*SuperscriptBox[y, 2])) [DifferentialD]x [DifferentialD]y
)), x >= 0, y >= 0, x^2 + y^2 <= 36}, {x, y}]
Out[72]= {-1.1913110^9, {x → 2.0236310^-9, y → 5.45121*10^-9}}
Why don’t you follow your own suggestion (in the post title) and transform the problem into polar coordinates, which immediately gives:
Integrate[r^3/Pi, {r, 0, 6}] Pi/2
(* Out: 162 *)
But if one hesitates to do any math one can choose the straightforward approach:
reg = ImplicitRegion[{x^2 + y^2 <= 36, x >= 0, y <= 0}, {x, y}];
Integrate[(x^2 + y^2)/Pi, {x, y} \[Element] reg]
(* Out: 162 *)
Define
x = r Cos[t];
y = r Sin[t];
Then
x^2 + y^2 // Simplify
r^2
So your r is equal to 6.
Your constraints are fulfilled if 3Pi/2 <= t <= 2 Pi. Look for example at
Plot[{x /. r -> 1, y /. r -> 1.5}, {t, 0, 2 Pi}]
The Volumeelement in Polar Coordinates (in R2 ) is dV = r dr dt, so your integral is written as
In[68]:= 1 / Pi Integrate[ r^2 r , {r, 0, 6}, {t, 3 Pi/2, 2 Pi}]
Out[68]= 162
Obviously your integral “lives” on a disk with radius r. Then you can equally write y as function of x and your integral is as well
In[77]:= 1/Pi Integrate[ x^2 + y^2, {x, 0, 6}, {y, 0, Sqrt[36 - x^2]}]
Out[77]= 162
In[1]:= 1/[Pi] Integrate[(x^2 + y^2) Boole[x^2 + y^2 <= 36], {x, 0,
6}, {y, -6, 0}]
Out[1]= 162
Frank,
What is the problem with the following?
NMaximize[{!(
*SubsuperscriptBox[\[Integral], 0, 6](
*SubsuperscriptBox[\[Integral], -6, 0]((
*SuperscriptBox[x, 2] +
*SuperscriptBox[y, 2]))/[Pi]\ \ [DifferentialD]y [DifferentialD]x)),x^2+y^2<=36,y<=0},{x,y}]
The solution is: {275.02, {x → 3.59228, y → -0.0941189}}
Christos, It would be easier to read you code if you post it using the code sample icon (the one after Add Notebook)
Ok Frank, sorry!
I attach the NMaximize.
DoubleIntegr.nb (2.85 KB)
That’s not the correct syntax for entering an integral. Also, I don’t understand why you’re doing a maximization.