Solving the "Spider and Fly problem" using calculus As part of my homework I've the following problem:
Find the shortest path from corner $S$ to corner $F$ (the spider should walk on the surface). 

I have to use calculus to solve the problem (more specifically using the absolute min/max theorems).
I'm struggling to come up with a "primary function" to derive and apply the absolute max/min theorems.
My guess is that i have to find the shortest path from corner $S$ to the end of the common edge (between the planes) and add to that the shortest path from that edge the corner $F$, but i'm unable to construct appropriate function (should i use the distance formula?).
Thanks.
 A: HINT
Imagine that the cube "unfolds" and you have yourself a $2D$-problem, where the shortest path is a line.
The distance that it will have to travel then, will be the diagonal of an orthogonal parallelogram of sides $2$ and $1$, since the length of the side of the originbal cube is equal to $1$.
A: 
My guess is that i have to find the shortest path from corner S to the end of the common edge (between the planes) and add to that the shortest path from that edge the corner F

No. The shortest path is not the sum of the shortest paths to the edge. If the spider insists on walking along the shortest path from the spider to the edge, and then along the shortest path from the edge to the fly, it will have to walk some additional distance along the edge to do that (resulting in a total distance of 3).
Instead the spider walks towards the edge diagonally, and travels a distance $\sqrt{1+d^2}$ (Pythagoras) by the time it reaches the edge, and then it travels a further distance of $\sqrt{1+(1-d)^2}$ to get to the fly.
So you should minimize 
$$\sqrt{1+d^2}+\sqrt{1+(1-d)^2}$$

