The equation for Person A is y=5x+50 while the equation for Person B is y=15x. You want to set these two rates equal to each other to find out when they’re going to be the same price and just solve it out.
1) 5x+50=15x
2) 50=10x
3) x=5
So your answer is they will charge the same amount for 5 hours.