Given ensuing information, determine the least cost and the least cost mix of on- and off-shore pipe.

-The intake facility is in the water 2 miles vertically north of the shoreline
-The water filtration plant is on land 1 mile vertically south of the shoreline
-The intake and the plant are horizontally 3 miles apart
-The cost to lay pipe off-shore is $60,000 per mile and the cost to lay pipe on-shore is $30,000 per mile
-The shoreline runs east and west in a horizontal straight line

2 answers

Nice twist to a standard question.

I picked a point on the shoreline x miles horizonatally from the intake, leaving 3-x horizontally to the plant
I let the diagonal in the water be D1 and the diagonal on land D2

I see two right-angled triangles
one with sides 2, x and D1
the other with 1, 3-x and D2

cost = 60000D1 + 30000D2
= 60000(x^2+4)^(1/2) + 30000(1 + (3-x)^2)^(1/2
= 30000( 2(x^2+4)^(1/2) + (1 + (3-x)^2)^(1/2)
= 30000( 2(x^2+4)^(1/2) + (x^2 - 6x + 10)^2)^(1/2)

d(cost)/dx = 30000( (x^2+4)^(-1/2) (2x) + (1/2)(x^2 - 6x + 10)^(-1/2) (2x-6) )
= 0 for a min of cost

2x/(√(x^2+4) +(x-3)/√(x^2 - 6x + 10) = 0
2x/√(x^2+4) = (3-x)/(√(x^2 - 6x + 10)

square both sides
4x^2/(x^2 + 4) = (3-x)^2/(x^2 - 6x + 10)

after cross-muliplying, collecting all like terms and dividing each term by 3 I get

x^4 - 6x^3 + 9x^2 + 8x - 12=0
I tried x = ±1, ±2, ±3, ±4, ±6
and fortunately it worked for x=1

Wolfram gave me two real numbers
x = 1 and x = - 1.11169 , of course a negative makes no sense

x = 1

least cost = 60000√5 + 30000√5
= $ 201246

It might be a good idea to check my arithmetic and algebra
thank you