
## SectionThe Slope of a Line

The set of all solutions to a linear equation in two variables can be represented on a rectangular coordinate plane using a straight line through at least two points; this line is called its graph. For example, to graph the linear equation $8x+4y=12$ we would first solve for $y\text{.}$

\begin{align*} 8x+4y\amp = 12\\ 4y \amp = -8x+12\\ y\amp =\frac{-8x+12}{4}\\ y\amp = \frac{-8x}{4}+\frac{12}{4}\\ y\amp = -2x+3 \end{align*}

Written in this form, we can see that $y$ depends on $x\text{;}$ in other words, $x$ is the independent variable and $y$ is the dependent variable. Choose at least two $x$-values and find the corresponding $y$-values. It is a good practice to choose zero, some negative numbers, as well as some positive numbers. Here we will choose five $x$ values, determine the corresponding $y$-values, and then form a representative set of ordered pair solutions.

 $x$ $y$ $y=-2x+3$ Solutions $-2$ $7$ $y=-2(\alert{-2})+3=4+3=7$ $(-2,7)$ $-1$ $5$ $y=-2(\alert{-1})+3=2+3=5$ $(-1,5)$ $0$ $3$ $y=-2(\alert{0})+3=0+3=3$ $(0,3)$ $4$ $-5$ $y=-2(\alert{4})+3=-8+3=-5$ $(4-5)$ $6$ $-9$ $y=-2(\alert{6})+3=-12+3=-9$ $(6,-9)$

Plot the points and draw a line through the points. We add arrows on either end to indicate that the graph extends indefinitely.

The resulting line represents all solutions to $8x+4y=12\text{,}$ of which there are infinitely many. The above process describes the technique for graphing known as plotting points. This technique can be used to graph more complicated functions.

The steepness of any incline can be measured as the ratio of the vertical change to the horizontal change. For example, a $5$% incline can be written as $\frac{5}{100}\text{,}$ which means that for every 100 feet forward, the height increases 5 feet.

In mathematics, we call the incline of a line the slope, denoted by the letter $m\text{.}$ The vertical change is called the rise and the horizontal change is called the run. Given any two points $(x_1,y_1)$ and $(x_2,y_2)\text{,}$ we can obtain the rise and run by subtracting the corresponding coordinates.

This leads us to the slope formula. Given any two points $(x_1,y_1)$ and $(x_2,y_2)\text{,}$ the slope is given by the following formula:

\begin{gather*} \alert{\text{Slope }}= m=\frac{rise}{run}=\frac{y_2-y_1}{x_2-x_1}=\frac{\Delta y}{\Delta x}= \alert{\frac{\text{Change in }y}{\text{Change in }x}}\text{.} \end{gather*}

The Greek letter delta $(\Delta)$ is often used to describe the change in a quantity. Therefore, the slope is sometimes described using the notation $\frac{\Delta y}{\Delta x}\text{,}$ which represents the change in $y$ divided by the change in $x\text{.}$

###### Example70

Find the slope of the line passing through $(-3, -5)$ and $(2, 1)\text{.}$

Solution

Given $(-3, -5)$ and $(2, 1)\text{,}$ calculate the difference of the $y$-values divided by the difference of the $x$-values. Take care to be consistent when subtracting the coordinates.

Let $(x_1,y_1)=(-3,-5)$ and $(x_2,y_2)=(2,1)\text{.}$

\begin{equation*} \begin{aligned} m\amp = \frac{y_2-y_1}{x_2-x_1}\\ \amp =\frac{1-(-5)}{2-(-3)}\\ \amp =\frac{1+5}{2+3}\\ \amp =\frac{6}{5} \end{aligned} \end{equation*}

The slope is given by $m=\frac{6}{5}\text{.}$

It does not matter which point you consider to be the first and second when calculating slope. However, because subtraction is not commutative, you must take care to subtract the coordinates of the first point from the coordinates of the second point in the same order. To demonstrate this we obtain the same result in the example above if we apply the slope formula with the points switched.

Let $(x_1,y_1)=(2,1)$ and $(x_2,y_2)=(-3,-5)\text{.}$

\begin{equation*} \begin{aligned} m\amp = \frac{y_2-y_1}{x_2-x_1}\\ \amp =\frac{-5-1}{-3-2}\\ \amp =\frac{-6}{-5}\\ \amp =\frac{6}{5} \end{aligned} \end{equation*}

We can verify that the slope is $\frac{6}{5}$ by graphing the linear equation described in the previous example.

Certainly the graph is optional - the beauty of the slope formula is that, given any two points, we can obtain the slope using only algebra.

###### Example71

Find the $y$-value for which the slope of the line passing through $(6,-3)$ and $(-9,y)$ is $-\frac{2}{3}\text{.}$

Solution

Substitute the given information into the slope formula.

We have $m=-\frac{2}{3}$ and we can let $(x_1,y_1)=(6,-3)$ and $(x_2,y_2)=(-9,y)\text{.}$

\begin{equation*} \begin{aligned} m\amp = \frac{y_2-y_1}{x_2-x_1}\\ -\frac{2}{3}\amp =\frac{y-(-3)}{-9-6}\\ -\frac{2}{3}\amp =\frac{y+3}{-15}\\ \end{aligned} \end{equation*}

After substituting in the given information, the only variable left is $y\text{.}$ Solve for $y\text{.}$

\begin{equation*} \begin{aligned} \alert{-15}\left(-\frac{2}{3}\right)\amp = \alert{-15}\left(-\frac{y+3}{15}\right)\\ 10\amp = y+3\\ 7\amp = y \end{aligned} \end{equation*}

The $y$-value which satisfies the conditions above is $y=7\text{.}$

There are four geometric cases for the value of the slope.

Reading the graph from left to right, lines with an upward incline have positive slopes and lines with a downward incline have negative slopes. The other two cases involve horizontal and vertical lines. If $c$ is a real number we have

\begin{align*} y\amp =c \text{ whose graph is a } \alert{\text{horizontal line.}}\\ x\amp =c \text{ whose graph is a } \alert{\text{vertical line.}} \end{align*}

For example, if we graph $y=2$ we obtain a horizontal line, and if we graph $x=-4$ we obtain a vertical line.

From the graphs we can determine two points and calculate the slope using the slope formula.

 Horizontal Line Vertical Line Let $(x_1,y_1)=(-3,2)$ and $(x_2,y_2)=(3,2)\text{.}$ \begin{align*} m\amp = \frac{y_2-y_1}{x_2-x_1}\\ \amp = \frac{2-(2)}{3-(-3)}\\ \amp=\frac{2-2}{3+3}\\ \amp =\frac{0}{6}=0 \end{align*} Let $(x_1,y_1)=(-4,-1)$ and $(x_2,y_2)=(-4,1)\text{.}$ \begin{align*} m\amp = \frac{y_2-y_1}{x_2-x_1}\\ \amp = \frac{1-(-1)}{-4-(-4)}\\ \amp=\frac{1+1}{-4+4}\\ \amp =\frac{2}{0} \, \, \alert{\text{Undefined}} \end{align*}

Notice that the points on the horizontal line share the same $y$-values. Therefore, the rise is zero and hence the slope is zero. The points on the vertical line share the same $x$-values. Consequently, the run is zero, leading to an undefined slope. These give us the last two cases.

#### SubsectionMeaning of Slope

Consider the equation $C=4+2t$ representing the cost of a movie rental in terms of the number of days of the rental. If we graph this equation, we can choose any two points on the line to compute its slope. For example, if we choose the points $(0,4)$ and $(4,12)$ then we have the following slope.

\begin{equation*} m=\frac{12-4}{4-0}=\frac{8}{4}=2 \end{equation*}

The slope of the line is $2\text{.}$ In terms of renting a movie, our slope expression is telling us

\begin{equation*} \frac{\text{Change in Cost}}{\text{Change in Time}}=\frac{8 \text{ dollars}}{4 \text{ days}}\text{.} \end{equation*}

In other words, if we were to increase the length of the rental by $4$ days, the cost of the rental increases by $8$ dollars. The slope gives the rate of increase in the rental fee, $2$ per day.

In general, we say the slope of a line or equation measures the rate of change of the output variable with respect to the input variable. Depending on the units involved, this rate might be interpreted as a rate of growth or a rate of speed. A negative slope may represent a rate of decrease or a rate of consumption. The slope, or rate of change, of a graph can give us valuable information about the variables.

###### Example72

Nathan went hiking and took some trail mix. After hiking $2.5$ miles he had eaten $3$ ounces of trail mix. On average, how many ounces of trail mix did Nathan eat per mile?

Solution

The amount of trail mix that Nathan has eaten depends on how far he has hiked. This tells us that the independent variable is the distance he has hiked, in miles, and the dependent variable is the ounces of trail mix. We are looking for the average rate of change of ounces of trail mix per mile.

\begin{equation*} \frac{\text{change in ounces of trail mix}}{\text{change in miles climbed}}=\frac{3\text{ ounces}}{2.5\text{ miles}}=1.2 \text{ ounces per mile} \end{equation*}

This tells us that Nathan ate $1.2$ ounces of trail mix per mile on his hike.

### SubsectionLinear Functions

Given any linear equation in standard form, $ax+by=c,$ we can solve for $y$ to obtain slope-intercept form, $y=mx+b\text{.}$ For example,

\begin{align*} 3x-4y\amp =8\\ -4y\amp = -3x+8\\ y\amp =\frac{-3x+8}{-4}\\ y\amp = \frac{-3x}{-4}+\frac{8}{-4}\\ y\amp = \frac{3}{4}x-2\text{.} \end{align*}

Where $x=0\text{,}$ we can see that $y=-2$ and thus $(0,-2)$ is an ordered pair solution. This is the point where the graph intersects the $y$-axis and is called the $y$-intercept. We can use this point and the slope as a means to quickly graph a linear equation. For example, to graph $y=\frac{3}{4}x-2\text{,}$ start at the $y$-intercept $(0,-2)$ and mark off the slope to find a second point. Then use these points to graph the linear equation as follows:

Since this graph passes the vertical line test, this graph represents a function. Furthermore, the domain and range consist of all real numbers.

In general, a linear function is a function that can be written in the form

\begin{gather*} f(x)=mx+b \end{gather*}

where the slope $m$ and $b$ represent any real numbers. Since $y=f(x)\text{,}$ we can use $y$ and $f(x)$ interchangeably to represent the output, and ordered pair solutions on the graph $(x,y)$ can be written in the form $(x,f(x))\text{.}$

We know that any $y$-intercept of a graph will have an $x$-value equal to zero. Therefore, the $y$-intercept of a function $f$ can be expressed as the ordered pair $(0,f(0))\text{.}$ For linear functions,

Hence the $y$-intercept of the graph of any linear function is $(0,b)\text{.}$ To find the $x$-intercepts, the points where the graph of the function intersects the $x$-axis, we find $x$ where $y=0$ or $f(x)=0\text{.}$ It is possible for a function to have no $x$-intercepts.

###### Example73

Graph the linear function $f(x)=-\frac{5}{3}x+6$ and label the $x$-intercept.

Solution

From the function, we see that $f(0)=6$ (or $b=6$) and thus the $y$-intercept of the graph is $(0, 6)\text{.}$ Also, we can see that the slope is $m=-\frac{5}{3}=\frac{-5}{3}=\frac{\text{rise}}{\text{run}}\text{.}$ Starting from the $y$-intercept, mark a second point down $5$ units and right $3$ units. Draw the line passing through these two points.

To determine the $x$-intercept, find the $x$-value where the function is equal to zero. In other words, determine $x$ where $f(x)=0\text{.}$

\begin{equation*} \begin{aligned} f(x)\amp =-\frac{5}{3}x+6\\ 0\amp =-\frac{5}{3}x+6\\ \frac{5}{3}x\amp =6\\ \left(\alert{\frac{3}{5}}\right)\frac{5}{3}x\amp =\left(\alert{\frac{3}{5}}\right)6\\ x\amp=\frac{18}{5} \end{aligned} \end{equation*}

Therefore, the $x$-intercept is $\left(\frac{18}{5},0\right)\text{.}$ The general rule is to label all important points that cannot be clearly read from the graph.

###### Example74

Graph $f(x)=3x-2$ and label the $x$-intercept.

###### Example75

Determine a linear function that defines the given graph and find the $x$-intercept of the graph.

Solution

We begin by reading the slope from the graph. In this case, two points are given and we can see that $m=\frac{\text{rise}}{\text{run}}=\frac{-2}{3}\text{.}$

In addition, the $y$-intercept is $(0, 3)$ and thus $b=3.$ We can substitute these values into the equation for any linear function.

\begin{equation*} \begin{aligned} g(x)\amp =mx+b\\ g(x)\amp = -\frac{2}{3}x+3 \end{aligned} \end{equation*}

To find the $x$-intercept of the graph, we set $g(x)=0$ and solve for $x\text{.}$

\begin{equation*} \begin{aligned} g(x)\amp = -\frac{2}{3}x+3\\ 0\amp = -\frac{2}{3}x+3\\ \frac{2}{3}x\amp =3\\ \left(\alert{\frac{3}{2}}\right)\frac{2}{3}x\amp =\left(\alert{\frac{3}{2}}\right)3\\ x\amp = \frac{9}{2} \end{aligned} \end{equation*}

The linear function is given by $g(x)= -\frac{2}{3}x+3$ and the $x$-intercept is given by $\left(\frac{9}{2},0\right)\text{.}$

Next, consider horizontal and vertical lines. Use the vertical line test to see that any horizontal line represents a function, and that a vertical line does not.

Given any horizontal line, the vertical line test shows that every $x$-value in the domain corresponds to exactly one $y$-value in the range; it is a function. A vertical line, on the other hand, fails the vertical line test; it is not a function. A vertical line represents a set of ordered pairs where all of the elements in the domain are the same. This violates the requirement that functions must associate exactly one element in the range to each element in the domain.

Given any real number $c\text{,}$ we can write a function defining a horizontal line as $f(x)=c\text{.}$

###### Example76

Graph $g(x)=-2$ and state the domain and range.

Solution

Here we are given a function that is equivalent to the equation $y=-2\text{.}$ This defines a horizontal line through $(0,-2)\text{.}$

The domain is given by $\mathbb{R}=(\infty,\infty)$ and the range is the single element set $\{-2\}\text{.}$

### SubsectionGraphical Interpretation of Linear Equations and Inequalities

We can use the ideas in this section to develop a geometric understanding of what it means to solve equations of the form $f(x)=g(x)\text{,}$ where $f$ and $g$ are linear functions. Using algebra, we can solve the linear equation $\frac{1}{2}x+1=3$ as follows:

\begin{align*} \frac{1}{2}x+1\amp =3\\ \frac{1}{2}x\amp =2\\ (2)\frac{1}{2}x\amp = (2)2\\ x\amp =4\text{.} \end{align*}

The solution to this equation is $x=4\text{.}$ Geometrically, this is the $x$-value of the intersection of the two graphs $f(x)=\frac{1}{2}x+1$ and $g(x)=3\text{.}$ The idea is to graph the two linear functions and determine where the graphs coincide.

###### Example77

Graph $f(x)=\frac{1}{2}x+1$ and $g(x)=3$ on the same set of axes and determine where $f(x)=g(x)\text{.}$

Solution

Here $f$ is a linear function with slope $\frac{1}{2}$ and its graph has $y$-intercept $(0,1)\text{.}$ The function $g$ is represented by a horizontal line. Graph both of these functions on the same set of axes.

From the graph we can see that $f(x)=g(x)$ where $x=4\text{.}$ In other words, $\frac{1}{2}x+1=3$ where $x=4\text{.}$

We can extend the geometric interpretation a bit further to solve inequalities. For example, we can solve the linear inequality $\frac{1}{2}x+1\geq 3\text{,}$ as follows:

The solution set consists of all real numbers greater than or equal to 4. Geometrically, these are the $x$-values for which the graph $f(x)=\frac{1}{2}x+1$ lies above the graph of $g(x)=3\text{.}$

###### Example78

Graph $f(x)=\frac{1}{2}x+1$ and $g(x)=3$ on the same set of axes and determine where $f(x)\geq g(x)\text{.}$

Solution

On the graph we can see this in the shaded portion:

From the graph we can see that $f(x)\geq g(x)$ or $\frac{1}{2}x+1\geq 3$ where $x\geq 4\text{.}$

This means that the $x$-values that solve the inequality, in interval notation, are $[4,\infty)\text{.}$