<s>[INST] Calculate volumes using triple integrals I have to calculate these two volumes using triple integrals:
volume of $A = \{(x,y,z) \in \Bbb R^3 : {x^2\over a^2} + {y^2\over b^2} \leq z \leq 1 \}$
volume of $B = \{(x,y,z) \in \Bbb R^3 : x^2+y^2+z^2 \leq a^2, x^2+y^2-ax \geq 0,x^2+y^2+ax \geq 0 \}$
So I want to calculate the integral of the function 1 over A but I'm having a hard time finding the limits of integration. Thanks in advance. 
 [/INST] Volume A is an elliptic paraboloid with its "vertex" at the origin, truncated by the plane $ \ z \ = \ 1 \ $ .  Because it has a symmetry axis along the $ \ z-$ axis, it is actually convenient to integrate using a single variable, since every "slice" parallel to the $ \ xy-$ plane is an ellipse, the area of which has a simple dependence upon $ \ z \ $ .  

If it is insisted upon that the volume be found using triple integration, we can work out some of the integration limits from the equation for the surface.  At any specific value $ \ z \ \ge \ 0 \ $ , we have  
$$ \ z \ = \ {x^2\over a^2} + {y^2\over b^2} \ \Rightarrow \ y \ = \ \pm  \ b \sqrt{z} \ \cdot \ \sqrt{1 - \frac{x^2}{a^2 z}}  \ \ . $$
The elliptical cross-section at a particular $ \ z \ $ has a "semi-horizontal" axis of length $ \ a \ \sqrt{z} \ $ and a "semi-vertical" axis $ \ b \ \sqrt{z} \ $ .  Because of the four-fold symmetry of these cross-sections, we can just integrate over the first quadrant and multiply the result by four.  The volume integral in Cartesian coordinates is then
$$ V_A \ = \ 4 \ \int_0^1 \int_0^{a \sqrt{z}} \int_0^{b \sqrt{z} \ \cdot \ \sqrt{1 - \frac{x^2}{a^2 z}}} \ \ dy \ dx \ dz \ \ = \ \ 4b \ \int_0^1 \int_0^{a \sqrt{z}} \ \sqrt{z} \ \cdot \ \sqrt{1 - \frac{x^2}{a^2 z}} \ \  dx \ dz  $$
[the integration over $ \ y \ $ simply gives us $ \ y \ $ evaluated at the upper integration limit]
$$ = \ \ 4b \ \int_0^1  \ \frac{1}{2} \sqrt{z} \ \left[ \ a \sqrt{z} \ \arcsin \left(\frac{x}{a \sqrt{z}} \right) \ + \ \frac{1}{a \sqrt{z}}  \cdot  x \ \sqrt{1 - \frac{x^2}{a^2 z}} \ \right]\vert_0^{a \sqrt{z}} \ \   dz  $$
[the integration over $ \ x \ $ is accomplished using a sine-substitution: the anti-derivative appears in many applications, so I won't derive it here]
$$ = \ \ 2b \ \int_0^1  \  \sqrt{z} \ \left( \ a \sqrt{z} \ \arcsin \ 1 \ + \ 0 \ - \ 0 \ + \ 0  \ \right) \ \   dz \ \ = \ \ 2ab \ \int_0^1  \ z \ \cdot \ \frac{\pi}{2}  \ \   dz  $$
[pulling the constants together shows us that each "horizontal slice" is indeed an ellipse with the expected area $ \ \pi \ ab \ z \ $ ]
$$ = \ \pi \ ab \ \left( \ \frac{1}{2} z^2 \ \right) \vert_0^1 \ = \ \frac{\pi \ ab}{2} \ \ , $$
confirming Felix Marin's result using cylindrical coordinates.  Since the "height" of the volume is one unit, the volume expression gives the appearance of only having two dimensions, but in fact has three.
$$ \ \ $$
Volume B is that of a sphere of radius $ \ a \ $ centered on the origin, less the volume of two circular cylinders of diameter $ \ a \ $ with their symmetry axes parallel to the $ \ z-$ axis, these axes passing through $ \ ( \ \frac{a}{2} , 0, 0 \ ) \ $ and $ \ ( \ -\frac{a}{2} , 0, 0 \ ) \ $ , respectively.  (We want the volume "inside the sphere, but outside of the cylinders".)

What we will compute is the volume of the portion of the sphere within the two cylinders, and subtract the result from the familiar expression for the volume of a sphere.  The symmetry of this geometrical arrangement is eight-fold, so we can consider integration in the first octant.  In the $ \ xy-$ plane, we will integrate over a semi-circle of radius $ \ \frac{a}{2} \ $ with its center at $ \ ( \ \frac{a}{2} , 0 \ ) $ , and integrate in the $ \ z-$ direction from that plane "upward" to the surface of the sphere.  
In rectangular coordinates, the "bounding function" for the semi-circle is given by 
$$ \ ( x - \frac{a}{2} )^2 \ + \ y^2 \ = \ \left( \frac{a}{2} \right)^2 \ \Rightarrow \ y \ = \ \sqrt{ax \ - \ x^2} \ \ , $$
and that for the spherical surface is
$$ x^2 \ + \ y^2 \ + \ z^2 \ = \ a^2 \ \Rightarrow \ z \ = \ \sqrt{a^2 \ - \ x^2 \ - \ y^2} \ \ . $$
The integral for the volume of the sphere contained by the cylinder is therefore
$$ 8 \ \int_0^a \int_0^{\sqrt{ax \ - \ x^2}} \int_0^{\sqrt{a^2 \ - \ x^2 \ - \ y^2}} \ \ dz \ dy \ dx \ \ .  $$
However, this soon produces a rather daunting calculation.  It proves to be much easier to work in cylindrical coordinates; setting up the integral can be done using our Cartesian-coordinate integral as a guide.  The integration in $ \ z \ $ now "runs" from $ \ 0 \ $ to $ \ \sqrt{a^2 \ - \ r^2 } \ $ .  The semi-circle expressed in polar coordinates is half of the "one-petal rosette" $ \ r \ = \ a \ \cos \ \theta \ $ , with the angle "running" from $ \ 0 \ $ to $ \ \frac{\pi}{2} \ $ .  So we will instead calculate
$$ 8 \ \int_0^{\pi / 2} \int_0^{a \ \cos \ \theta} \int_0^{\sqrt{a^2 \ - \ r^2 }} \ \ dz \ r \ dr \ d\theta \ \ = \ \ 8 \ \int_0^{\pi / 2} \int_0^{a \ \cos \ \theta} \ r \ \sqrt{a^2 \ - \ r^2 } \  \ dr \ d\theta  $$
$$ = \ \ 8 \ \int_0^{\pi / 2}  \ \left[ \ -\frac{1}{3}  \cdot   \ (a^2 \ - \ r^2)^{3/2} \ \right] \vert_0^{a \ \cos \ \theta} \ \ d\theta $$
$$ = \ \ \frac{8}{3} \ \int_0^{\pi / 2}  \  a^3 \ - \ ( \ a^2 \ - \ a^2 \ \cos^2 \ \theta \ )^{3/2} \ \ d\theta  \ \ =  \ \ \frac{8}{3} a^3 \ \int_0^{\pi / 2}  \  1 \ -  \   \sin^3 \ \theta  \ \ d\theta $$
$$ =   \ \frac{8}{3} a^3 \  \left[ \ \theta \ \vert_0^{\pi / 2} \ -  \  \left( \ u \ - \ \frac{1}{3} u^3 \ \right) \vert_{-1}^0  \ \right] $$
[using, in the second integrand term, the substitution $ \ du \ = \ \sin \ \theta \ d\theta \ , \ u \ = \ -\cos \ \theta \ $ ]
$$ =   \ \frac{8}{3} a^3 \  \left[ \ \frac{\pi}{2} \ -  \  \left( \ 0 \ - \ 0 \ - \ [\ -1 \ ] \ + \ [ \ -\frac{1}{3} \ ] \ \right)   \ \right] $$
$$ =   \ \frac{8}{3} a^3 \  \left( \ \frac{\pi}{2}  \ -  \   \frac{2}{3}  \ \right) \ = \  \frac{4 \pi}{3} a^3 \ -  \  \frac{16}{9} a^3  \ \ .  $$
Since this is the volume of the portion of the sphere within the cylinders, it is to be removed from the total volume of the sphere, which is $ \  \frac{4 \pi}{3} a^3 \ $ .  Hence, the volume of region B is 
$$ V_B \ = \ \frac{16}{9} a^3  \ \ .  $$
</s>