Question 1180675
<pre>
Let the northbound train's rate be r km/h
Then the westbound train's rate is r+5 km/h

After 2 hours, using d = rt

the northbound train's distance is 2r
the westbound train's distance is 2(r+5)

We use the Pythagorean theorem to write an
expression for their distance apart, which
is the hypotenuse of a right triangle.

distance ap[art = {{{sqrt((2(r+5))^2+(2r)^2)}}}

Make the drawing

{{{drawing(400,1000/3,-5,1,-1,4,
locate(.1,1.5,2r),
locate(-4,2,sqrt((2(r+5))^2+(2r)^2)),
line(-4,0,0,0), line(0,0,0,3), line(-4,0,0,3),
locate(-2,0,2(r+5)) )}}}

{{{sqrt((2(r+5))^2+(2r)^2)}}}{{{""=""}}}{{{50}}}

Square both sides:

{{{(2(r+5))^2+(2r)^2}}}{{{""=""}}}{{{2500}}}

That simplifies to 

{{{8r^2+40r-2400}}}{{{""=""}}}{{{0}}}

Which conveniently can be divided through by 8

{{{r^2+5r-300}}}{{{""=""}}}{{{0}}}

which is conveniently factorable as

{{{(r+20)(r-15)}}}{{{""=""}}}{{{0}}}

r+20 = 0;   r-15 = 0
   r = -20;    r = 15

Ignore the negative answer.

The northbound train's rate is 15 km/h
The westbound train's rate is 15+5=20 km/h

Edwin</pre>