Let $f, g : [a, b] \to \mathbb{R}$ be two continuous functions such that $$f(x)<g(x)\ \ \forall\ x\in(a,b)$$
Let $P_1\ (x_1,\ y_1)$ and $P_2\ (x_2,\ y_2)$ such that $$a \le x_1, x_2\le b\ ,\\ \ \ \ \ \ \ \ \ f(x_1) < y_1 < g(x_1)\ and\\ f(x_2) < y_2 < g(x_2)$$
Describe a general way to find the shortest (in length) continuous function $h$ that connects the two points and $$f(x)<h(x)<g(x)\ \ \forall\ x\in[x_1,x_2]$$ Notes
You may also consider the case $$f(x)\le h(x)\le g(x)$$ and (optionally): $$\ \ \ \ \ \ \ \ f(x_1) \le y_1\le g(x_1)\ and\\ f(x_2) \le y_2\le g(x_2)$$
You may make any extra necessary assumptions (e.g. differentiability) provided that the problem does not become trivial.
(Edit 6:)
- If you already know the answer telling me which topics I should look into is enough (and you probably don't need to read further).
(Edit 4:)
Comment
Proposed solution (by Christian Blatter):
"Stretch a rubber band from P1 to P2. This band will be straight whenever it does not lie along one of the boundary curves."
If this statement is true, I would very much like to see a proof.
(Edit 7:)
(Pointed out by TonyK) There's not always a function that satisfies the original argument (not the things in the Notes section). There may only be an infimum for the length of $h$.
(Edit 5:)
How the problem arose
I was walking on the street which was formed by the arcs of two concentric circles. I was trying to find what trajectory I should follow so that walking "a given angle" around the circle and simultaneously "crossing the street" I would walk the least. If the line that connects the two points is on the street then problem is trivial. If not I should either:
- Follow the obvious tangent from $P_1$ to the small circle, walk as much as necessary on this circle to "find" the tangent from this circle to the other point etc. Or
- I should move in such a way so the distance between me and the center of the circles changes at some rate (possibly constant) making a spiral like path.
Until now I don't know which option is the best.
The original question is more general. The problem can be generalized even further of course. For example one could consider instead of the functions f, g a set of points. Also the problem can be extended in higher dimensions.
To save time
The post has been edited to include the useful comments made to it. You may skip reading them. However, I encourage you to look at the attempted answers and their comments.








Here is my attempt at making a claim and proving it. Essentially it is "be as close to the straight line connecting $P_1$ and $P_2$ as possible"
The general case for $h$ follows from the cases below.
If $h(x)=L(x)$ for all $x \in [x_1 , x_2 ]$, then we are done since the shortest path between two points is the line segment joining them
Assume WLOG that that $h(x) > L(x)$ for some $x$, and $h \leq g$ (if we flip the inequality directions and replace $g$ with $f$, the proof is equivalent just "upside down"). But assume by way of contradiction that there exists a continuous function $H$ satisfying the problem such that $H \neq h$ and the arc length of $H$ on $[x_1 , x_2]$ is less than that of $h$. Then $$ H \geq h \geq L $$ and there $\exists x$ such that $$ H(x) > h(x) $$ These facts show that $H$ "deviates" strictly more than $h$ from $L$ (which is the shortest possible path). Actually we can approximate $h$ by a polygonal path $\gamma_n$ and $H$ by a polygonal path $\Gamma_n$, where $n$ is the number of line segments in the polygonal path, such that $h(x) \in \gamma_n$ and $H(x) \in \Gamma_n$. Then $$ \lim_{n \to \infty} \gamma_n = h $$ $$ \lim_{n \to \infty} \Gamma_n = H $$ and $$ arclength(\gamma_n) < arclength(\Gamma_n) \quad \forall n>1 $$ From these 3 facts we conclude $$ arclength(h) < arclength(H) $$ as desired as it completes the contradiction