The nonlinear Schr¨odinger(NLS) equation represents a nonlinear dynamical system, which is usu-
ally used to describe nonlinear waves in deep water, self-focusing of intense lasers contained in elec-
trolytes, and so on. The exact solutions of the variable coefficient nonlinear Schr¨odinger equation with
external potential are considered. The variable coefficient nonlinear Schr¨odinger equation is trans-
formed into a constant coefficient nonlinear equation by using the similarity transformation method,
the exact solutions of the constant coefficient nonlinear equation are generated by using the homoge-
neous balance method. We obtain one-soliton, two-soliton, kink type soliton, bright soliton, parabolic
soliton and rogue wave solutions. A “stepped” type soliton solution is obtained in this paper, which
is a novel type solution and different from the solutions of most nonlinear Schr¨odinger equations.
Some special dynamic behaviors of solitons of the variable coefficient nonlinear Schr¨odinger equation
with external potential are obtained via selecting some free functions. We found that the numerical
simulation result is consistent with the exact solution through illustrating the time evolution of bright
soliton solution.