The electron subband structure in the triangular potential well of a selectively doped n-Al
xGa
1-xAs/GaAs heterostructure is calculated by a new analytical method. The GaAs conduction band edge is approximated by a polygonal curve and the electron de Broglie wavelength is matched to the width of the triangular quantum well. The band bending due to ionized donor impurities, free electrons in the potential well, and residual acceptors in the p
-GaAs buffer layer are taken into account. The electron subband structure is determined for background accepter concentrations of

cm
-3 
cm
-3in the p
-GaAs layer and for two-dimensional carrier concentrations in the potential well ranging from 5 × 10
10cm
-2to 2 × 10
12cm
-2, and the electron concentrations in the first three subbands are presented. The first excited subband is populated at two-dimensional carrier concentrations of

to

cm
-2depending on the background impurity concentration in the p
-GaAs layer. The real-space widths of electron subbands range from 6 to 20 nm. The accuracy of our method for calculation of subband structures is favorable for quantitative device design.