Let the island be located at (0, -30). Call this point "C." Then, if Boat A travels 30 miles north, then it ends up at (0,0). Call this point "A." And if Boat B travels 40 miles west from (0, -30), it ends up at (-40, -30). Call this point "B."
So A would have to travel 30 miles south and 40 miles west to reach B. Then, we have a triangle ABC and we need to find angle BAC. This = atan(-40 / -30) = 53.13 degrees = about S 53 degrees 8 minutes W
I think that's it......