Understanding a necessary step in a solution in variational calculus I'm reviewing calculus of variations using a pdf that I found online (link) and in the example about the minimal surface of revolution, the writer simplified an equation tagged $(3.16)$ as follows:
$$\sqrt{1+(u')^2} - \frac{d}{dx} \, \frac{uu'}{\sqrt{1+(u')^2}} = \frac{1+(u')^2-uu''}{(1+(u')^2)^\frac{3}{2}} = 0 \tag{3.16}$$
where $u' = \frac{du}{dx}$
I just want to know how to obtain the last part since it seems to me that what happened was that the whole equation was squared and then simplified like a normal fraction, except for the $u''$ part.

Let $v = \sqrt{1+(u')^2}$. Then $vv' = u'u''$, and the LHS is
$$\begin{align} v - \frac{d}{dx}\frac{uu'}{v} &= v - \frac{({u'}^2 + uu'')v - uu'v'}{v^2}
\\&=\frac{v^4}{v^3} - \frac{({u'}^2 + uu'')v^2 - uu'vv'}{v^3}
\\&=\frac{v^4 - (v^2 - 1 + uu'')v^2 - u{u'}^2u''}{v^3}
\\&=\frac{v^2 - uu''(1+{u'}^2) + u{u'}^2u''}{v^3}
\\&=\frac{v^2 - uu''}{v^3}
\end{align}$$
which is the RHS.
