This is 'Boas mathematical Methods in the Physical Sciences' homework p484.(Calculus of Variations)
problem2 section4 number 2
The bead is rolling on the cycloid curve.(Figure 4.4)
And the book explain that
'Then if the right-hand endpoint is (x, y) and the origin is
the left-hand endpoint...