Let d1 be the distance of the first boat to the lighthouse. Then
tan(36) = 50/d1
or
d1 = 50/tan(36) ≈ 68.819096023558677
Let d2 be the distance of the second boat to the lighthouse. Then
tan(25) = 50/d2
or
d2= 50/tan(25) ≈ 107.225346025477931
107.225346025477931 - 68.819096023558677 ≈ 38 (to the nearest meter)