Help in an integration step in QFT by Lewis H. Ryder There is an integration step I can not figure out and is frustrating. 

We start from the equality 
  $$ \dfrac{\partial^2\phi}{\partial x^2} = \dfrac{\partial V}{\partial \phi} $$
  and by integration process we are supposed to get (eq. 10.8 in the textbook):
  $$ \dfrac{1}{2}\left(\dfrac{\partial\phi}{\partial x}\right) ^2 = V(\phi)
$$ 

Maybe I'm just overcomplicating it but I can not understand how this is done. 
$\phi =\phi(x,t)$ but for this case $\dfrac{\partial\phi}{\partial t}=0$ and $\phi$ approaches zeroes of $V(\phi)$ when $x\rightarrow\pm\infty$.
Then my idea was to integrate by $d\phi$ both sides to get the RHS of eq. 10.8 and for the LHS I tried integrating by parts using $$d\phi=\dfrac{\partial\phi}{\partial x}dx$$
but got no success yet, and also the fact is that I don't even think what I'm doing is correct since is $V(\phi)$ and not $\phi$ what tends to zero when $x\rightarrow \pm \infty$.
Any help would be appreciated
 A: Just think about it as classical mechanics. Relabel $\phi$ to $x$ and $x$ to $t$ for 
$$\frac{d^2 x}{dt^2} = \frac{dV}{dx}.$$
This is Newton's second law with $m = 1$ and an extra minus sign. Then the result is energy conservation with an extra minus sign, 
$$\frac12 v^2 - V(x) = E$$
and is proved the same way. Presumably, boundary conditions set $E = 0$, giving the desired result.
A: Another possible way which might be more clear for you is to do the following: 
Begin with 
$$ \frac{\partial^2 \phi}{\partial x^2} = \frac{\partial V}{\partial \phi}.$$
Multiplying the above by $\partial \phi / \partial x$ and moving $\partial V/\partial \phi$ to the other side yields
$$ \label{eq:1} \tag{**}  \frac{\partial \phi}{\partial x} \frac{\partial^2 \phi}{\partial x^2} - \frac{\partial \phi}{\partial x} \frac{\partial V}{\partial \phi}   =0.$$
Note:
The first expression on the LHS of the above equation can be equivalently expressed as $$  \frac{\partial \phi}{\partial x} \frac{\partial^2 \phi}{\partial x^2} \equiv \frac{1}{2}\frac{\partial}{\partial x} \left( \frac{\partial \phi}{\partial x} \right) ^2.$$
Combining the pieces, we can express Eq. (\ref{eq:1}) as 
$$ \frac{\partial }{\partial x} \left( \frac{1}{2}\left( \frac{\partial \phi}{\partial x}\right)^2 - V(\phi) \right)  = 0.  $$
Hopefully you can take it from here. Note The integration constant is zero according to pg. 393 Lewis Ryder; QFT.
