Going a distance d miles at x miles per hour takess d/x hours. Going a distance d at y miles per hour takes d/y hours.
So the total trip, 2d miles, required d/x+ d/y= d(x+ y)/xy hours. The average speed for the entiire trip was "distance divided by time"= 2d/[d(x+y)/xy]= 2xy/(x+ y) miles per hour. We are told that is 50 miles per hour so have 2xy/(x+ y)= 50. xy/(x+ y)= 25. xy= 25(x+ y)= 25x+ 25y. xy- 25y= y(x- 25)= 25x. y= 25x/(x- 25). Mathematically x can be any number except 25 miles per hour. Practically, there are limits as to how fast he can go and, of course, x cannot be negative.