Application of the Rayleigh-Schmidt method when the boundary conditions contain the eigenvalues of the problem