# Thread: Optimization; find my error

1. ## Optimization; find my error

an offshore oil well located 5km from the shore. That point is 8km from the oil collection facility. It costs a million dollars per km to build piping in the water and 500,000 dollars per km to build piping on the shore. What location should you place the point where the shore and sea connection to minimize the cost of laying the piping?

Cost = c

$c=1,000,000WP + 500,000PB$

$WP=\sqrt{(WA)^2 + (AP)^2}$

$AP= 8km-PB$

$WP=\sqrt{25+(8-PB)^2}=\sqrt{89-16PB+(PB)^2}$

$c=1,000,000\sqrt{89-16PB+(PB)^2} + 500,000PB$

$dc/dPB = 1,000,000$ $\frac{-16+2PB}{2 \sqrt{89 - 16PB + (PB)^2}}$ $+ 500,000 = 0$

$-\sqrt{89-16PB+(PB)^2}=-16+2PB$

$89-16PB+(PB)^2 = 256-32PB+4(PB)^2$

$3(PB)^2-16PB+167=0$

oops, The quadratic gives me a negative square root. Where did I go wrong?

P.S. I've solved this done by turning AP into x and PB into 8-x. I get the solution that way. I was trying to do it as above and I cannot get it, Both methods should give me the answer, but THIS way won't work for some reason.

2. Originally Posted by Tclack
an offshore oil well located 5km from the shore. That point is 8km from the oil collection facility. It costs a million dollars per km to build piping in the water and 500,000 dollars per km to build piping on the shore. What location should you place the point where the shore and sea connection to minimize the cost of laying the piping?

Cost = c

$c=1,000,000WP + 500,000PB$

$WP=\sqrt{(WA)^2 + (AP)^2}$

$AP= 8km-PB$

$WP=\sqrt{25+(8-PB)^2}=\sqrt{89-16PB+(PB)^2}$

$c=1,000,000\sqrt{89-16PB+(PB)^2} + 500,000PB$

$dc/dPB = 1,000,000\frac{-16+2PB}{2\sqrt{89-16PB+

(PB)^2}}+500,000=0$

$-\sqrt{89-16PB+(PB)^2}=-16+2PB$

$89-16PB+(PB)^2 = 256-32PB+4(PB)^2$

$3(PB)^2-16PB+167=0$

oops, The quadratic gives me a negative square root. Where did I go wrong?

P.S. I've solved this done by turning AP into x and PB into 8-x. I get the solution that way. I was trying to do it as above and I cannot get it, Both methods should give me the answer, but THIS way won't work for some reason.
For starters I'd make things easier by:

1. Working in units of millions of dollars.

2. Let PB = x.

Then:

$c= WP + \frac{x}{2}$

$WP=\sqrt{(WA)^2 + (AP)^2}$

$AP= 8 - x$

$WP =\sqrt{25+(8-x)^2} =\sqrt{89-16x + x^2}$

$c= \sqrt{89-16x + x^2} + \frac{x}{2}$

$\frac{dc}{dx} = \frac{-16+2x}{2\sqrt{89-16x + x^2}}+ \frac{1}{2}=0$

$-\sqrt{89-16x+x^2}=-16+2x$

$89-16x+x^2 = 256-{\color{red}64}x + 4x^2$

$3x^2-{\color{red}48}x+167=0$

3. It's such a simple error. Thanks, but I think my setup may be wrong.
This answer simplifies to $8 +/- \frac{5\sqrt{3}}{3}$

The actual answer is $+/-\frac{5}{\sqrt{3}}$

What's wrong with the setup?

4. Ah, nevermind, This actually makes sense, If you multiply by

$\frac{\sqrt{3}}{\sqrt{3}}$

You get $8+/- \frac{5}{\sqrt{3}}$

Which makes complete sense. 8 being the km. The way my book solves it, uses line AP as x, and my answer is 8-x.