In this work, a variational method is used to examine the problems relevant to the free polaron energy spectrum in a wurtzite Al[Formula: see text]Ga[Formula: see text]N/Al[Formula: see text]Ga[Formula: see text]N triangle quantum well structure. The numerical calculations for the ground state energy, transition energy and polaron energy shifts as the functions of well-width [Formula: see text] and composition [Formula: see text] are carried out by considering the anisotropies of the parameters, such as the optical phonon frequency, dielectric constant and electron effective mass, as well as their observed changes with coordinate [Formula: see text] in this system. The research results show that the polaron energy shift caused by the electron–optical phonon interaction is large, and leads to an obvious energy decrease in the Al[Formula: see text]Ga[Formula: see text]N/Al[Formula: see text]Ga[Formula: see text]N triangular quantum well structure. The contribution of the confined phonon is found to increase with the increasing of the well-width and composition [Formula: see text], while that of the half space phonon is observed to decrease with the increasing of the well-width and composition [Formula: see text]. The total contribution of the phonon increases with the increasing composition [Formula: see text], while a minimum is found to occur to the total contribution of the phonon during the decreasing process with the well-width. As the [Formula: see text] increases, the free polaron energies and transition energies decrease. Meanwhile, with the increasing of the composition [Formula: see text], the energy and transition energy are found to be increased. In the Al[Formula: see text]Ga[Formula: see text]N/Al[Formula: see text]Ga[Formula: see text]N triangular quantum well structure, the trends of the free polaron energy, transition energy and polaron energy shifts with the well-width and composition [Formula: see text] are found to be similar to those in the GaN/Al[Formula: see text]Ga[Formula: see text]N square quantum well structure. However, the corresponding values in the triangular quantum well structure are obviously greater than those in the square quantum well structure.