In general, for functions and
(where is an Inner Product Space over )
we define the Lagrangian as:

When the inner product is a dot product and this is just: