A car company tested a sports car on a road with different inclines. The test driver tested the car by driving a distance of x miles on a flat road, (x2 + 3) miles downhill, and (x − 7) miles uphill. Which simplified expression is equivalent to the total distance, in miles, for which the car was tested?

3x2 − 4
3x2 + 10
x2 + 2x − 4
x2 + 2x + 10