The aim of this paper is to discover some new exact solutions for two kinds of nonlinear Schrödinger equation (NLSE), including the (2+1)-dimensional NLSE and the derivative NLSE, through the use of the variational principle method and amplitude ansatz method. We will find the solutions to these equations by selecting a trial function with a single nontrivial variational parameter, and it is continuous at all intervals in three cases from a region of a rectangular box, then using this trial function to obtain the functional integral and the Lagrangian of the system without any loss. After that, we approximate this trial function by quadratic polynomials with two free parameters rather than a piecewise linear ansatz function. Similarly, this trial function will be approximated by the tanh function. Additionally, we accept several new types of soliton solutions, including bright solitons, dark solitons, bright–dark solitary wave solutions, rational dark–bright solutions, and periodic solitary wave solutions. Also, conditions for the stability of the solutions will be proposed. These explanations are of great importance in the fields of applied science and engineering. The results will be shown through different types of graphs, including 2D, 3D, and contour plots.