We know the Maxwell action can be written as the tensor product of the tensor $F^{ab}$ with itself. $F^{ab}F_{ab}$
[Edit: This bit I forgot to mention in the original quesiton] Using the product rule one can write the action $\int\sqrt{-g}Rdx^4$ in terms of first derivatives only (ignoring boundary terms). Call this Lagarangian $B$. So:
$$B=\sqrt{-g}\left( g^{ab}g^{de}g^{cf} +2 g^{ac}g^{bf}g^{de} + 3g^{ad}g^{be}g^{cf} -6 g^{ad}g^{bf}g^{ce} \right)\partial_c g_{ab}\partial_f g_{de}$$
Simimlarly is there a tensor (or indeed a non-tensor matrix object) $P^{abc}$ such that $P^{abc}P_{abc}=B$? $P$ should contain only first derivatives of $g$. i.e. ignoring boundary terms: $\int \sqrt{-g}R dx^4 = \int\sqrt{-g}P^{abc}P_{abc}dx^4$
Or is there a simple proof that this is not possible?
My guess is you would write:
$$P_{abc} = \alpha_1 \partial_a g_{bc} + \alpha_2 \partial_b g_{ac} + \alpha_3 \partial_c g_{ab} + \alpha_4 g_{ab} g^{ef}\partial_c g_{ef} + \alpha_5 g_{ac} g^{ef}\partial_b g_{ef}+ \alpha_6 g_{bc} g^{ef}\partial_a g_{ef}$$
And see what values of $\alpha$ would possibly solve it. Even if the $\alpha$ are non-commutative.
Edit: Using computer software I think it can be done where the $\alpha$ are complex numbers. Don't think there is a real valued solution.