  The first law of black hole mechanics is derived from the Einstein-Maxwell
(EM) Lagrangian by comparing two infinitesimally nearby stationary black holes.
With similar arguments, the first law of black hole mechanics in
Einstein-Yang-Mills (EYM) theory is also derived.
