proper variation of action term I have a term I want to vary by a field, $\phi$.
$$
`S' = \frac{-1}{2}\,\sqrt{-g}\,g^{\mu\,\nu}\,\delta\left[h(\phi)\,\partial_{\mu}\phi\,\partial_{\nu}\phi \right].
$$
Is it correct to get this? 
(I am unsure about the derivatives)
let $$a:=\frac{-1}{2}\,\sqrt{-g}\,g^{\mu\,\nu}$$
Basically I want to know how to do this:
$$
a\,h(\phi)\,\delta\left[ \partial_{\mu}\phi\,\partial_{\nu}\phi\right]
$$
I should also say, that unlike the usual case, I am only interested in varying the field, not the coordinates. So I think $\partial_a\phi \mapsto \partial_a\phi+\partial_a(\delta\,\phi)$....
If I take Taylor series would then the variation be,
$$
\left( \partial_{\mu}\phi + \frac{1}{2}\,\partial_{\mu'}\partial_{\mu}\phi\,(\delta\phi)    \right)\,\left(   \partial_{\nu}\phi + \frac{1}{2}\,\partial_{\nu'}\partial_{\nu}\phi\,(\delta\phi)     \right) = 
$$
$$
\cdots = \partial_{\mu}\phi\,\frac{1}{2}\,\partial_{\nu'}\partial_{\nu}\phi\,(\delta\phi) + \partial_{\nu}\phi\,\frac{1}{2}\,\partial_{\mu'}\partial_{\mu}\phi\,(\delta\phi)
$$
and then collect on $\delta\phi$? I have 4 index values... I think $\mu' \neq \nu$ and $\nu'\neq \mu$, as there seems to be no reason why they would be.
 A: I'm not really sure what you're asking, but I think it's about how to deal with varying the term $\partial_\mu \phi \partial_\nu \phi$. I'll work in Minkowski space + Cartesian coordinates so we don't have to worry about the metric determinant.
Say you have the action:
$$S=\int d^4x~ g^{\mu \nu} \partial_\mu \phi \partial_\nu \phi $$
Varying this action yields:
$$\delta S=\int d^4x~ g^{\mu \nu} \delta (\partial_\mu \phi \partial_\nu \phi)$$
Now we can use the product rule to expand this out:
$$\int d^4x~ g^{\mu \nu} \delta (\partial_\mu \phi \partial_\nu \phi)=\int d^4x~ g^{\mu \nu} [\partial_\nu \phi \delta (\partial_\mu \phi)+\partial_\mu \phi \delta (\partial_\nu \phi)]$$
Since $\partial_\mu \phi \delta (\partial_\nu \phi)$ is clearly symmetric, we can simplify this to:
$$\delta S=2\int d^4x~ g^{\mu \nu} \partial_\mu \phi \delta (\partial_\nu \phi)$$
Now comes the part I believe you're confused about. We integrate by parts, i.e. we use the fact that:
$$\int d^4x~ a~\partial_\mu b=\int d^4x~ \partial_\mu (ab) -\int d^4x~ b~\partial_\mu a$$
We also use the fact that the gradient and the functional derivative commute: $\partial_\mu \delta\phi =\delta (\partial_\mu \phi)$. So, we get:
$$\delta S=2\int d^4x~ \partial_\nu (g^{\mu \nu} \partial_\mu \phi \delta \phi)-2\int d^4x~ g^{\mu \nu} \partial_\nu \partial_\mu \phi ~\delta \phi$$
Now all we have to do is notice that the first integral is of a total derivative, i.e. something of the form $\partial_\mu V^\mu$, so it can be converted into a surface term by the 4D divergence theorem. Since this is a variational problem we know that $\delta \phi=0$ on the surface, and therefore the whole first integral must be zero. What we're left with is:
$$\delta S=-2\int d^4x~ g^{\mu \nu} \partial_\nu \partial_\mu \phi ~\delta \phi$$
This, of course (by the stationary action principle), tells us that the equations of motion for our field are:
$$g^{\mu \nu} \partial_\nu \partial_\mu \phi =\square \phi =0$$.
