# How do you write an equation of a line through: (2,4) and (5,1)?

Dec 17, 2016

$y - 4 = - 1 \left(x - 2\right)$ or $y = - x + 6$

#### Explanation:

To write this equation we can use the point-slope formula. To use this formula we must first determine the slope.

The slope can be found by using the formula: color(red)(m = (y_2 = y_1)/(x_2 - x_1)
Where $m$ is the slope and $\left({x}_{1} , {y}_{1}\right)$ and $\left({x}_{2} , {y}_{2}\right)$ are the two points.

Using the two points given in the problem the slope is:

$m = \frac{1 - 4}{5 - 2}$

$m = - \frac{3}{3}$

$m = - 1$

Now we can use the point-slope formula to determine the equation:

The point-slope formula states: $\textcolor{red}{\left(y - {y}_{1}\right) = m \left(x - {x}_{1}\right)}$
Where $m$ is the slope and #(x_1, y_1) is a point the line passes through.

Using the slope we calculate and one of the points gives:

$y - 4 = - 1 \left(x - 2\right)$

Solving for $y$ to put this equation into the slope-intercept form gives:

$y - 4 = - x + 2$

$y - 4 + 4 = - x + 2 + 4$

$y - 0 = - x + 6$

$y = - x + 6$