# Optimization to minimize the cost of a function

Question -

An offshore oil well must be connected by pipe to the refinery. The oil-well is 4 km off-shore. The refinery is on the coast, 6 km from the nearest point of land to the oil well. It costs $s$ dollars per kilometer to lay pipe along the shore, but $u$ times as much per km to lay pipe underwater. The pipe may be laid either straight to the refinery, or to an intermediate point on the coast then along the coast.

1) Give the total cost as a function of the distance, $x$, between the point directly opposite the oil well and the place where the pipe comes ashore. This should be a formula involving $x$, $s$ and $u$

2) Then find the $x$-value of the critical point of this cost function. This point will be a function of $u$.

Working -

1) For part (1), I used Pythagoras Theorem and found that the total cost as a function of the total distance $x$ was given as $C(x)= su\sqrt{16+x^2}+s(6-x)$.