# Covariant and contravariant derivatives in Klein-Gordon equation

Whilst exposing how a scalar product for the solutions of the Klein-Gordon equation (written as $(\Box + m^2)\varphi(x)=0$) can be derived, my textbook starts from the following system \begin{cases} \varphi_2^*(x)(\Box + m^2)\varphi_1(x)=0 \\ \varphi_1(x)(\Box + m^2)\varphi_2^*(x)=0 \end{cases} (with $\varphi_1(x)$ and $\varphi_2(x)$ - and their respective complex conjugates - solutions of the K-G equations) to obtain the following equation (by subtracting the second to the first one): $$\varphi_2^*(x)(\Box \varphi_1(x)) - \varphi_1(x) (\Box \varphi_2^*(x))=0$$ At this point, adopting the covariant/contravariant formalism for the $\Box$-operator ($\Box=\partial_i\partial^i$) and defining $\varphi_2^*(x)\overleftrightarrow{\partial^i}\varphi_1(x) = \varphi_2^*(x)\partial^i\varphi_1(x) - \varphi_1(x)\partial^i\varphi_2^*(x)$, the last equation is rewritten as follows: $$\partial_i(\varphi_2^*(x)\overleftrightarrow{\partial^i}\varphi_1(x))=0$$ This is where I am stuck: I am not able to understand why the covariant derivative $\partial_i$ can commutate with $\varphi_2^*(x)$ and $\varphi_1(x)$...hoping that I understood well and this is infact what's happening here!

$$\partial_i(\varphi_2^*(x)\overleftrightarrow{\partial^i}\varphi_1(x))=\partial_i(\varphi_2^*(x)\cdot\partial^i\varphi_1(x) - \varphi_1(x)\cdot\partial^i\varphi_2^*(x))=\\ \require{cancel}\cancel{\partial_i\varphi_2^*(x)\partial^i\varphi_1(x)} + \varphi_2^*(x)\partial_i\partial^i\varphi_1(x) - \require{cancel}\cancel{\partial_i\varphi_1(x)\partial^i\varphi_2^*(x)} - \varphi_1(x)\partial_i\partial^i\varphi_2^*(x)=\\ \varphi_2^*(x)(\Box\varphi_1(x))-\varphi_1(x)(\Box\varphi_2^*(x))$$ The cancellation occuring because in the scalar product between two vectors the indexes can be raised or lowered at will: e.g. $v^iw_i = g_{ij}v^iw^j = v_jw^j\equiv v_iw^i$ ($g_{ij}$ is the metric tensor).