Dielectric rib waveguide, being a key transmission medium in millimetrics and integrated optics, has been the object of extensive investigation. Although various approximate analyses of the EDC type exist, these break down for many practical configurations. More complete transverse resonance formulations also exist, but if accuracy is required, they involve mode matching, with a partially discrete, partially continuous spectrum. Whereas finite difference (finite element) numerical solutions are accurate, they are also expensive and their extension to more complex structures is correspondingly difficult. In this contribution, we focus on the pure LSE/LSM cases. We derive a highly accurate transverse resonance diffraction variational solution of the problem, of order 1 (a scalar dispersion equation), by assuming at the transverse step discontinuity a single function "trial field" which incorporates the physical properties of the solution. This is, in fact, the surface wave mode of a slab waveguide of height intermediate between that of the rib and that of the cladding slab, including dielectric edge singularities in the LSM case. The height of the "intermediate guide" is obtained by optimizing the overlapping integral with the slab mode in the rib and in the cladding. This criterion turns out to be equivalent to choosing an intermediate guide whose EDC is the geometric mean of those of the rib and cladding. Numerical results are in excellent agreement with those obtained by finite difference, even at cutoff, where the EDC fails and most methods tend to overestimate the value of beta.