# How do you write the equation of a line given (5,1), (8,-2)?

##### 1 Answer
Jan 9, 2017

Use the formula for slope to calculate the slope then use the point-slope formula to obtain the equation for the line.

See full explanation below:

#### Explanation:

First, use the two points to determine the slope of the line:

The slope can be found by using the formula: $m = \frac{\textcolor{red}{{y}_{2}} - \textcolor{b l u e}{{y}_{1}}}{\textcolor{red}{{x}_{2}} - \textcolor{b l u e}{{x}_{1}}}$

Where $m$ is the slope and ($\textcolor{b l u e}{{x}_{1} , {y}_{1}}$) and ($\textcolor{red}{{x}_{2} , {y}_{2}}$) are the two points on the line.

Substituting the values from the problem gives:

$m = \frac{\textcolor{red}{- 2} - \textcolor{b l u e}{1}}{\textcolor{red}{8} - \textcolor{b l u e}{5}}$

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

$m = - 1$

We can now use the point-slope formula using either point from the problem and the slope we calculated to determine the equation of the line.

The point-slope formula states: $\left(y - \textcolor{red}{{y}_{1}}\right) = \textcolor{b l u e}{m} \left(x - \textcolor{red}{{x}_{1}}\right)$

Where $\textcolor{b l u e}{m}$ is the slope and $\textcolor{red}{\left(\left({x}_{1} , {y}_{1}\right)\right)}$ is a point the line passes through.

Substitution gives:

$\left(y - \textcolor{red}{- 2}\right) = \textcolor{b l u e}{- 1} \left(x - \textcolor{red}{8}\right)$

$\left(y + \textcolor{red}{2}\right) = \textcolor{b l u e}{- 1} \left(x - \textcolor{red}{8}\right)$

We can solve for $y$ to put this equation into the more familiar slope-intercept form:

$y + \textcolor{red}{2} = \textcolor{b l u e}{- 1} x - \left(\textcolor{b l u e}{- 1} \times \textcolor{red}{8}\right)$

$y + \textcolor{red}{2} = - x - \left(- 8\right)$

$y + \textcolor{red}{2} = - x + 8$

$y + \textcolor{red}{2} - 2 = - x + 8 - 2$

$y + 0 = - x + 6$

$y = - x + 6$