We present a study of the complex absorbing potential (CAP) method to solve resonance states in a nuclear physics problem. Compared to atomic physics cases, nuclear potentials have a short-range property, and the resonances generally have large decay widths. We find that an appropriate functional form of the CAP method is necessary for an accurate calculation. The functional form dependence of the CAP method and the convergence of the resonance eigenvalues are investigated in a two-body system. We also apply the CAP method to examine a three-body system. Our results are in good agreement with others in the literature.