Ok so for optimization problems, there are 3 steps:
1) Find an objective function in terms of a single variable
2) Find the derivative of this function and set it equal to zero.
3) Solve for the variable.
What this does is allow us to find the point on the function where the slope(derivative) is 0, indicating a local minimum or maximum.
For this problem, it will give us the minimum since we want to minimize Cost.
Now for step 1)
First determine the variable. Here we want the distance to point P on north bank. Lets call it 'x'. The total east-west distance from refinery to storage is 9 km. So we know that 'x' must be less than 9.
The distance from P to the south bank is diagonal distance 'd', which can be found using pythagorean theorem.
The function we will use is the cost function.
Simplify it in terms of 100,000 units.
Cost = 2x + 4d
This function will tell us the cost of laying pipe given how far downriver point P is.
Step 2)
To minimize the cost, we need to find when slope is 0.
Find derivative of cost function.
Note:
Therefore
Step 3)
Solve derivative equation for x.
Usually this involves a lot of algebra and quadratic formula.
With a square root term, you want to isolate it on one side first. Then square both sides to get rid of the radical.
Remember x < 9, so the other solution from quadratic formula does not apply.
Ok we're done. The Cost is minimized when point P is 8.42 km downriver.