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 ded...