Let $x,y,z$ be real.
Consider a scalar field
$$z = f(x,y)$$
More specific; $f(x,y)$ is a (given) real polynomial in $x,y$ of degree at most $5$ such that
For all $x,y$
$$f(x,y)> 0$$
For a given pair of points $(a,b),(c,d)$ ($a,c$ are the x-part and $b,d$ are the y-part) consider the line integral
$$I(f(x,y)) = \int_C f(r) ds = \int_{(a,b)}^{(c,d)} f(r(t)) |r'(t)| dt = \int_{(a,b)}^{(c,d)} f(r_1(t),r_2(t)) |r'(t)| dt$$
Where the line integral is along a piecewise smooth curve $C$ , $r$ is a bijective parametrization of the curve $C$ and the absolute value bars denote the standard (Euclidean) norm (length) of a vector.
(The line integral over the scalar field $f$ can be thought of as the area under the curve $C$ along a surface $z = f(x,y)$, described by the field. Also $r_1,r_2$ are the $x$ and $y$ part of the parametrization by $r(t)$)
Now the question is how to minimize (global minimum) this value :
$$ A = \inf I(f(x,y))$$
How to find the value of $A$ and the Curve(s) $C$ that gives this value $A$ ?
I assume they have a closed form, or at least they are the solution of a differential equation.
Calculus of variations probably relates to this, but I know little about it.
A trivial case is if $f(x,y)$ is a constant. Then the path is a straith line and $A$ is the length of that line. (The shortest distance is "always" given by a straith line, what can be shown easily by the Euler-Lagrange equation)
The complication arises thus from the higher degrees.
edit
Solutions of degree $3$ could perhaps also be accepted. I lowered my demands since it appears to be not so easy for degree $5$. They will get upvoted probably, but ofcourse if a better answer or degree of $5$ gets solved that gets a higher chance.