In this study, we investigated, for the first time, the effects of the spatially varying effective mass, asymmetry parameter, and well width on the electronic and optical properties of a quantum well which has an improved Rosen–Morse potential. Calculations were made within the framework of the effective mass and parabolic band approximations. We have used the diagonalization method by choosing a wave function based on the trigonometric orthonormal functions to find eigenvalues and eigenfunctions of the electron confined within the improved Rosen–Morse potential. Our results show that the position dependence mass, asymmetry, and confinement parameters cause significant changes in the electronic and optical properties of the structure we focus on since these effects create a significant increase in electron energies and a blue shift in the absorption spectrum. The increase in energy levels enables the development of optoelectronic devices that can operate at wider wavelengths and absorb higher-energy photons. Through an appropriate choice of parameters, the Rosen–Morse potential offers, among many advantages, the possibility of simulating heterostructures close to surfaces exposed to air or vacuum, thus giving the possibility of substantially enriching the allowed optical transitions given the breaking of the system´s symmetries. Similarly, the one-dimensional Rosen–Morse potential model proposed here can be extended to one- and zero-dimensional structures such as core/shell quantum well wires and quantum dots. This offers potential advancements in fields such as optical communication, imaging technology, and solar cells.