Variational formulation.