(Because of the input method, 0.5 is used instead of 1. )
According to the topic, a-0.5b = 1- equation a.
B+ 0.5a = 3- Equation B.
Equation a times 2+ equation B=2a+ a=5.
Namely: a=2
Bring a=2 into equation a and get b=2.
Answer to question 2:
Let the length of the train be x meters and the speed be y meters per second. Because the speed of the trains is the same, the following equation can be obtained:
( 1000-x)/40 = y( 1000+x)/60 = y
Solve the equation: y= 10 (m/s) x=600 (m)