Formalization of the Gateaux derivative of functional and application in the principle of virtual work