Moment of inertia of a hollow sphere is (2/3)mr²
Consider a thin shell of width dr at radius r from the center of the sphere.
Mass of the thin shell is ρ(r)4πr²dr
IA = ∫₀ᴿ (2/3)ρA(r)4πr²dr)r² = (2/3)(∫₀ᴿ (k(r/R))4πr²dr)r² = (2/3)4πk/R(∫₀ᴿ r³dr) = (2/3)4πk/R[r⁴/4]₀ᴿ = (2/3)4πkR³/4 = (2/3)πkR³
IA = (2/3)(∫₀ᴿ (k(r/R))4πr²dr)r² = (2/3)4πk/R ∫₀ᴿ r³dr = (2/3)4πk/R (R⁴/4) = (2/3)πkR³
IB = ∫₀ᴿ (2/3)ρB(r)4πr²dr)r² = (2/3)(∫₀ᴿ (k(r⁵/R⁵))4πr²dr)r² = (2/3)4πk/R⁵(∫₀ᴿ r⁷dr) = (2/3)4πk/R⁵[r⁸/8]₀ᴿ = (2/3)4πkR³/8 = (1/3)πkR³
IB = (2/3)(∫₀ᴿ (k(r⁵/R⁵))4πr²dr)r² = (2/3)4πk/R⁵ ∫₀ᴿ r⁷dr = (2/3)4πk/R⁵ (R⁸/8) = (1/3)πkR³
∴ IB/IA = ((1/3)πkR³)/((2/3)πkR³) = 1/2
IB/IA = n/10
1/2 = n/10
n = 5
Let's reconsider the moment of inertia calculation.
IA = ∫₀ᴿ (2/3)(k(r/R))4πr²(r²)dr = (8πk/3R) ∫₀ᴿ r⁵dr = (8πk/3R) (R⁶/6) = (4πkR⁵)/9
IB = ∫₀ᴿ (2/3)(k(r⁵/R⁵))4πr²(r²)dr = (8πk/3R⁵) ∫₀ᴿ r⁹dr = (8πk/3R⁵) (R¹⁰/10) = (4πkR⁵)/15
IB/IA = [(4πkR⁵)/15]/[(4πkR⁵)/9] = 9/15 = 3/5
IB/IA = n/10
3/5 = n/10
n = 6