Answer:
Data that we know:
He drove 504km in each direction.
Going, the average speed was 14km/h more than returning.
The total trip lasted 21 hours.
Ok, to solve this first:
Let's define the variables:
Sg = Average speed when going.
Sr = Average speed when returning.
Then we can write one of our relationships as:
Sg = Sr + 14km/h.
Now, you can recall the relation:
Time = Distance/speed.
Then we can write the equation that represents the total time of the travel as:
504km/Sg + 504km/Sr = 21h
Now we can replace the Sg by Sr + 14km/h, and get:
504km/(Sr + 14km/h) + 504km/Sr = 21h.
Now we must multiplacate by each denominator, in order to remove them:
504km*Sr + 504km*(Sr + 14km/h) = 21h*Sr*(Sr + 14km/h)
Sr*1008km + 7056km^2/h = 21h*Sr^2 + 294km*Sr
Now we can write a cuadratic equation, where i will ignore the units so it is easier to read, as:
21*Sr^2 -714*Sr - 7056 = 0
The solutions are given by the Bhaskara formula:

We have two solutions, one negative and one positive, and because Sr represents an average speed, it must be a positive number, then we choose the positive solution:
Sr = (714 + 1050)/42 km/h = 42km/h
Now we have the average speed for the returning, with this we can find Sg.
Sg = Sr + 14km/h = 42km/h + 14km/h = 56km/h.