An astute reader will note the remarkable similarity with the derivation of the Euler-Lagrange equation. We can thus take our "Lagrangian" for this case to be: