The paper presents the technique of calculation of the stability of plane bending of glulam beams with a variable section. The solution was made with numerical and analytical means using the Bubnov-Galerkin method. The problem was reduced to a generalized secular equation. The calculations were made in the software package Matlab. The influence of variable rigidity on the critical load was investigated on the example of gable beams loaded by a concentrated force. We compared results with the formulas given in the design standards of wooden structures, as well as the results of A.A. Zhuravlev. It was found that the design standards give very low values of the reducing coefficient which leads to a waste of material. A refined calculation formula in the form of a polynomial with variable coefficients was proposed.