From N15W to N32E, the whole angle is 15+32 = 47 degrees.

After 2 hours, 25*2 = 50 nautical miles, 20*2 = 40 nautical miles.

So the figure is a triangle with known two sides and their included angle.

If x = the unknown side, which is the distance between the ships after 2 hours,then, by Law of Cosines,

x^2 = (50)^2 +(40)^2 -2(50)(40)cos(47deg)

Continue that and you will get the answer.