Let s be the number of hours that Nick swam and r the number of hours that he ran, then we can set the following system of equations:
[tex]\begin{gathered} s\cdot3+r\cdot9=58.5 \\ s+r=8.5 \end{gathered}[/tex]Solving the second equation for s, and substituting in the first equation we get:
[tex]\begin{gathered} (8.5-r)\cdot3+r\cdot9=58.5 \\ 25.5-3r+9r=58.5 \\ 6r=33 \\ r=5.5 \end{gathered}[/tex]Substituting r=5.5 in the second equation, and solving for s we get:
[tex]\begin{gathered} s+5.5=8.5 \\ s=3 \end{gathered}[/tex]Therefore he swam for 3 hours and ran 5.5 hours.