My idea was to derive equations that describes the curve, embedded to a surface, that gives the minimum distance between two points, with the cartesian basis (hence not needing to use the metric tensor). Let's define a parametric curve as: $$ \mathbf r(\tau) = x(\tau)\mathbf i + y(\tau)\mathbf j + z(x(\tau), y(\tau))\mathbf k $$ This is the integral that gives the arclength of the curve: $$ S =\int_{x_0}^{x_1} {dr} \\ d \mathbf r = d\tau \left (\frac{dx}{d\tau}\mathbf i + \frac{dy}{d\tau}\mathbf j + \frac{dz}{d\tau}\mathbf k \right ) \\ dr = \sqrt{d \mathbf r \cdot d \mathbf r} = d \tau\;\sqrt{\left (\frac{dx}{d\tau} \right)^2 + \left (\frac{dy}{d\tau} \right)^2 + \left (\frac{dz}{d\tau} \right)^2} $$ Arriving to: $$ S = \int_{x_0}^{x_1} {d \tau\;\sqrt{\left (\frac{dx}{d\tau} \right)^2 + \left (\frac{dy}{d\tau} \right)^2 + \left (\frac{dz}{d\tau} \right)^2}} $$ And to find minimal distance you just vary the functional and set it equal to $0$: $$ \delta S = \delta \int_{x_0}^{x_1} {d \tau\;\sqrt{\left (\frac{dx}{d\tau} \right)^2 + \left (\frac{dy}{d\tau} \right)^2 + \left (\frac{dz}{d\tau} \right)^2}} \\ \frac{1}{2 \sqrt{...}} \;\left ( 2\frac{dx}{d\tau} \frac{d^2x}{d\tau^2} + 2\frac{dx}{d\tau} \frac{d^2y}{d\tau^2} + 2\frac{dz}{d\tau} \frac{d^2z}{d\tau^2} \right)\;\delta \tau =0 $$ Then we find this equation: $$ \frac{dx}{d\tau} \frac{d^2x}{d\tau^2} + \frac{dx}{d\tau} \frac{d^2y}{d\tau^2} + \frac{dz}{d\tau} \frac{d^2z}{d\tau^2} =0 $$ If we try to interpret this equation we find out that the velocity vector at which a particle is moving must be perpendicular to the acceleration vector: $$ \frac{d \mathbf r}{d \tau} \cdot \frac{d^2 \mathbf r}{d \tau^2} = 0 $$
But how should I solve this. Is a system of differential equations with 3 unknowns but only one equation. How would I solve for specific surfaces, like a plane, a paraboloid, etc. How do I plug a parametric surface in the equation, like: $(u, v, u + v)$ What other requisites should I impose to solve the problem. Should I use the Euler-Lagrange Equations?