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[2],-3+4Sqrt[2]}
. 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[2],-3+4Sqrt[2]},{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.