We present the results of a variational calculation of the ground stat
e energy of a (D+,X) complex in a quantum well with finite potential b
arriers as a function of the depth and the width of the well as well a
s the ratio sigma of the electron and hole effective masses. We use th
e envelope function approximation. We apply our results to the system
GaAs/Ga1-xAlxAs with x = 0.15 and x = 0.30. It appears that the coulom
bic correlation energy goes through a minimum for a well thickness in
the order of 50 Angstroms. This minimum is comprized between the value
s obtained in the 2D and 3D limit cases. Furthermore, it appears that
only the heavy hole states give rise to a stable binding energy for al
l values of the well thickness. The light hole states give rise to sta
ble binding only in the case of large thicknesses.