## The Slope of a Linear Function

### Learning Outcomes

• Define slope for a linear function
• Calculate slope given two points
• Interpret the slope of a linear function that models a real-world situation

Writing the equation that describes a linear function follows the same procedure for writing the equation of a line. You may be familiar with the slope-intercept form of a linear equation, where $m$ stands for the slope of the line and $b$ represents the y-intercept, the place where the line crosses the y-axis of the graph.

When discussing a linear function, ordered pairs of the form $\left(x, y\right)$ are written using function notation as $\left(x, f(x)\right)$. The slope can be thought of as a rate of change in function output over a corresponding interval of input.

$\begin{array}{cc}\text{Equation form}\hfill & y=mx+b\hfill \\ \text{Function notation}\hfill & f\left(x\right)=mx+b\hfill \end{array}$

We can calculate the slope $m$ of a line given two points on the line, $\left(x_1, y_1\right)$ and $\left(x_2, y_2\right)$ by using the formula

$m=\dfrac{\text{change in output (rise)}}{\text{change in input (run)}}=\dfrac{\Delta y}{\Delta x}=\dfrac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}$,

where $\Delta y$ represents the difference between the $y$ coordinates and $\Delta x$ represents the corresponding difference between the $x$ coordinates.

In a linear function, the coordinates of the points on the graph of a function represent input and output values for the function. The ordered pairs are written $\left(x_1, f(x_1)\right)$ and $\left(x_2, f(x_2)\right)$, and the formula for slope may be written equivalently as the formula for average rate of change

$m=\dfrac{f\left({x}_{2}\right)-f\left({x}_{1}\right)}{{x}_{2}-{x}_{1}}$.

The units for slope or for a rate of change are expressed as a ratio of output units over input units in the form

$\dfrac{\text{units for the output}}{\text{units for the input}}$.

Read these units as “change in units of the output value for each unit of change in input value.” For example, a rate may be given in miles per hour or a wage given in dollars per day.

### Calculating Slope

The slope, or rate of change, of a function $m$ can be calculated using the following formula:

$m=\dfrac{\text{change in output (rise)}}{\text{change in input (run)}}=\dfrac{\Delta y}{\Delta x}=\dfrac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}$

where ${x}_{1}$ and ${x}_{2}$ are input values, ${y}_{1}$ and ${y}_{2}$ are output values.

Given the equation of a line or a linear function in slope-intercept form, certain behavior of the graph can be seen by examining the value of $m$ in the equation $y=mx+b$ or the function $f(x)=mx+b$.

• When the slope of a line or the rate of change of a linear function is positive, $m \gt 0,$ it will describe an “uphill” line in the plane, rising from left to right as the input increases.
• When the slope of a line or the rate of change of a linear function is negative, $m \lt 0,$ it will describe a “downhill” line in the plan, falling from left to right as the input increases.
• When the slope of a line or the rate of change of a linear function is 0, $m = 0,$ it will describe a flat, horizontal line in the plane, neither rising nor falling as the input increases.

Watch the video below to see how to find the slope of a line passing through two points and then determine whether the line is increasing, decreasing or neither.

Watch the next video to see an example of an application of slope in determining the increase in cost for producing solar panels given two data points.

The following video provides an example of how to write a function that will give the cost in dollars for a given number of credit hours taken, x.