Depth dependence of sound speed is integral to the study of most phenomena pertaining to waveguide propagation in ocean acoustics. The normal mode method has widely been used to study depth dependent acoustic waveguides. The depth eigenproblem associated with the normal mode approach could be solved exactly only for a few cases. The well-known KRAKEN code employs a finite difference model for discretizing depth eigenproblem and the resulting algebraic eigenproblem has been solved to a high degree of precision using iterative techniques. Depth eigensolution is also useful in setting up finite element models for range and depth dependent waveguides. The main thrust of the present paper is to explore a Rayleigh-Ritz (RR) model for the solution of the depth eigenproblem with specific reference to Pekeris waveguides. The depth eigenproblem for a heterogeneous two layer fluid waveguide is cast in a variational form and an approximate solution obtained using the classical RR method, in which the exact eigenmodes of isovelocity waveguides are used as trial functions. The formulation is such that the bottom layer could have infinite depth, thus representing a heterogeneous Pekeris waveguide. The resulting algebraic eigenproblem, which has been solved using a MATLAB code, remains linear unlike in the traditional finite difference model for water column overlying a fluid halfspace. The accuracy of the RR approximation has been demonstrated by applying the numerical model to several examples of shallow water waveguides as well as a deepwater waveguide having different depth dependent sound speed profiles, for low to moderate frequencies. In particular, two Pekeris waveguide examples, one with heterogeneity and the other with attenuation in the halfspace have been considered. The numerical exercise demonstrates that accurate radial wavenumbers and depth modes can be obtained using RR model with the number of trial modes equal to twice the number of propagating modes. Admittedly, the computational effort required to set up the algebraic eigenproblem would be high compared to that required to set up a finite difference model. The strength of the proposed RR model is that it can easily tackle heterogeneity in the halfspace in a Pekeris waveguide. The eigenmodes obtained are in a form involving a linear combination of the isovelocity modes. The RR model has the potential to solve waveguides with three or more layers. © S. Hirzel Verlag · EAA.