Find $y(x)$ such that the Euclidean distance between $(x_a, y(x_a))$ and $(x_b,y(x_b))$ is a minimum, i.e., find the minimum of
$$J = \int_{x_a}^{x_b} \left[1 + \left(\frac{dy}{dx}\right)^2\right]^\frac{1}{2}dx$$
with respect to $y(x)$.
So far I have attempted to integrate this. Is the first integral all I need?