[Math] Calculus Optimization – Finding the minimum cost

calculusderivativesoptimization

In oil pipeline construction, the cost of pipe to go underwater is 60% more than the cost of pipe used in dry-land situations. A pipeline comes to a river that is 1 km wide at point A and must be extended to a refinery, R on the other side, 8 km down the river. Find the best way to cross the river (assuming that it is straight) so that the total cost of the pipe is kept to a minimum.

I am very confused with this question. I have came up with the equation:

$c(x) = xc + \sqrt{(8-x)^2+1}(1.6c)$

I am not sure on how to find the derivative of this, nor how to use to 60% to find the answer.

Best Answer

enter image description here

In the description user481710 has chosen, $ \ x \ $ km. represents the distance from the refinery location $ \ R \ $ at which the pipeline reaches the opposite bank of the river, having entered the river at point $ \ A \ $ and emerging at point $ \ B \ $ . The distance measured along the river from $ \ A \ $ to $ \ B \ $ is then $ \ 8 - x \ $ km. ; as the width of the river is 1 km., the (straight-line) length of pipeline running underwater is as OP found, $ \ [ \ (8 - x)^2 \ + \ 1^2 \ ]^{1/2} \ $ .

With the cost per kilometer of running pipeline overland taken as $ \ c \ $ , the per-kilometer cost for underwater pipeline is $ \ 1.6 \cdot c \ $ , making the cost function as OP correctly gives,

$$ C(x) \ = \ 1.6 \cdot c \ [ \ (8 - x)^2 \ + \ 1^2 \ ]^{1/2} \ + \ c \cdot x \ \ . $$

The actual value of $ \ c \ $ is unimportant: it is only the relative cost of underwater versus overland pipe-laying that affects the optimization.

For interest's sake, we can generalize the problem to make that relative cost factor $ \ \alpha \ $ , and carry out the calculation for the minimal cost of the pipeline:

$$ \frac{dC}{dx} \ = \ \frac{d}{dx} \left(\alpha \cdot c \ [ \ (8 - x)^2 \ + \ 1 \ ]^{1/2} \ + \ c \cdot x \right) $$

[applying the Chain Rule to the first term]

$$ = \ c \ \alpha \ \cdot \ \frac{1}{2} \ [ \ (8 - x)^2 \ + \ 1 \ ]^{-1/2} \ \cdot \frac{d}{dx} [ \ (8 - x)^2 \ + \ 1 \ ] \ \ + \ \ c \cdot 1 $$

[applying the Chain Rule to the factor still to be differentiated]

$$ = \ c \ \alpha \ \cdot \ \frac{1}{2} \ [ \ (8 - x)^2 \ + \ 1 \ ]^{-1/2} \ \cdot \ 2 \ (8 - x) \cdot (-1) \ \ + \ \ c $$

[setting the derivative equal to zero in order to locate the critical point of $ \ C(x) \ $ ]

$$ = \ -c \ \cdot \frac{\alpha \ (8 - x)}{\sqrt{ (8 - x)^2 \ + \ 1 \ }} \ + \ \ c \ \ = \ \ 0 \ \ \Rightarrow \ \ \frac{\alpha \ (8 - x)}{\sqrt{ (8 - x)^2 \ + \ 1 \ }} \ = \ 1 \ \ , $$

where $ \ c \ $ may be "divided out" since it is non-zero. Since the underwater length of pipeline can never be zero, we can multiply the equation through by the denominator. Algebraic re-arrangement leads us to

$$ \sqrt{ (8 - x)^2 \ + \ 1 \ } \ = \ \alpha \ (8 - x) \ \ \Rightarrow \ \ (8 - x)^2 \ + \ 1 \ = \ \alpha^2 \ (8 - x)^2 $$

$$ \Rightarrow \ \ ( \ \alpha^2 \ - \ 1 \ ) \ (8 - x)^2 \ = \ 1 \ \ \Rightarrow \ \ 8 - x \ = \ \sqrt{\frac{1}{\alpha^2 \ - \ 1}} \ \ . $$

For this specific problem,

$$ \ \alpha \ = \ 1.6 \ \ \Rightarrow \ \ 8 - x \ = \ \sqrt{\frac{1}{1.6^2 \ - \ 1}} \ \approx \ 0.80 \ \text{km.} \ \ \Rightarrow \ \ x \ \approx \ 7.20 \ \text{km.} \ \ . $$

So we find that emerging from the river (point $ \ B \ $ ) 7.2 kilometers away from the refinery gives the least total cost for the pipeline. If we graph the cost function, however, we find that in practice the cost is not particularly "sensitive" to the placement of that point; a shift of 0.5 kilometer in either direction only increases the cost by about 1% .

enter image description here

The location of the value of $ \ x \ $ for which $ \ C(x) \ $ is minimal is marked by the arrow. The minimum in the cost function is rather "flat", however, as the vertical scale suggests.

If we consider other relative cost factors $ \ \alpha \ \ge \ 1 \ $ , we see from our result above that $ \ ( \ 8 - x \ ) \ $ is never zero, so it is never cheapest to lay the pipeline straight across the river. (The minimum does draw closer to the "straight-across" solution as $ \ \alpha \ $ increases, as we'd expect.)

We also find that the minimum only disappears for $ \ \alpha \ = \ 1 \ $ , with the least cost occurring if we use the zero "endpoint" of the allowed interval $ \ 0 \ \le \ x \ \le \ 8 \ . $ This is reasonable: if it costs just the same to lay pipeline overland or under the river, the cheapest solution is to run the line straight from $ \ A \ $ to $ \ R \ $ .

enter image description here

The cost function $ \ C(x) \ $ for various values of $ \ \alpha \ $ . The position $ \ x \ = \ 0 \ $ corresponds to the location $ \ R \ $ of the refinery; the region in green is excluded, as this lies further from the refinery than the point "straight across" the river from $ \ A \ $ .

$$ \ \ $$

Following the approach described by André Nicolas in his comment, for which the variable is the angle $ \ \theta \ $ that the underwater pipeline makes to the line straight across the river, we have

$$ \frac{1}{\sqrt{ (8 - x)^2 \ + \ 1 \ }} \ = \ \cos \ \theta \ \ \ \text{and} \ \ \frac{(8 - x)}{1} \ = \ \tan \ \theta \ \ , $$

so the cost function becomes $ \ C(\theta) \ = \ 1.6 \ \sec \ \theta \ \ + \ \ ( 8 \ - \tan \ \theta) \ $ . We find the critical point from

$$ \frac{dC}{d\theta} \ = \ 1.6 \ \sec \ \theta \ \tan \ \theta \ \ - \ \ \sec^2 \ \theta \ \ = \ \ \sec \ \theta \ \cdot \ ( \ 1.6 \ \tan \ \theta \ - \ \sec \ \theta \ ) \ \ = \ \ 0 \ \ ; $$

since secant cannot be zero, the critical point is found from

$$ 1.6 \ \tan \ \theta \ - \ \sec \ \theta \ \ = \ \ 0 \ \ \Rightarrow \ \ 1.6 \ \sin \ \theta \ = \ 1 \ \ , $$

from which we obtain $ \ \theta \ \approx \ 38.7º \ $ , which produces the same distance value we determined above. This is related to Henry's remark, in which he suggests a physical analogy: light follows the path of least time from point $ \ A \ $ to $ \ R \ $ . If the "river" represents a medium with a refractive index of 1.6 , which takes light 1.6 times longer to pass through than it does in an equal length of air or vacuum, the "critical angle" path it would follow traveling through that medium and then emerging into air would look the same as that of our minimal-cost pipeline.