The problem of obtaining a final expression for a function initially given in the form of a trigonometric Fourier series is considered. We consider a special case of a series when the coefficients of the series are known and are rational functions of the harmonic number. To obtain the final expression, we propose to formulate a differential equation with constant coefficients for the function. A special feature of the proposed approach is the consideration of non-homogeneous equations, with the sum of the divergent Fourier series as the non-homogeneity. In this way, it is possible to compose expressions for the desired functions in the form of quadratures and formulate sufficient conditions for the representability of the desired function in the form of piecewise Liouville elementary functions. In this case, it becomes possible to describe in the language of distribution theory a class of Fourier series that can be summed in a finite form using the method of A. N. Krylov. © 2025 by the authors.