You are correct. It involves the Law of Cosines.

After t hours,

One train travelled 90t miles.

The other, 75t miles.

When they are 400 miles apart, you figure an obtuse triangle with 130 degrees between 90t and 75t, and opposite the 400mi side. By Law of Cosines,

400^2 = (90t)^2 +(75t)^2 -2(90t)(75t)cos(130deg)

160,000 = 8100t^2 +5625t^2 -(-8677.63t^2)

160,000 = 22,402.63t^2

t^2 = 160,000 / 22,402.63 = 7.142

t = sqrt(7.142) = 2.67 hours.

Therefore, after 2.67 or 2 and 2/3 hours, the trais are 400mi apart. -----answer.