The aim of the work is the development of numerical methods for solving waveguiding problems of the theory of waveguides, as well as their implementation in the form of software packages focused on a wide range of practical problems from the classical issues of microwave transmission to the design of optical waveguides and sensors. At the same time, we strive for ease of implementation of the developed methods in computer algebra systems (Maple, Sage) or in software oriented to the finite element method (FreeFem++). The work uses the representation of electromagnetic fields in a waveguide using four potentials. These potentials do not reduce the number of sought functions, but even in the case when the dielectric permittivity and magnetic permeability are described by discontinuous functions, they turn out to be quite smooth functions. A simple check of the operability of programs by calculating the normal modes of a hollow waveguide is made. It is shown that the relative error in the calculation of the first 10 normal modes does not exceed 4%. These results indicate the efficiency of the method proposed in this article.