In this paper we discuss the solutions of the cubic nonlinear Schrödinger equation with variable coefficients that model a trapped, quasi-one-dimensional Bose–Einstein condensate with time-varying potential and time-varying atomic scattering length. By applying the theory of Jacobian elliptic functions, we propose a new ansatz to find two new families of solutions. We also obtained regions in the parameters space in which the found families of solutions exist.