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.

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)$
