In this paper, an analytical solution to the problem of the interaction of a pile-slab foundation with a 2-layer elastic soil basement is proposed. A new method was proposed to take into account the nonlinearity of soils in an elastic formulation. This method consists in limiting the bearing capacity of the pile along the lateral surface by the strength of the adjacent soil and redistributing the applied load to the pile toe. In the article, a comparative analysis of the proposed analytical solution of the problem in the elastic formulation with numerical simulation in the elastic-plastic formulation is carried out and the scope of the proposed analytical solution, which taking into account the described mechanism of the nonlinearity of the soil, is investigated. Numerical simulation was carried out in the geotechnical software package Plaxis 2D. According to the results of analytical and numerical calculations, the graphs of the dependence of settlement on loads were constructed for various values of soil strength. The graphs showed significant differences in the rate of development of plastic zones of soil deformation obtained by analytical and numerical methods.