# Conceptual problem with incorporating constraints to a particular variational principle problem

Consider the following problem:

A vector field $$\boldsymbol{F}(x)$$ is defined over a finite region $$V$$. A functional of the form $$$$U = \int_V u(\boldsymbol{F})\ d^3x$$$$ is to undergo the variation with respect to both $$x$$ and $$\boldsymbol{F}$$ but with the constraint that the divergence of the vector field be a particular function, e.g. $$$$\text{div} \boldsymbol{F}(x) \equiv F_{i,i}(x) = f(x).$$$$

My attempt is to introduce a Lagrange multiplier, say $$\psi(x)$$, and have the variation be of the form $$$$\delta \{U - \int_V \psi(x) f(x) d^3x\} =0 \ \ \ \Rightarrow \ \ \ \delta U - \int_V\psi\delta (fd^3x) = \delta U - \int_V \psi \delta f (1 + \delta x_{k,k})d^3x = 0$$$$ where $$(1+\delta x_{k,k})$$ is the jacobian of the infinitesimal deformation. Doing so, one has $$$$\delta U - \int_V\psi \delta (F_{i,i})(1+ \delta x_{k,k})d^3x =0$$$$

BUT my instructor suggests instead to write $$$$\delta U - \int_{V'} \psi \ \text{div}(\delta \boldsymbol{F}) d^3x =0$$$$ where $$V'$$ is the virtually deformed region of $$V$$.

I can't see why this is the case. I don't see them as equal, because I don't reckon $$\delta$$ and div commute in this case, unless $$\delta \boldsymbol{F}$$ in the latter excludes the convective term $$\delta x \cdot \text{grad} \boldsymbol{F}$$. The same question could be relevant to a curl problem. I mean, where a vector field's curl is regarded as a constraint.