In this paper, a systematic derivation of the tunneling matrix elements in three-dimensional space is presented. Based on a modified Bardeen tunneling theory, explicit expressions for the tunneling matrix elements for localized tip states are derived with use of the Greens-function method. It is shown that by expanding the vacuum tail of the tip wave function in terms of spherical harmonics, the tunneling matrix elements are related to the derivatives of the sample wave functions at the nucleus of the apex atom (taken as the center of the spherical-harmonics expansion), in a simple and straightforward way. In addition, an independent derivation based on a general sum rule is also presented, which is valid in a number of curvilinear coordinate systems. In spherical coordinates, a general form of the derivative rule follows. In parabolic coordinates, similar results are obtained. Physical meanings of these matrix elements, as well as their implications to the imaging mechanism of scanning-tunneling microscopy, are discussed. © 1990 The American Physical Society.