1
$\begingroup$

So I'm working on triple integrals, specifically on those where I have a region bounded by various surfaces. (In other words, the ranges for each integrals are not given, but must be calculated.)

I know how to do the integral once I have the boundaries of each integral. I also know how to use regionplot and implicitregion to graph my surface. Mathematica then shows a nice picture of the bounded region.

What I don't know how to do is tell Mathematica to immediately calculate the integral. I've found a couple of examples online but in each case they seemed to have already calculated the boundaries and then just entered them into the Integrate function.

I need to figure out the interval. How do I figure out the boundaries or just immediately tell Mathematica to calculate the integral (with the boundaries being part of the effort)?

Thanks.

Here's an example of the code I found in another document. It all makes sense and is replicable until you get to the Integrate function. It has boundaries. Are these done by hand? Or is there a way to have Mathematica create them?

Here is the code that doesn't seem to work. I did follow Bob's method below, and I recreated his example, but the following doesn't work. Mathematica says "Volume = undefined" and the integral is zero.

Clear["Global`*"]

reg = ImplicitRegion[    y==4-z&&y==-x^2&&y==0&&z==0, {x, y, z}];

Region[reg, Axes -> True, Boxed -> True]

volume[reg]

Integrate[1, {x, y, z} ∈ reg]

Here's an example I found online. But again the limits are entered in here.

enter image description here

$\endgroup$
3
  • 4
    $\begingroup$ Please post the codes about your functions and integral domain. $\endgroup$
    – cvgmt
    Nov 16 '20 at 3:02
  • 1
    $\begingroup$ Post the code instead of picture since not all of us can see the pictures. $\endgroup$
    – cvgmt
    Nov 16 '20 at 3:48
  • $\begingroup$ I'm sorry. I don't have any code to offer. I don't know where to start, except by repeating what's been done. $\endgroup$
    – Abcderia
    Nov 16 '20 at 4:18
2
$\begingroup$
Clear["Global`*"]

reg = ImplicitRegion[
   z <= 4 - 4 (x^2 + y^2) && (z >= (x^2 + y^2)^2 - 1), {x, y, z}];

Region[reg, Axes -> True, Boxed -> True]

enter image description here

The volume can be calculated by any of the following methods:

Volume[reg]

(* (8 π)/3 *)

RegionMeasure[reg]

(* (8 π)/3 *)

Integrate[1, {x, y, z} ∈ reg]

(* (8 π)/3 *)

EDIT:

Alternatively,

Integrate[
  Boole[z <= 4 - 4 (x^2 + y^2) && (z >= (x^2 + y^2)^2 - 1)],
 {x, -Infinity, Infinity}, {y, -Infinity, Infinity},
 {z, -Infinity, Infinity}]

(* (8 π)/3 *)
$\endgroup$
6
  • 1
    $\begingroup$ Thanks. I did try this, and edited my above post to show my code. I couldn't get it work. I did replicate your work, but I couldn't do it on my problem. I know it is possible, as I have a book answer to the problem, but I can't seem to get it done in Mathematica. $\endgroup$
    – Abcderia
    Nov 16 '20 at 15:18
  • $\begingroup$ What version of Mathematica are you using? $\endgroup$
    – Bob Hanlon
    Nov 16 '20 at 16:14
  • $\begingroup$ I am using version 10. $\endgroup$
    – Abcderia
    Nov 16 '20 at 16:30
  • $\begingroup$ @user27847 please include this in an edit to your question. Such details are essential & will help others to better answer your question. $\endgroup$ Nov 17 '20 at 1:02
  • $\begingroup$ @BobHanlon I have tried to mess with your equations. Could you help me understand how I might go about a problem like: f(x,y,z)=2x-y-z bounded by z=y^2,x=0,x=1,y=-2,y=2, and the xy plane? $\endgroup$
    – Abcderia
    Nov 18 '20 at 2:11
0
$\begingroup$

New Edition

One way is calculate all the possible measure of regions.

BTW, the questioner's equations can't enclose any finite regions.Here we change the sign of the second equation.

equations = {y == 4 - z, y == x^2, y == 0, z == 0};
expressions = (First[#] - Last[#]) & /@ equations;
inequalities = 
  And @@@ Tuples@
    Outer[Construct[#2, #1] &, 
     expressions, {GreaterEqual[#, 0] &, LessEqual[#, 0] &}];
regions = ImplicitRegion[#, {x, y, z}] & /@ inequalities;
PositionIndex[Volume /@ regions]
regions[[9]] // Volume
(* 256/15 *)
regions[[9]] // 
 RegionPlot3D[#, PlotPoints -> 100, MaxRecursion -> 2] &

enter image description here

Original

equations = {y == 4 - z, y == x^2, y == 0, z == 0};
expressions = (First[#] - Last[#]) & /@ equations;
inequalities = 
  And @@@ Tuples[
    Thread[{GreaterEqual[#, 0] & /@ expressions, 
      LessEqual[#, 0] & /@ expressions}]];
regions = ImplicitRegion[#, {x, y, z}] & /@ inequalities;
PositionIndex[RegionMeasure /@ regions]
inequalities[[9]]
inequalities[[11]]

<|∞ -> {1, 2, 3, 5, 6, 7, 10, 12, 13, 14, 15, 16}, 0 -> {4, 8}, 256/15 -> {9}, 4 -> {11}|>

-4 + y + z <= 0 && -x^2 + y >= 0 && y >= 0 && z >= 0

-4 + y + z <= 0 && -x^2 + y >= 0 && y <= 0 && z >= 0

$\endgroup$

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.