Answer:
3.36 km
Explanation:
You want the distance P east of a refinery so that the cost of laying pipe from the refinery 1 km north of a river and under a 3 km wide river to storage on the south bank is minimized. The cost of under-river pipe is double the cost of overland pipe.
Setup
Let p represent the distance east of the refinery where the river crossing starts. Then the distance in km from the refinery to the river crossing is ...
d1 = √(1² +p²)
The storage facility is 5 km east of the refinery, so is (5-p) km east of the north-bank point where the river crossing starts. The length of the pipe under the 3 km-wide river is ...
d2 = √(3² +(5-p)²) = √(p² -10p +34)
The cost is the sum of costs of laying pipe for each segment. The cost for each unit of distance is double for the under-river pipe, so the total cost can be described by ...
c ∝ d1 + 2×d2
c ∝ √(1² +p²) +2√(p² -10p +34)
Solution
The cost is minimize for the value of p that makes dc/dp = 0. The implicit derivative is ...
c' = p/√(p² +1) +(2p -10)/√(p² -10p +34) = 0
Subtracting the second term and squaring gives ...
p²/(p² +1) = (4p² -40p +100)/(p² -10p +34)
Cross-multiplying gives the 4th-degee equation ...
p⁴ -10p³ +34p² = 4p⁴ -40p³ +104p² -40p +100
In standard form, this is ...
3p⁴ -30p³ +70p² -40p +100 = 0
The only positive real solution in the domain (0, 5) is p ≈ 3.362.
P should be located about 3.36 km downriver from the refinery.
__
Additional comment
This problem does not ask for the cost, so we only need to know the relative cost of two routes.
The solution of the quartic equation is found using a graphing calculator in the first attachment.
The same graphing calculator can find the minimum of 'c' without bothering with differentiation and reducing the equation to a polynomial. This is shown in the second attachment. Note that graph also shows the cost in units of $300,000. That is, the cost of the pipeline will be about $3.1 million.