Let the transport take place from A along the shore of the river for (a - x) km. Then the distance along the highway on road will be √(x² + d²). let the cost per km of transport be p for the waterway.
So the total cost function is : C(x) = (a - x) p + 2p * √(x²+d²)
derivative wrt x: C'(x) = - p + 2 p x /√(x²+d²)
C'(x) = 0 for 4 x² = x² + d²
=> x = d/√3
find C"(x) = 2 p /√(x²+d²) - p x* 2x / (x²+d²)³/²
= [2 p (x² +d²) - 2 p x² ]/ (x²+d²)³/²
since C" is positive, the value of x gives the minimum value of cost function.
length of the high way : = √(x²+d²) = 2 d/√3
Distance from town A, along the river , from where the highway is constructed:
= a - x = a - d/√3