**The Beltrami Identity:**

If the Lagrangian $\:L\left(y,y',x\right)\:$ of a system does not depend explicitly on $\:x$, that is
\begin{equation}
\dfrac{\partial L}{\partial x}=0
\tag{01}\label{01}
\end{equation}
then from the Euler-Lagrange equation
\begin{equation}
\dfrac{\mathrm{d}}{\mathrm{d}x}\left(\dfrac{\partial L}{\partial y'}\right)-\dfrac{\partial L}{\partial y}=0
\tag{02}\label{02}
\end{equation}
we have
\begin{equation}
\dfrac{\mathrm{d}}{\mathrm{d}x}\left(y'\dfrac{\partial L}{\partial y'}-L\right)=0
\tag{03}\label{03}
\end{equation}
so
\begin{equation}
y'\dfrac{\partial L}{\partial y'}-L = \text{constant of the motion}
\tag{04}\label{04}
\end{equation}
For your Lagrangian
\begin{equation}
dt \frac{\sqrt{\dot x ^2 + \dot y ^2}}{y}=dx \frac{\sqrt{1 + y' ^2}}{y}
\tag{05}\label{05}
\end{equation}
that is
\begin{equation}
L\left(y,y',x\right)=\frac{\sqrt{1 + y' ^2}}{y}
\tag{06}\label{06}
\end{equation}