The bound-state solution of wave equations for real or complex eigenvalues