Why can I remove the first term from euler equation for the shortest path between two points? I'm studying the basic example of Euler's equation that is to obtain the shortest path between two points.
$$
f = \sqrt  {1 + y' ^ 2}
$$
$$
\frac{\partial f}{\partial y} - \frac{d}{dx}(\frac{\partial f}{\partial y'})
   = 0
$$
My textbook said that I could replace the first term
$ \frac{\partial f}{\partial y} $
to $ 0 $, because there is no $ y$ in the definition of $ f $.
I got no intuition to do so, so I tried to calculate $ \frac{\partial f}{\partial y} $.
$$ 
\frac{\partial f}{\partial x} \frac{\partial x}{\partial y}
 = \frac{\partial f}{\partial x} \frac{1}{y'} = {(y'^2 + 1)}^{-1/2}
 = \frac{1}{2}{(y'^2 + 1) ^ {-1/2}}{2y'y''}\frac{1}{y'} = {(y'^2+1)}^{-1/2}y''
$$
And I don't think $ {(y'^2+1)}^{-1/2}y'' = 0 $.
This derivation doesn't seem to give the same result of the textbook.
What did I do wrong?
 A: What you did wrong is computing the partial derivatives, for instance in your case  $\frac{\partial f}{\partial x}=0$ (see this).

For example if $f(x,u)=x^{2}+u(x)$, then $\frac{\partial f}{\partial x}=2x,\frac{\partial f}{\partial u}=1$ and $\frac{df}{dx}=2x+\frac{d}{dx}u.$

Continuing from your example, since $\frac{\partial f}{\partial y}=0$, then we have $- \frac{d}{dx}(\frac{\partial f}{\partial y'})
   = 0$ or $\frac{d}{dx}(\frac{\partial f}{\partial y'})
   =0.$
So $$\frac{d}{d x}(\frac{\partial f}{\partial y'})=\frac{d}{dx}(\frac{\partial }{\partial y'}\big((1+y'^{2})^{\frac{1}{2}}\big)$$
$$=\frac{d }{dx}(\frac{y'}{\sqrt{1+y'^{2}}})=0$$
(You may think of $\frac{\partial}{\partial y'}\big((1+y'^{2})^{\frac{1}{2}}\big)$ the same as computing $\frac{d}{dx}\sqrt{1+x^2}$).
Then you have $$\frac{y'}{\sqrt{1+y'^{2}}}=c_{1}$$ and since the denominator is never $0$ we have $y'^{2}=c_{1}^2(1+y'^{2})$ so re-arranging gives
$$y'^{2}=\frac{c_1^{2}}{1-c_{1}^2}$$
(Can $c_{1}=\pm 1$?) so you have $$y'=\sqrt{\frac{c_1^{2}}{1-c_{1}^2}}=\text{constant}=a$$
Thus $y(x)=ax+b.$
