Density is defined as its mass divided by its volume. In the same way density of nucleus is defined as the ratio of mass of nucleus to its spherical volume. The mass of nucleus is equal to number of nucleons in nucleus (A) and the mass of single nucleon (m). Since mass of neutron and proton are same.
M = A m.
Nucleus is spherical in shape with radius r. So volume of nucleus (V) = 4/3(Π r3).
So Formula of density of a nucleus.
Where A = number of nucleons in nucleus
m = mass of single nucleon
r = Radius of nucleus.