Thin-film optical waveguides have been analyzed by several approximate and numerical methods. However, one cannot always expect these methods to give accurate results of analysis near the cutoff frequency. We have proposed a new numerical method, the ‘mode-matching method,’ for calculating the properties of the thin-film waveguide. Using this method, we can show results of precise analyses on the rib-type waveguide and directional coupler. On the diffraction problem for a bounded object, the mode-matching method is based on the Rayleigh principle for the modal expansion of a wave field: The infinite sum in modal expansion can be available beyond its convergence area. We have always a truncated modal expansion which precisely approximates the wave field in the whole domain under consideration. If we note the correspondence between the Fourier integral representation of the field and the infinite sum of modal expansion, the application of the principle can be extended to the problem for an unbounded object such as the thin-film waveguide: The wave field can be approximated by the finite Fourier integral, the superposition of plane waves with a band-limited spatial spectrum. The rib-type waveguide is considered, which is constructed by the air, film, and substrate media. Each wave field is approximated by the finite Fourier integral, and its spatial spectrum is determined by the mode-matching technique. Let us fit the approximate fields to the boundary conditions in the sense of least squares; then we have the Fredholm integral equations, with respect to the spatial spectra, to be solved numerically. The dispersion relations near the cutoff frequency and the field distributions of the waveguide are analyzed precisely. The characteristics of the directional coupler are also made clear when the distance between two parallel rib waveguides is altered.