# 1.2 Writing Equations of Straight Lines

## Calculating the slope of a line

The slope of a line is a measure of the steepness of the line.

If a line rises from left to right, the slope is a positive value.
If a line falls from left to right, the slope is a negative value.
The slope of a horizontal line is zero.
The slope of a vertical line is undefined.

To calculate the slope of a line knowing two (x, y) points, we can proceed as follows:
1) Label each (x, y) point as (x1, y1) and (x2, y2).
2) Substitute these numerical values into the slope formula as follows, where m is the slope of the line:

$m=\frac{y_2-y_1}{x_2-x_1}$

Example:
Calculate the slope of the line containing the points (1, 5) and (2, -1)

Solution:
1) Label each (x, y) point as (x1, y1) and (x2, y2):   Label the point (1, 5) as (x1, y1) and label the point (2, -1) as (x2, y2).
2) Substitute these numerical values into the slope formula as follows, where m is the slope of the line:

$m=\frac{y_2-y_1}{x_2-x_1}=\frac{-1-5}{2-1}=\frac{-6}1=-6$

## Equations of Straight Lines

The equation of a straight line is often written in the format:

$y = mx + b$

where m is the slope of the line, and
b is the y-intercept of the line.

This format for a straight line is called the “slope-intercept” form of the line.

For example the equation:

$y = 10x + 2$

would indicate a line with slope of 10 and y-intercept of 2.

In some cases, an alternate format is convenient, called “point-slope” formula:

$y - y_1 = m(x - x_1)$

where $(x1, y1)$ is a point falling on the line, and
m is the slope of the line.

In Calculus applications, we will obtain the slope from a “derivative function” and use that slope to write the equation of a line using this point-slope formula:

Example:
Write the equation of a line with slope of -2 and passing through the $(x, y)$ point of $(7, -3)$

Solution:
Start out with the point slope formula:

$y - y_1 = m(x - x_1)$

Replace m with -2 and replace $(x_1, y_1)$ with the given point $(7, -3)$, so that $x_1 = 7$ and $y_1 = -3$:

$y - (-3) = -2(x - 7)$

$y + 3 = -2x + 14$

$y = -2x + 11$ 