We use a Green's-function technique to calculate the position of deep defects in narrow-gap semiconductors. In order to predict chemical trends, we examine the effects of several different chemical elements. Substitutional (including antisite), (ideal) vacancy, and interstitial (self and foreign) deep defects are considered. The compounds considered are mercury cadmium telluride (MCT), mercury zinc telluride (MZT), and mercury zinc selenide (MZS). The effect of relaxation of neighbors is considered for the substitutional and interstitial cases. Relaxation effects can be greater for the interstitial case than for the substitutional one. For all cases we find deep defects in the energy gap only for cation-site s-like orbitals or anion-site p-like orbitals, and for the substitutional case only the latter are appreciably effected by relaxation. For substitutional impurities in MCT, MZT, and MZS, we consider x (the concentration of Cd or Zn) in the range 0.1x0.3 and also for both the substitutional and interstitial cases we do extensive calculations for x values appropriate to a band gap of 0.1 eV. Specific results are given in figures and tables and comparison to experiment and other calculations is made in a limited number of cases. For the substitutional case we find that I, Se, S, Rn, and N are possible defect candidates to form cation-site, s-like levels in MCT, and Zn and Mg are for anion-site, p-like levels.Similarly, in MCT for the interstitial case we find deep defect levels in the band gap for Au, Ag, Hg, Cd, Cu, and Zn for the cation site, and N, Ar, O, and F for the anion site. For the substitutional cases we have some examples where relaxation moves the levels into the band gap, whereas for interstitial cases we have examples where relaxation moves them out of the band gap. We find that the chemical trends of defect levels in MZT are similar to that in MCT. However, the same conclusion does not hold for MZS. We have also used perturbation theory (see the Appendix) to look at the effect of nonparabolicity on shallow donor levels, and find it can increase the binding by 10% or so. Although the absolute accuracy of our results is limited, the precision is good, and hence chemical trends are accurately predicted. Further work involves calculating the effect of charged-state interactions and the effect of relaxation on vacancy levels.