  Starting from the 3D Gross-Pitaevskii equation and using a variational
approach, we derive an effective 1D wave-equation that describes the axial
dynamics of a Bose condensate confined in an external potential with
cylindrical symmetry. The trapping potential is harmonic in the transverse
direction and generic in the axial one. Our equation, that is a time-dependent
non-polynomial nonlinear Schr\"odinger equation (1D NPSE), can be used to model
cigar-shaped condensates, whose dynamics is essentially 1D. We show that 1D
NPSE gives much more accurate results than all other effective equations
recently proposed. By using 1D NPSE we find analytical solutions for bright and
dark solitons, which generalize the ones known in the literature. We deduce
also an effective 2D non-polynomial Schr\"odinger equation (2D NPSE) that
models disc-shaped Bose condensates confined in an external trap that is
harmonic along the axial direction and generic in the transverse direction. In
the limiting cases of weak and strong interaction, our approach gives rise to
Schr\"odinger-like equations with different polynomial nonlinearities.
