Let x be the time Theo had been driving, and y be the time Dan had been driving, then we can set the following system of equations:

Solving the first equation for x we get:

Substituting the above equation in the second equation, and solving for y we get:

Then, x=14-9=5.
Therefore, Theo had been driving for 5 hours and Dan had been driving for 9 hours.