We consider a waveguide having the constant cross-section S with ideally conducting walls. We assume that the filling of waveguide does not change along its axis and is described by the piecewise continuous functions ε and η defined on the waveguide cross section. We show that it is possible to make a substitution, which allows dealing only with continuous functions. Instead of discontinuous cross components of the electromagnetic field E and H we propose to use four potentials. Generalizing the Tikhonov-Samarskii theorem, we have proved that any field in the waveguide allows such representation, if we consider the potentials as elements of respective Sobolev spaces. If ε and η are piecewise constant functions, then in terms of four potentials the Maxwell equations are reduced to a pair of independent equations. This fact means that a few dielectric waveguides placed between ideally conducting walls can be described by a scalar boundary problem. This statement offers a new approach to the investigation of spectral properties of waveguides. First, we can prove the completeness of the system of the normal waves in closed waveguides using standard functional spaces. Second, we can propose a new technique for calculating the normal waves using standard finite elements. Results of the numerical experiments using FEA software FreeFem++ are presented. © Springer Nature Switzerland AG 2019.