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:
[tex]\begin{gathered} x+y=14 \\ x(20)+y(25)=325 \end{gathered}[/tex]Solving the first equation for x we get:
[tex]x=14-y[/tex]Substituting the above equation in the second equation, and solving for y we get:
[tex]\begin{gathered} (14-y)(20)+25y=325 \\ 280-20y+25y=325 \\ 5y=45 \\ y=9 \end{gathered}[/tex]Then, x=14-9=5.
Therefore, Theo had been driving for 5 hours and Dan had been driving for 9 hours.