We investigate solutions to the Tolman-Oppenheimer-Volkoff equations and their implications, deriving an equation of state for the star’s surface as a function of two geometric parameters, λ(r) and ν(r). We find that the parameter λ(r) is essential for explaining fluctuations in the baryon number density and baryonic chemical potential within and outside a neutron star, enabling simulations of regions with varying neutron matter densities. We also highlight the significant role of the ν(r) parameter in illustrating the transition from a neutron star to a black hole, establishing a direct connection between the neutron star’s radius and the event horizon’s radius. The parameter λ(r) is crucial for understanding how the baryon number density and baryonic chemical potential fluctuate inside and outside a neutron star. The core is characterized by λ > 0, and the outer crust is defined by λ < 0. Finally, by analyzing the polytropic equation of state, we find that the neutron stars are composed of two distinct regions: a low-density outer crust and a very high-density core, separated by a sharp boundary. The mixing region between the two layers is known as the inner crust and outer core.