There's a room in the shape of a cube with a side length of 7m. There's also an ant, located at one corner of the cube (call it point A), that wants tocrawlto the opposite corner of the cube (call it point B). Find the length of the shortest path the ant can take from point A to point B. Note that the ant cannot fly: it must crawl along the walls (i.e., along the surface of the cube).

Now, I know this problem can be easily solved by flattening out the cube into a 2-dimensional figure, and using the Pythagorean theorem to find the shortest distance between the two points. However, I have to come up with a solution usingcalculus, which involves coming up with some distance function, differentiating that distance function, setting that differentiated function equal to 0, which would then give you the shortest distance (since it corresponds to a minimum on the graph of the distance function). However, I need help figuring out the distance function.

Thanks very much!