Problems with Calculus of Variations lecture material I'm having trouble understanding the derivation in my Calculus of Variations course material and I was hoping if someone could clarify this out. Here is my reference (as I have rewritten it, the original material can be found on the bottom of this post). I'm having trouble only in the final part (Integration by parts):

$$J(u)=\int_{\Omega}F(\textbf{x}, u, u')\;d\textbf{x},$$
where $\textbf{x}\in \mathbb{R}^n, u=u(\textbf{x}),
 u'=u'(x)=\frac{du}{d\textbf{x}}=\nabla u(\textbf{x}), \;\Omega$ is a
  bounded open set in $\mathbb{R}^n,$ $u: \Omega\rightarrow\mathbb{R}$
  is a function of class $C^2$ and $F(x,u,u')$ is a real valued function
  of class $C^2$ with respect to all its arguments. 
Now we define: 
$$\Phi(\epsilon):=J(u+\epsilon\eta),$$
where $\eta\in C^{\infty}_0(\Omega, \mathbb{R})$ and $\epsilon$ is a
  small number. $\Phi(\epsilon)$ is of class $C^2$ on some interval
  $(-\epsilon_0, \epsilon_0)$. Now we want to calculate the derivative
  of $\Phi(\epsilon)$ at the point $\epsilon =0$ and equate it to $0$.
  We get: 
$$\Phi'(0)=\int_\Omega\left(F_u(\textbf{x},u,u')\eta+F_{u'}(\textbf{x},u,u')\cdot
 \eta'\right)\;d\textbf{x}=$$$$\int_\Omega \left(F_u(\textbf{x}, u,
 u')\eta+\sum_{i=1}^n\frac{\partial F(\textbf{x},u,u')}{\partial
 u'_i}\eta'_i \right)\;d\textbf{x}=0,$$
where $$\eta'=\nabla\eta(\textbf{x}), \;\eta'_i=\frac{\partial \eta
 }{\partial x_i},\;u'_i=\frac{\partial u}{\partial x_i}.\;$$
Now my lecturer uses integration by parts and he gets: 
$$\int_\Omega \left(F_u(\textbf{x}, u,
 u')\eta+\sum_{i=1}^n\frac{\partial F(\textbf{x},u,u')}{\partial
 u'_i}\eta'_i \right)\;d\textbf{x}=\;\;\;\;\;\;\;(1)$$
$$F_u(\textbf{x}, u,
 u')-\sum_{i=1}^n\frac{d}{dx_i}\left(\frac{\partial
 F(\textbf{x},u,u')}{\partial u'_i}\right)=0.\;\;\;\;\;\;\;\;\;\;(2)$$

Now what happened from $(1)$ to $(2)$? I'm a bit confused. Can someone explain the integration by parts part...
P.S. here is also the original lecture material (the notation is a bit different to what I used): 

 A: The second term of the integral is integrated by parts using Gauss's divergence theorem:
\begin{align}
\int\limits_\Omega \mbox{grad}_p F \cdot \mbox{grad}_x \eta \, dx
&= 
\int\limits_\Omega \left(\mbox{div}_x(\eta \, \mbox{grad}_p F ) - 
\eta \, \mbox{grad}_x \cdot \mbox{grad}_p F\right) \, dx \\
&= 
\int\limits_{\partial\Omega} \underbrace{\eta \, \mbox{grad}_p F}_{\eta|_{\partial\Omega = 0}} \cdot dA - 
\int\limits_\Omega \eta \, \mbox{grad}_x \cdot \mbox{grad}_p F \, dx \\
&= 
-\int\limits_\Omega \eta \, \mbox{grad}_x \cdot \mbox{grad}_p F \, dx
\end{align}
So
\begin{align}
0 = \delta J =
\int\limits_\Omega \left( 
\eta \, \mbox{grad}_u F + 
\mbox{grad}_p F \cdot \mbox{grad}_x \eta 
\right) \, dx
&=
\int\limits_\Omega \left( 
\eta \, \mbox{grad}_u F -
\eta \, \mbox{grad}_x \cdot \mbox{grad}_p F
\right) \, dx \\
&=
\int\limits_\Omega  
\eta \, \left( 
\mbox{grad}_u F -
\mbox{grad}_x \cdot \mbox{grad}_p F
\right) \, dx
\end{align}
which for arbitrary $\eta$ (within $\Omega$) implies the term in parentheses to vanish. (For a rigorous proof, this probably has to be shown as well).
The last step seems to be the result of looking at the dependencies of $F$ which are given as
$F(x, u, Du)$ and applying the partial derivatives regarding $x$:
$$
\sum_i \partial_{x_i} \partial_{p_i} F(x, u, Du) 
$$
that would yield the three sums of second order derivatives, one for each variable.
Note: your text uses total derivatives, so I might be sloppy/wrong. 
To be more precise I would need to better understand your $D$ operator and its connection to the $p$ variable. 
