# Finding the mass of a solid bounded by two surfaces

I have bee given the problem:

A flying saucer has shape bounded below and above by the functions:

$$\qquad f(x,y) = 61/5 - 12x/5 + x^2 - 12y/5 +6xy/5 +2y^2/5$$

and

$$\qquad g(x,y) = 15 - x^2 - 6xy/5 - 2y^2/5$$

If the density of the saucer is $$(x,y,z) = x^2 + 3z$$, find the mass.

The example we were given related a different function to a numerical value, 10, and used Solve[... == 10, y] to find solutions to the quadratic in terms of y as a function of x, but this isn't applicable to the situation I have, so I'm kind of stuck.

In Mathematica I would use Integrate with ImplicitRegion. First, the ImplicitRegion:

region = ImplicitRegion[
Less[
61/5 - 12 x/5 + x^2 - 12 y/5 + 6 x y/5 + 2 y^2/5,
z,
15 - x^2 - 6 x y/5 - 2 y^2/5
],
{x,y,z}
];
Region @ region Now, for the integral:

Integrate[
x^2 + 3z,
{x, y, z} ∈ region
]


34048 π/15

It sounds like you intend to use Solve to find the limits of integration over the density. If you define f and g in Mathematica:

f[x_,y_]:=61/5 - 12 x/5+x^2-12 y/5+6 x y/5+2 y^2/5;
g[x_,y_]:=15-x^2-6 x y/5-2 y^2/5;


And solve them for each other:

Solve[f[x,y]==g[x,y],y]


You'll find the limits for y in terms of x. In the integral, you'll use it as {y,(3-3x-Sqrt[23-6x-x^2])/2,(3-3x+Sqrt[23-6x-x^2])/2}, taking note that the subtracted square root is always going to be the lower bound.

Use the determinant of y's solution to find the boundaries on x:

Solve[23-6x-x^2==0,x]


The limits on x are {x,-3-4Sqrt,-3+4Sqrt}. Then use Integrate on the density over the enclosed volume, making sure to put the x term before the y term, since the y term depends on x:

Integrate[x^2+3z,{x,-3-4Sqrt,-3+4Sqrt},{y,(3-3x-Sqrt[23-6x-x^2])/2,(3-3x+Sqrt[23-6x-x^2])/2},{z,f[x,y],g[x,y]}]


Which should be 34048 Pi/15.

Mathematica can figure out this condition on its own as well:

Integrate[(x^2+3z) Boole[f[x,y]<z<g[x,y]],{x,-Infinity,Infinity},{y,-Infinity,Infinity},{z,-Infinity,Infinity}]


The Boole term is 1 when the condition f[x,y]<z<g[x,y] is true and 0 otherwise, so the integral can be performed over all of space. This should get the same answer.