We have:
x = rate you. 10 miles ---> t times
y = rate your friend. 8 miles ---> t times
and y = x - 2
then, the equation is:
[tex]\frac{10}{x}=\frac{8}{y}[/tex]solve the system:
[tex]\begin{gathered} \frac{10}{x}=\frac{8}{y} \\ \frac{10}{x}=\frac{8}{x-2} \\ 10\mleft(x-2\mright)=x\cdot\: 8 \\ 10x-20=x\cdot\: 8 \\ 10x-20+20=x\cdot\: 8+20 \\ 10x=x\cdot\: 8+20 \\ 10x-x\cdot\: 8=x\cdot\: 8+20-x\cdot\: 8 \\ 2x=20 \\ \frac{2x}{2}=\frac{20}{2} \\ x=10 \end{gathered}[/tex]then for y:
[tex]\begin{gathered} y=x-2 \\ y=10-2 \\ y=8 \end{gathered}[/tex]Answer:
10 mi/h and the friend 8 mi/h