I try to rephrase here a my question (https://math.stackexchange.com/q/4661784/), explaining more specifically the case.
Given a lagrangian $L=L(\theta_{\mu\nu},\phi)$ , the conserved Noether current is \begin{equation}\tag{1} j_{\beta}^{\alpha} \doteq - \dfrac{\partial L^{(2)}}{\partial (\partial_{\alpha}\theta_{\mu\nu})}\partial_{\beta}\theta_{\mu\nu} - \dfrac{\partial L^{(2)}}{\partial (\partial_{\alpha}\phi)}\partial_{\beta}\phi + \delta_{\beta}^{\alpha} L^{(2)} \end{equation}
where $L^{(2)}$ is $L$ at second order in the fields (but this is not important for my question). For a scalar-tensor theory of gravity, one finds something like
\begin{equation}\tag{2} j_{\beta}^{\alpha} = \dfrac{\phi_{0}}{32 \pi G} \left[ - 2 \partial^{\nu} \theta^{\mu \alpha} \partial_{\beta}\theta_{\mu\nu} + \partial^{\alpha} \theta^{\mu\nu}\partial_{\beta}\theta_{\mu\nu} + ... + \delta_{\beta}^{\alpha}\partial_{\nu} \theta_{\mu\gamma} \partial^{\gamma} \theta_{\mu\nu} + ... \right] \end{equation} I'm pretty sure about this result but, again, this is not important to my question. What is important is that the authors of the paper say that they integrate by parts some terms in (2), in order to exploit the gauge conditions and the field equations for $\phi$ and $\theta_{\mu\nu}$, and so to cancel some terms. The first term, for example, becomes $2 \theta^{\mu\alpha}\partial_{\beta}\partial^{\nu} \theta_{\mu\nu}$ and so on. Ok, if I do this, I actually get the same result as them. My question is why this is possible: I can't integrate (by parts) any tensor (or pieces of it) and neglect border terms; it would be like saying that $ln(x)=-1$ (I have integrated by parts the rhs) !