Lagrange multipliers can be used to find the extreme of a multivariate function 
      
      subject to the constraint 
      
     
Where, 
      
      and 
      
      are functions with continuous first partial derivatives on the open
    set containing the constraint curve, and 
      
      at any point on the curve (where 
      
      is the gradient).
To find the extreme, write:
(1)
     
     
      
     
     
But, because 
      
      is being held constant, it is also true that
(2)
     
     
      
     
     
So multiply 
Equation 2 by the as yet undetermined
    parameter 
          
         and add to 
Equation 2,
(3)
     
     
      
     
     
Note that the differentials are all independent, so any combination of
    them can be set equal to 0 and the remainder must still give zero. This requires
     that:
(4)
     
     
      
     
     
for all k = 1, ..., n, and the constant 
          
        
     is called the Lagrange multiplier. For multiple constraints, 
      
     
    , 
      
     
     , ...,
(5)
     
     
      
     
     
The Lagrange multiplier method can be applied to contact-impact
    problems. In this case, the multivariate function is the expression of total energy subjected to
    the contact conditions:
(6)
     
     
      
     
    (7)
     
     
      
     
     
Where, 
      
     
     are the global vectors of DOF. The application of Lagrange multiplier method
    to the previous equations gives the weak form as:
(8)
     
     
      
     
     
This leads to:
(10)
     
     
      
     
     
The Lagrange multipliers are physically interpreted as surface
    tractions. The equivalence of the modified virtual power principle with the momentum equation,
    the traction boundary conditions and the contact conditions (impenetrability and surface
    tractions) can be easily demonstrated. 1
It is emphasized that the above weak form is
    an inequality. In the discretized form, the Lagrange multiplier fields will be discretized and
    the restriction of the normal surface traction to be compressive will result from constraints on
    the trial set of Lagrange multipliers.