We generally study the density of eigenvalues in unitary ensembles of random matrices from the recurrence coefficients with regularly varying conditions for the orthogonal polynomials. First we calculate directly the moments of the density. Then, by studying some deformation of the moments, we get a family of differential equations of first order which the densities satisfy (see Theorem 1.2), and give the densities by solving them. Further, we prove that the density is invariant after the polynomial perturbation of the weight function (see Theorem 1.5).