Let [tex]f(x) = ax+b[/tex] be the line that passes through both points.
We know that [tex]f(5) = 1[/tex] and [tex]f(8) = -2[/tex]. So:
[tex]\begin{cases}5a+b = 1 \\ 8a+b = -2\end{cases}[/tex]
Solving the system, we get that a= -1 and b = 6.
So the line is equal to [tex]f(x) = 6-x[/tex].