Equation of a line in slope-intercept form
[tex]y=mx+b[/tex]where m is the slope and b is the y-intercept.
The slope of the line that passes through the points (x₁, y₁) and (x₂, y₂) is calculated as follows:
[tex]m=\frac{y_2-y_1}{x_2-x_1}[/tex]This line passes through (2,5) and (6,1), then its slope is:
[tex]m=\frac{1-5}{6-2}=\frac{-4}{4}=-1[/tex]Substituting with the point (2, 5) and m = -1 into the general equation and solving for b:
[tex]\begin{gathered} 5=\lparen-1)\cdot2+b \\ 5=-2+b \\ 5+2=b \\ 7=b \end{gathered}[/tex]Substituting with m = -1 and b = 7 into the general equation, the equation of this line is:
[tex]y=-x+7[/tex]