Answer:
Given :
length offshore = CS=√(1+X^2)
Cable charged = 5000√(1+X^2)
onshore length = 4-X
laying cost = 3000(4-X)
total cost:
C=5000√(1+X^2) +3000(4-X)
DC/DX
= [5000*(0.5)*2X/{√(1+X^2)}]-3000=0... for optimum
5000X=3000√(1+X^2)
25X^2=3+3X^2
22X^2=3
X=√(3/22)
= 0.3693 miles
So, it would be laid offshore to S in a manner that
BS=X=0.3693 miles
Onshore=4-0.3693
=3.6307 miles