# Varying a function

1. Mar 13, 2013

Hi i am trying to vary $\int a^{3}(t)(0.5\dot{\phi}^{2}-\frac{1}{2a^2}(\nabla \phi)^{2} -V) d^3 x$
I understand that one varyies w.r.t phi so it becomes:
$\int a^{3}(t)(\dot{\phi}\delta \dot{\phi}-\frac{1}{a^2}(\nabla \phi)(\delta \nabla \phi) -V'\delta \phi) d^3 x$

I can't see why it would then becomes $\int (-\frac{d}{dt}(a^{3}\dot{\phi})+a(\nabla^{2} \phi) -a^3V') d^3 x$

I.e where do the variations go why does it become $\partial_{\mu}$ that then moves before the terms not after them , i realise that the metric used is (-,+++)

2. Mar 14, 2013

### mathman

I don't know the answer, but I think you would do better by putting your question in the calculus forum.