Given the points (3,1) and (5,-1), we can find the slope with the following formula:

In this case we have the following:

now that we have that the slope is m = -1, we can find the equation using the first point and the point-slope formula:

therefore, the equation of the line is y = -x+4