Telecommunications A cable company wants to provide service for residents of an island. The distance from the closest point on the island's beach, point A, directly to the mainland at point B is 2 kilometers. The nearest cable station, point C, is 10 kilometers downshore from point B. It costs $3500 per kilometer to lay the cable lines underground and $5000 per kilometer to lay the cable lines under water. The line comes to the mainland at point M. Let x be the distance in kilometers from point B to point M.
a. Write a function to calculate the cost of laying the cable.
b. At what distance x should the cable come to shore to minimize cost?