When using direct methods of variational calculation for the approximate solution of differential equations in partial derivatives, with the help of which many physical processes are described, the determination of the Lagrange function presents a serious difficulty. The article considers the possibility of direct production of the Lagrange function from the equality of the process, when the variational principle with the vanishing parameter of B. Vujanovic is used for the approximate solution of the process equations. With the help of four illustrative examples, a way to use this example is found.