Calculating the volume of the solid defined by $x^2+y^2+z^2 \leq 2a^2$ and $z \leq \frac{x^2+y^2}{a}$, with $a>0$ 
I have to calculate the volume of solid geometry for $a>0$
$$T=\{(x,y,z)\in \mathbb{R}; x^2+y^2+z^2 \leq 2a^2; z \leq \frac{x^2+y^2}{a}\}$$

I know that first formula is inside of sphere with radium $\sqrt2a$. So I have to use triple integral to calculate this. I use cylindric coordinates $$x = rcos\phi, y=rsin\phi, z = z$$
I tried to calculate like this $$\int_{0}^{2\pi}d\phi \int_{0}^{a} dr \int_{\sqrt{2a^2-r^2}}^{\frac{r^2}{a}}r\,dz $$
but I do not know if is right.
 A: Two mistakes -
i) The lower bound of $z$ should be $~ - \sqrt{2a^2-r^2}$
ii) There is volume bound for $r \geq a$ too. For $a \leq r \leq a\sqrt2,  ~z$ is bound between lower and upper half of the sphere.
So the integral will be,
$ \displaystyle \int_{0}^{2\pi} \int_{0}^{a} \int_{-\sqrt{2a^2-r^2}}^{\frac{r^2}{a}} dz ~ dr ~ d\phi ~ + $
$ \displaystyle \int_{0}^{2\pi} \int_{a}^{a \sqrt2} \int_{-\sqrt{2a^2-r^2}}^{\sqrt{2a^2-r^2}} r ~ dz ~ dr ~ d\phi ~ $
The other and a bit simpler approach is to integrate with respect to $dr$ first. Note that for $z \lt 0$, it is simply volume of the half sphere of volume $a \sqrt2$, which is $ \displaystyle \frac{4 \sqrt2 \pi a^3}{3}$.
For $z \geq 0$, $r$ is bound below by the paraboloid and above by the sphere. The upper bound of $z$ is the intersection of both surfaces which is $z = a$. So the integral is,
$ \displaystyle \int_{0}^{2\pi} \int_{0}^{a}  \int_{\sqrt{az}}^{\sqrt{2a^2 - z^2}} r ~ dr ~ dz ~ d\phi$
The answer comes to $\displaystyle \frac{4 \sqrt2 \pi a^3}{3} + \frac{7 \pi a^3}{6}$
A: Using cylindrical coordiantes, you have two surfaces:
Surface 1:  $r^2 + z^2 = 2 a^2$
Surface 2:  $ z = r^2 / a $
We want to find where these two surfaces intersect.  Plugging the second equation into the first,
$ r^2 + r^4 / a^2 = 2 a^2 $
whose solution is by inspection, $r = a$
So, now if $ r \le a $ then $ r^2 / a \le \sqrt{ 2 a^2 - r^2 } $ and vice versa.
The volume is computed by taking all the range of $r \in [0, \sqrt{2} a ] $ and segmenting the integral to take the two cases
$V = \displaystyle \int_{\phi = 0}^{2 \pi} \left( \int_{r = 0 }^{a} \int_{z= -\sqrt{2 a^2 - r^2}}^{r^2 / a} dz r dr + \int_{r = a }^{\sqrt{2} a} \int_{z= -\sqrt{2 a^2 - r^2}}^{\sqrt{2 - r^2}} dz r dr \right) d\phi $
Integrating with respect to $\phi$ and $z$, the above simplifies to
$V = \displaystyle 2 \pi \left( \int_{0}^{a} \left( r^2/a + \sqrt{2a^2 - r^2} \right) r dr + \int_{a}^{\sqrt{2}a} 2 \sqrt{2 a^2 - r^2} r dr \right) $
And this integrates to
$V = \displaystyle 2 \pi \left( a^3 / 4 + \frac{1}{3} ( 2^\frac{3}{2} - 1) a^3 + \frac{1}{3} ( 2 a^3 ) \right) $
Which reduces to
$V = \displaystyle 2 \pi a^3 \left( \dfrac{7}{12} + \dfrac{ 2^\frac{3}{2} }{3} \right)$
