Answer:
P is exactly 3km east from the oil refinery.
Explanation:
Let's d be the distance in km from the oil refinery to point P. So the horizontal distance from P to the storage is 3 - d and the vertical distance is 2. Hence the diagonal distance is:
![√((3 - d)^2 + 2^2) = √((3 - d)^2 + 4)](https://img.qammunity.org/2020/formulas/mathematics/college/ns9eo4vt4hkdqvdmtis1pof8us4wxd600s.png)
So the cost of laying pipe under water with this distance is
![800000√((3 - d)^2 + 4)](https://img.qammunity.org/2020/formulas/mathematics/college/5wfcej8h3156pe2fafoydm3y2fdl62bhuh.png)
And the cost of laying pipe over land from the refinery to point P is 400000d. Hence the total cost:
![800000√((3 - d)^2 + 4) + 400000d](https://img.qammunity.org/2020/formulas/mathematics/college/gytjsnsbp2ltzve9gp9jqim8rv85doh9y6.png)
We can find the minimum value of this by taking the 1st derivative and set it to 0
![800000(2*0.5*(3-d)(-1))/(√((3 - d)^2 + 4)) + 400000 = 0](https://img.qammunity.org/2020/formulas/mathematics/college/b35fhskajxxoz7d10okl724hntyn6zzdsx.png)
We can move the first term over to the right hand side and divide both sides by 400000
![1 = 2(3 - d)/(√((3 - d)^2 + 4))](https://img.qammunity.org/2020/formulas/mathematics/college/x3h330bu91vnl3fcv6f2me6ir2uaa5remr.png)
![√((3 - d)^2 + 4) = 6 - 2d](https://img.qammunity.org/2020/formulas/mathematics/college/f6y1vpcgty49gdk2jk37gkgumkl5kb4kka.png)
From here we can square up both sides
![(3 - d)^2 + 4 = (6 - 2d)^2](https://img.qammunity.org/2020/formulas/mathematics/college/b7ckszj1p1p25199b3mcxhexc671vfgzh2.png)
![9 - 6d + d^2 + 4 = 36 - 24d + 4d^2](https://img.qammunity.org/2020/formulas/mathematics/college/4n5yqm4409kqjwqwsazr38w9aa269z8jp3.png)
![3d^2-18d+27 = 0](https://img.qammunity.org/2020/formulas/mathematics/college/362br8y9jp2rx9ernvj5eebjbiebi0w1dn.png)
![d^2 - 6d + 9 = 0](https://img.qammunity.org/2020/formulas/mathematics/college/zbzb9yadr7u730yfk2sycmw5xarenou27q.png)
![(d - 3)^2 = 0](https://img.qammunity.org/2020/formulas/mathematics/college/wgcsk46vrjl7zex7w07xmiahou60e83diu.png)
![d -3 = 0](https://img.qammunity.org/2020/formulas/mathematics/college/7mr15sbq11z6chcvcew2dp94p12h4tktcu.png)
d = 3
So the cost of pipeline is minimum when P is exactly 3km east from the oil refinery.