So for a while now I've been trying to understand something I've read in a paper, but can't get the prove it strictly. Let $f : \mathbb{R}^2 \to \mathbb{R}$ be a smooth function such that $\int f(x,\theta) f(x,\theta) d x = 1$. Let the arguments be denoted as $x$ and $\theta$. The given a symmetric derivative operator $H$ defined only on the first argument $x$, the Rayleigh–Ritz potential is defined as: $$ E(\theta) = \frac{\int f(x,\theta) H(f)(x, \theta) dx}{\int f(x,\theta) f(x,\theta) d x} = \int f(x,\theta) H(f)(x, \theta) dx$$ Now the paper states the following: $$ \nabla_\theta(E) (\theta) = 2 \int \nabla_\theta(f)(x,\theta) H(f)(x, \theta) dx $$ To me this is not obvious why its true. Specifically consider when $H=\nabla_x^2$ then we have: $$ \nabla_\theta(E) (\theta) = \int \nabla_\theta(f)(x,\theta) H(f)(x, \theta) dx + \int f(x,\theta) \nabla_\theta \nabla^2_x(f)(x, \theta) dx $$ Which implies that the following equality always holds: $$ \int f(x,\theta) \nabla_\theta \nabla^2_x(f)(x, \theta) dx = \int \nabla_\theta(f)(x,\theta) \nabla_{x^2}(f)(x, \theta) dx $$
It seems that one can move around the argument of the operator? I've tried when using a simple function, for which the integral is analytic and it seems to hold, but can't derive that it is true in general. Any points towards how to prove it?