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?