In this article we show that the inhomogeneous density obtained from a density-functional theory of classical fluids in the canonical ensemble (CE), recently presented by White et al [Phys. Rev. Lett. 84, 1220(2000], is equivalent to first order to the result of the series expansion of the CE inhomogeneous density introduced by González et al [Phys. Rev. Lett. 79, 2466(1997]. PACS number(s) 61.20.Gy, A statistical mechanics ensemble is a collection of identical systems under the same external conditions. Although the choice of a particular ensemble for studying a concrete system should be guided by the conditions in which the system is found, one can choose -due to mathematical or computational convenience-any ensemble for analyzing the equilibrium properties of the system. This way of proceeding, based on the equivalence of the ensembles in the thermodynamic limit, is only justified for systems with a very large number of particles. For small systems, however, the ensembles are no longer equivalent and the external conditions must determine the choice of ensemble.In this context, the use of density-functional theory (DFT) for the study of classical inhomogeneous fluids has been usually limited to the grand canonical ensemble (GCE), where the temperature T and the chemical potential µ are fixed by an external reservoir. A large variety of inhomogeneous situations has been successfully studied by means of DFT in the GCE [1][2][3]. These situations include fluids confined in narrow pores or capillaries [4], or even spherical cavities [5][6][7], which are implicitly assumed to be open, i.e., allowing exchange of particles with a reservoir. This assumption is crucial for situations with a small number of particles where, depending on the choice of ensemble, important differences may arise in the equilibrium microscopic structure of the system [7,8]. If one wishes to investigate the properties of a small closed system at temperature T , the study must be performed in such a way that one obtains results in the canonical ensemble (CE) because the number of particles N is fixed. In DFT this goal can be achieved by means of two different approaches. On one hand the DFT could be formulated in the canonical ensemble [9], with a minimum free-energy principle with fixed T and N , and an appropriate CE functional. Very recently, this approach has been explicitly realized [10] by considering an approximate expression for the CE functional. On the other hand, one can perform a conventional DFT study in the GCE and then relate the obtained properties to those of the CE. This approach was followed in Refs. [7,8] where the CE density profile of a hard-sphere fluid in a small spherical cavity was calculated by means of a series expansion in terms of the corresponding GCE profile. The aim of the present paper is to show that these two approaches yield equivalent results to order 1/N . For clarity we start with a brief summary of the main results of the two approaches.The first approach is based on the following series expansion of ...