This (modifiable) applet was created to model this problem that appears on pg. 218 in Howard Anton's Calculus 5/E text (c) 1995 by John Wiley & Sons, Inc.
"An offshore oil well is located in the ocean at a point W, which is 5 mi from the closest shorepoint A on a straight shoreline. The oil is to be piped to a shorepoint B that is 8 mi away from A by piping it on a straight line under water from Wto some shorepoint P between A and B and then on to B via pipe along the shoreline. If the cost of laying pipe is $100,000 per mile under water and $75,000 per mile over land, where should the point P be located to minimize the cost of laying the pipe?"
Use optimization (i.e. real-world application of the closed-interval method) to solve this problem. You can use this applet to determine the reasonableness of your solution afterwards. (You can also change the locations of the well, point B, and point P).