<s>[INST] Moment of inertia of sphere of changing density I need to calculate moment of inertia of a sphere. The density of sphere changing $\rho=cz^2$ All the three components $I_x,~I_y,~I_z~.$
I did the assumption $dm=\rho dV$ then I found $c$ as $=\frac{15m}{4\pi r^5}~.$ Then called
$$I=\int\rho dv z^2=c\int r^4 \cos^4\theta r^2 \sin\theta dr d\theta d\phi=c\int r^6 dr \int \cos^4\theta \sin\theta d\theta \int d\phi $$
Finally I found the $I=\frac{3}{7}\frac{R^7}{r^5}$
But I guess it's for $I_z$. How can I calculate $I_x=I_y$
 [/INST] $I_x = \int dm \ (y^2+z^2), I_y = \int dm \ (x^2+z^2), I_z = \int dm \ (x^2+y^2)$
As $\rho = cz^2, dm = \rho dV = cz^2 dV$
Using cylindrical coordinates,
$x^2+y^2 = r^2, r^2 + z^2 = R^2 \ $ where $R$ is the radius of the sphere.
$dm = \rho dV = c z^2 \ r \ dr \ dz \ d\theta \ $
$\displaystyle I_z = c \int_0^{2\pi} \int_{-R}^{R} \int_0^{\sqrt{R^2-z^2}} z^2 r^3 \ dr \ dz \ d\theta = \frac{8 \pi c R^7}{105}$
Please note that density is only a function of $z$, so $I_x$ and $I_y$ will be equal due to symmetry of sphere.
That leads to $\displaystyle I_x = I_y = \frac{I_x + I_y}{2} = \frac{c}{2} \int_0^{2\pi} \int_{-R}^{R} \int_0^{\sqrt{R^2-z^2}} z^2 (r^2+2z^2) \ r \ dr \ dz \ d\theta$
$\displaystyle  = \frac{I_z}{2} + c \int_0^{2\pi} \int_{-R}^{R} \int_0^{\sqrt{R^2-z^2}} z^4 \ r \ dr \ dz \ d\theta$
I will leave the integral for you to complete.
Lastly,
$m = c \displaystyle \int_0^{2\pi} \int_{-R}^{R} \int_0^{\sqrt{R^2-z^2}} z^2 \ r \ dr \ dz \ d\theta$
Once you find $m$, you can also write moment of inertia in terms of $m, R$.
</s>