Answer: the train traveled 43km southwards
Explanation:
First, let's define.
North as the positive y-axis.
East as the positive x-axis.
And the initial position of the train is (0, 0).
Now, we know that:
"A train first travels east for 20 kilometers."
The new position will be:
(0, 0) + (20km, 0) = (20km , 0)
"Then it turns north and travels for 43 kilometers."
The new position will be:
(20km, 0) + (0, 43km) = (20km, 43km)
"Next it goes west for 20 kilometers."
If East if the positive x-axis, then West is the negative x-axis.
The new position of the train will be:
(20km, 43km) + (-20km, 0) = (0, 43km)
Then it travels south for an unknown number of kilometers, such that the final position is the same as the initial position, then if the train goes X kilometers to the south (and because North is the positive y-axis, South will be the negative y-axis), we have:
(0, 43km) + (0, -X) = (0, 0)
(0, 43km - X) = (0, 0)
Then we must have that:
43km - X = 0
43km = X
This means that the train traveled 43km southwards.