Two towns, Ancaster and Dundas, are 4 km and 6 km, respectively, from an old railroad line that has been made into a bike trail.
Points C and D on the trail are the closest points to the two towns respectively. These points are 8 km apart. Where a rest stop should be built to minimize the length of a new trail that must be built from both towns to the rest stop?
Okay, so first you draw a picture and let x be the distance from point D to the rest stop. Then the distance from point to the rest stop is 8 - x
You know that the length of the new trail is y + z, where y is the distance from Ancaster to the rest stop and z is the distance from Dundas to the rest stop.
Now by the Pythagorean theorem, y^2 = 4^2 + x^2 and z^2 = 6^2 + (8 - x) ^2
So take square roots of these, add them, and minimize.
Note: I am assuming the path is perfectly straight, otherwise this approach fails.