scroll down to problem #9 ...
http://www.math.ucdavis.edu/~kouba/CalcOneDIRECTORY/maxmindirectory/MaxMin.html
A swimmer is at a point 500 meters from the closest point on a straight shoreline. She needs to reach a cottage located 1800 meters down shore from the closest point. If she swims at 4 meters per second and she walks at 6 meters per second, how far from the cottage should she come ashore so as to arrive at the cottage in the shortest time?
I have no clue what to use for the primary and secondary equations. Your help would be greatly appreciated.
scroll down to problem #9 ...
http://www.math.ucdavis.edu/~kouba/CalcOneDIRECTORY/maxmindirectory/MaxMin.html