By solving a system of equations, we will see that Train X travels 500km in 5 hours.
Remember the relation:
distance = speed*time.
First, if Sx is the speed of the train X and Sp is the speed of the train P, we know that:
Sx - 20 km/hr. = Sp
Then, we know that in the time T in which X travels 50 km, P travels 40km, we can write that as:
50km = Sx*T
40km = (Sx - 20km/hr)*T
So we have a system of equations.
Now we can solve this to find the speed Sx, to do it, we need to isolate T on one equation.
T = 50km/Sx.
Now we can replace that with the other equation:
40km = (Sx - 20km/hr)*50km/Sx.
Now we can solve this for Sx.
40km*Sx = (Sx - 20km/hr)*50km
40km*Sx = Sx*50km - 1,000 km^2/hr
40km*Sx - Sx*50km = -1,000 km^2/hr
-Sx*10km = -1,000 km^2/hr
Sx = (-1,000 km^2/hr)/(-10 km) = 100km/h
Now we want to know how long the train X takes to travel 500km, so we need to solve:
500km = 100km/h*T
500km/(100km/h) = 5h = T.
The train will travel 500km in 5 hours.
If you want to learn more about systems of equations, you can read:
https://brainly.com/question/13729904