Path traversed in the space between two curves Consider the curves $\sin x+2$ and $\cos(x-1)+1$ in $\mathbb{R}^2$, and let a point particle traverse through the space in between the curves. Let the point particle go from $x=0$ to $x=10$.
Given that the point particle must stay within the two curves (including the curves), what is the path that the particle must take to minimise its distance travelled? What is the distance travelled?
How can we solve this problem for spaces between other sinusoidal curves? How about for spaces between two general curves?
I've thought of using some calculations of variations, but I'm unsure.
The graph below gives one such possible trajectory from $x=0$ to $x=3\pi$.

 A: Quite clearly you can shorten the distance by going off on a tangent from the blue curve $\cos(x-1)+1$ around $x=1$ such that you end up coming onto the red curve $\sin x+2$ on a tangent as well. To truly minimise the traversed distance we need to find simultaneous tangents to both curves; the optimal path will combine these with short segments on the curves.
At $x=a$ the tangent to $\sin x+2$ has equation $y-\sin a-2=\cos a(x-a)$. At $x=b$ the tangent to $\cos(x-1)+1$ has equation $y-\cos(b-1)-1=-\sin(b-1)(x-b)$. Equating coefficients gives
$$\cos a=-\sin(b-1)$$
$$-a\cos a+\sin a+2=b\sin(b-1)+\cos(b-1)+1$$
Numerically solving at the two relevant points gives
$$(a,b)=(4.4154453165\dots,1.2969436638\dots)$$
$$(a,b)=(5.2139037579\dots,6.7816705296\dots)$$
and after a few more computations involving the path's endpoints we get the true shortest path from $x=0$ to $x=10$:

The path leaves the lower curve for the last time at $x=7.4929739143\dots$, while the path length is then left as an exercise for the reader.
This is an instance of the Euclidean shortest path problem in two dimensions. Other instances can be solved similarly to this, by building a "visibility graph" on (a polygonal approximation) of the input and then running discrete shortest path algorithms on the graph.
