Since we have two points the first thing I would do is calculate the gradient of the line.
We can use the formula gradient(m) #=(Deltay)/(Deltax) = (y_2 - y_1) / (x_2 - x_1)#
We then need to select our values to substitute into the equation, for this we will take our first point #(2,1)# and make #x_1 = 2# and #y_1 = 1#. Now take the second point #(5 -1)# and make #x_2 = 5# and #y_2 = -1#. Simply substitute the values in the equation:
gradient(m) #=(Deltay)/(Deltax) = (y_2 - y_1) / (x_2 - x_1) = (-1 - 1) / (5 - 2) = (-2)/(3)#
Now that we have the gradient substitute that into #y = mx + c# so that #y = (-2)/3x +c#
To find #c# we need to use one of the given points, so substitute one of these points into our equation: #y = (-2)/3x +c# In this explanation we will use #(2,1)#. So #1 = (-2)/(3)(2) +c#
Now solve as a linear equation to obtain #c#:
#1 = (-4)/(3) +c #
#1 - (-4)/(3) = c#
#(7) / (3) = c#
#c = (7) / (3)#
Substitute the value for #c# into the equation: #y = (-2)/3x +c# so that #y = (-2)/3x +(7)/(3)#