When I came across the Brachistochrone problem, my teacher said we could relate it to Fermat's principle of least time.
So, we could make many glass slabs of high $\mathrm dx$, and every slab has a different optical density; now, we can stack all the slabs one over the other so that the optical density increases as the height at which it is stacked increases.
Now, when we project a beam of light at the top, the path traced by the curve will be the Brachistochrone curve.
Finally, I doubt how to take this to equations and how to get the trajectory equation.