Euler-lagrange stationary value Given $$ds = \frac{2}{1-r^2}\sqrt{dr^2 + r^2d\phi^2}$$
use euler equation to proove from origin to a point the shortest path is a straight line. 
I have tried to use $dr$ as variable ($\phi(r)$). that give me $\frac{\partial f}{\partial\phi} = 0$ but the rest I can not make sense of it. When I check the answer, I got confused. The answer use $d\phi$ as variable and it goes like this:
$$r=r(\phi)$$
$$ds = \frac{2}{1-r^2}\sqrt{r'^2 + r^2}d\phi$$and 
$f = \frac{2}{1-r^2}\sqrt{r'^2 + r^2}$
$$\frac{\partial f}{\partial \dot r} = \frac{2r'}{(1-r^2)\sqrt{(r')^2 + r^2}}$$
And now next next step is:
$$\frac{\partial}{\partial\phi}\frac{\partial f}{\partial \dot r} = 0$$
Here is where I got confused. The answer said $\frac{\partial f}{\partial \dot r}$ is not a function of $\phi$. Why is that, it already said$r=r(\phi)$, how come $\frac{\partial f}{\partial \dot r} $ is not depended on $\phi$. I know there is no $\phi$ appear in there but $r ,r'$ could depended on $\phi$, or I am just entirely wrong ?
Please help, Thank you all. 
 A: *

*The Lagrangian for the geodesic equation is not unique. We can use the squared Lagrangian, cf. e.g. this Phys.SE post. Also we can scale with a non-zero constant.

*So let us chose the governing Lagrangian as
$$L~=~ \frac{\dot{r}^2+r^2\dot{\phi}^2}{2(1-r^2)^2}, \tag{1}$$
where we identify the curve parameter with time $t$. 

*The momenta are
$$ p_r~:=~\frac{\partial L}{\partial \dot{r}}~=~\frac{\dot{r}}{(1-r^2)^2}, \qquad p_{\phi}~:=~\frac{\partial L}{\partial \dot{\phi}}~=~\frac{r^2\dot{\phi}}{(1-r^2)^2}.\tag{2} $$

*$\phi$ is a cyclic variable, i.e. $\frac{\partial L}{\partial \phi}=0$, so $p_{\phi}$ is a constant of motion.

*The Hamiltonian
$$ H~:=~p_r\dot{r}+  p_{\phi}\dot{\phi} - L ~=~\frac{(1-r^2)^2}{2}\left( p_r^2 +\left(\frac{p_{\phi}}{r}\right)^2\right) \tag{3} $$
is also a constant of motion, since there is no explicit $t$-dependence. In mathematics, this latter fact is known as Beltrami's identity.

*Apparently to have finite energy (3), we must choose 
$$p_{\phi}~=~0\tag{4}$$ 
to be able to go through the origin $r=0$.

*But eqs. (2) & (4) imply that $$\dot{\phi}~=~0.\tag{5}$$
So a geodesic through the origin $r=0$ is purely radial, which evidently is what OP was asked to prove. 
