Consider the conical surface $z=h(1-\rho/a)$ , $\rho = \sqrt{x^2+y^2}$ generated by the revolution around the z axis of the straight line $ z = h(1-y/a)$, $y\geq 0$. We wish to find the geodesic curve between the points $A$ and $B$ ( see figure below)
a) Using cylindrical coordinates $(\rho,\varphi,z)$ with $\varphi = arctan (y/x)$ ,obtain the linear functionals $f(\varphi,\varphi';\rho)$ and $g(\rho,\rho';\varphi)$ that must be minimized to find the geodesic.It will be useful to define $\beta = \sqrt{1+(h/a)^2}$ .
b) Using the standard form of the Euler equation for the most convenient functional ($f$ or $g$), find the differential equation that relates $(\rho,\varphi)$ and its general solution.
c) Verify that the equation of item b can also be obtained using the Second form of the Euler equation applied to $f$ or $g$
I found on item a, $f= \sqrt{\beta^2+\rho^2\varphi'^2}$ and on item b using the standard Euler equation:$\frac{d}{d\rho}(\frac{\partial f}{\partial \varphi'} )- \frac{\partial f}{\partial \varphi} = 0$ ,the differential equation:
$\varphi' = \frac{c \beta}{\rho\sqrt{\rho^2 -c^2}}$, where $c$ is a constant
But when I try to use the second form of the Euler equation (item c): $\frac{\partial f}{\partial \varphi} - \frac{d}{d\varphi}(f - \varphi'\frac{\partial f }{\partial \varphi'}) = 0$, which since $\frac{\partial f}{\partial \varphi} = 0$, is the same as $f- \varphi'\frac{\partial f }{\partial \varphi'}= c$,I get:
$\varphi' = \frac{\beta\sqrt{\beta^2-c^2}}{c\rho}$.
What am I doing wrong ? Any hints or help will be appreciated.

The second form is better this one (check this post, the physicist use it as the equation of conservation of energy):
$\dfrac{\partial f}{\partial \rho} - \dfrac{d}{d\rho}\left(f - \varphi'\dfrac{\partial f }{\partial \varphi'}\right) = 0$
From here,
$\dfrac{\rho\varphi'^2}{\sqrt{\beta^2+\rho^2\varphi'^2}}-\dfrac{d}{d\rho}\left(\sqrt{\beta^2+\rho^2\varphi'^2}-\varphi'\dfrac{\partial f }{\partial \varphi'}\right)=0$
$\dfrac{\rho\varphi'^2}{\sqrt{\beta^2+\rho^2\varphi'^2}}-\dfrac{d}{d\rho}\sqrt{\beta^2+\rho^2\varphi'^2}+\dfrac{d}{d\rho}\left(\varphi'\dfrac{\partial f }{\partial \varphi'}\right)=0$
$\dfrac{\rho\varphi'^2}{\sqrt{\beta^2+\rho^2\varphi'^2}}-\left(\dfrac{\rho\varphi'^2}{\sqrt{\beta^2+\rho^2\varphi'^2}}+\varphi''\dfrac{\rho^2\varphi'}{\sqrt{\beta^2+\rho^2\varphi'^2}}\right)+\left(\varphi''\dfrac{\partial f }{\partial \varphi'}+\varphi'\dfrac{d}{d\rho}\dfrac{\partial f }{\partial \varphi'}\right)=0$
$-\varphi''\dfrac{\rho^2\varphi'}{\sqrt{\beta^2+\rho^2\varphi'^2}}+\left(\varphi''\dfrac{\rho^2\varphi'}{\sqrt{\beta^2+\rho^2\varphi'^2}}+\varphi'\dfrac{d}{d\rho}\dfrac{\partial f }{\partial \varphi'}\right)=0$
$\varphi'\dfrac{d}{d\rho}\dfrac{\partial f }{\partial \varphi'}=0$
$\varphi'\neq 0$, then $\dfrac{d}{d\rho}\dfrac{\partial f }{\partial \varphi'}=0$ Equivalent to $\dfrac{d}{d\rho}\dfrac{\partial f}{\partial \varphi'}- \dfrac{\partial f}{\partial \varphi} = 0$ that you previously settled.