The problem can be shown as this:
Given a functional: $$ J(r) = \int_{\varphi_0}^{\varphi_1} \sqrt{r^2+{r^{\prime}}^2}d\varphi, $$ where $r$ is a function w.r.t $\varphi$, which is unknown. Now, how can I transform it into an expression with variable $x, y$, with$$x=rcos\varphi, \qquad y=rsin\varphi. $$ I.e., translate into a form as$$J_1(y) = \int_{x_0}^{x_1}?dx,$$ where $x_0, x_1$ can be unknown. Is it possible? Please help.
Let's see $$ r=\sqrt{x^2+y^2},\qquad \varphi=\arctan\frac yx,\\ dr=\frac{xdx+ydy}{\sqrt{x^2+y^2}}=\frac{x+yy'}{\sqrt{x^2+y^2}}dx,\qquad d\varphi=\frac{-ydx+xdy}{x^2+y^2}=\frac{-y+xy'}{x^2+y^2}dx,\\ r'=\frac{dr}{d\varphi}=\sqrt{x^2+y^2}\frac{x+yy'}{-y+xy'} $$
Can you put all of this back into the functional?