Researchers usually neglect the electron–electron interaction effect when they study the optical properties of semiconducting nanostructures through the compact density matrix approach. In the existing papers, this work has also been done through self-consistent solution of the Schrödinger and Poisson equations. For the first time, we have investigated the electronic and optical properties of wurtzite GaN/AlN quantum wells in the presence of electron–electron interactions assuming weak electron–electron scattering through a numerical solution of a nonlinear Schrödinger equation. It is shown that the electron–electron interaction effect leads to the removal of the N-fold degeneracy in the energy levels of N-well multiple quantum well systems. Effects of different parameters such as electric field, the strength of the electron–electron interaction, a total length of the system and also two different numbers of wells (1 and 2) on the mentioned optical properties have been investigated. Also, we observed redshifts in the optical rectification coefficient peak positions when the nonlinear parameter increased. Finite difference self-consistent method was employed to solve the nonlinear Schrödinger equation and we demonstrated the method convergence. Finally, we illustrated the accuracy of the method by comparing our energy values with those of the Sinc method.