Because the question asks for total distance pedaled, we can set up the following equations:


x represents the amount of hours James spent pedaling uphill.
y represents the amount of hours James spent pedaling downhill.
4 represents the miles per hour James goes while pedaling uphill.
6 represents the miles per house James goes while pedaling downhill.