The situation forms a right triangle.
So, we can apply the Pythagorean theorem:
c^2 = a^2+b^2
where:
c = hypotenuse ( the longest side) = x (distance between the boat and the harbor)
a & b = the other 2 legs of the triangle
Replacing:
x^2 = 38^2+37^2
Solve for x:
x^2 = 1444+1369
x^2 = 2813
x= √2813
x = 53
Answer = 53 miles