In the last section, we showed how post-composition of a given function with another function (esp. addition and multiplication by constants) affects the function algebraically, numerically, and geometrically. We then applied our observations to develop a strategy for graphing. In this section, we will apply these principles to the identity function to obtain a deeper understanding of linear functions (i.e., functions which graph as straight lines).
In the last section, we showed how the three basic arithmetic operations (addition, multiplication, and negation) affect a function algebraically, numerically, and geometrically. In that section and in an accompanying worksheet, we practiced analyzing the affect of doing all three operations (via post-composition with r(x) = -2x + 1) on several more complicated functions (specifically, a "generic" function given by a table of points, the absolute value function, the square root function, and the greatest integer function). In this section, we want to think about what happens when we apply these operations to the identity function, f(x) = x. While this may seem like a trivial example, it will provide a new perspective on what may already be familiar material for you.
Algebraically, if we form , we are simply left with r, since . Geometrically, the graph of y = f(x) = x is simply a 45° line through the origin:

going through the points:
| x | y = f(x) = x |
|
. . . -1 0 1 . . . |
. . . -1 0 1 . . . |
Since this is a straight line, it is sufficient to plot only two points, but we will plot three points for good measure, at x = -1, 0, 1.
Using the technique we developed from the previous worksheet, we can analyze r, as follows:
| Corresponding Algebraic formula |
x | x | 2x | -2x | -2x + 1 |
|---|---|---|---|---|---|
| Geometric Effect | Take the graph
of the identity function |
Stretch vertically by a factor of 2 |
Flip the vertical axis | Shift vertically, up by 1 |
|
| Numerical Effect | Take the input | Apply the identity function |
Multiply by 2 | Multiply by -1 | Add 1 |
| Numerical Results |
Inputs | Outputs | |||
| -1 | -1 | -2 | 2 | 3 | |
| 0 | 0 | 0 | 0 | 1 | |
| 1 | 1 | 2 | -2 | -1 | |
so that r goes through the points:
| x | y = r(x) = -2x + 1 |
|
-1 0 1 |
3 1 -1 |
Notice that, while this analysis looks the same as that for y = -2ëxû + 1, since we know that this time the original graph, y = x, is a straight line, this time we can simply "connect-the-dots" to obtain the final graph.
To be more specific, we know that stretching a 45° line vertically by 2 will make the graph steeper. When we flip the vertical axis, the graph will switch from sloping upwards to sloping downwards (at the same angle). Finally, shifting up by 1 will simply shift the graph up 1 unit (keeping the angle the same); it will no longer goes through the origin, but will cross the y-axis at y = 1. We can verify this analysis by selecting the sequence of Examples from the following applet:
Based on this example, we can derive formulas for every sort of line in the plane. We begin with the two exceptional cases:
Vertical lines all have the same x-value, and so satisfy an equation of the form x = c.
Likewise, all horizontal lines share the same y-value, and so satisfy an equation of the form y = c.
Every other type of line can be obtained from y = x by stretching, flipping, and/or shifting vertically, so:
A line which is neither horizontal or vertical must be the graph of an equation of the form y = ± s x + t, where s > 0 is a scaling factor, t is the shift amount, and the sign tells us whether the graph slopes up or down.
This is why refer to an equation like y = -2x + 1, or a function like r(x) = -2x + 1, as "linear", since their graphs correspond to straight lines.
Make sure that you understand the geometry of linear equations by completing
the following exercises.
Based on our analysis in the previous section, we can view a linear function, f(x) = ± s x + t, algebraically, numerically, and geometrically.
Algebraically: This consists of a constant term, t, and a term which is a constant, ± s, times the input, x.
At this point, it is helpful to consider each term separately.
The constant term, t:
Geometrically: This corresponds to a vertical shift and gives the value on the vertical axis where the line crosses; this is called the vertical intercept. Because of the historically common practice of naming the dependent variable, , this may also be referred to as the y-intercept.
Numerically: This is the value of the function, when we plug in x = 0, f(0) = ± s(0) + t = 0 + t = t. Since we often view a graph as "starting" from the origin and moving outwards, we generally think of this as the "starting" value for the function.
The constant factor, s:
Geometrically: This corresponds to a vertical scaling; if s > 1, then this is a stretch and the line is steeper than 45°; if s < 1, then this is a shrink and the line is flatter than 45°.
Numerically: This gives the amount by which the function changes as the input increases by 1 unit.
The sign in front of s:
Geometrically: This indicates whether the graph is flipped or not; that is, whether the graph rises or falls as we move from left-to-right.
Numerically: This indicates whether the function increases or decreases as the input increases by 1 unit.
You can see this clearly in the example from the previous section:
| x | y = r(x) = -2x + 1 | |
|
-1 0 1 |
3 1 -1 |
"Starts" at y = 1 The "change", from 1 to -1, is by 2 units. In particular, it decreased by 2. |
Important: Notice that the function decreases by 2 every time we increase x by 1 unit; for example, when the input increases from -1 to 0, the output decreases from 3 to 1. This property actually characterizes linear functions; that is:
Any function that increases/decreases at a constant rate must be given by a linear equation, since its graph will necessarily be a straight line.
Armed with this understanding, we should now be able to work backwards from a table of values or graph of a function to derive its algebraic description. For example, looking at the table:
| x | y |
|
-1 0 1 |
-8 -2 4 |
we see that it "starts" at -2 and increases by 6 units at each step, so it must correspond to the equation y = 6x - 2. Similarly, looking at the graph:
we can make a table of points on this graph:
| x | y |
|
-1 0 1 2 3 |
3.5 3 2.5 2 1.5 |
to see that it "starts" at 3 and decreases by 0.5 = 1/2 as we increase x/move right 1 unit. This means that it must correspond to the equation y = -x/2 + 3.
We can even apply this analysis to create mathematical models in a variety of practical situations.
If the phone company charges you a monthly fee of $10 plus $.05/min., your monthly bill, b (in dollars), is a function of how many minutes, m, that you talk. Since your bill increases at a constant rate, by our previous observation, this must be a linear function of m, b = f(m). If you don't talk at all (i.e., m = 0), your bill will be b = 10; that is, your bill "starts" at 10, so the constant term of f must be 10. Each time you talk one more minute (i.e., m goes up by 1), b goes up by .05, so the scaling factor must be +.05, and f must be given by the equation, f(m) = .05m + 10. We can check this by imaging what our phone bill might be in various situations:
| m | b |
|
0 1 2 3 |
10 10.5 11 11.5 |
Say you are driving to Chicago at a constant speed of 70 mi./hr. from Pittsburgh, PA, a total distance of 475 mi. Then, the distance remaining, d (in miles), is a function of how many hours you have been driving, h, say d = g(h). We can calculate the distance remaining after several hours:
| h | d |
|
0 1 2 3 |
475 405 335 265 |
Every hour, the distance remaining drops by 70 mi., so the constant factor (including the sign) must be -70. Since we start at d = 475, g must be given by the equation, g(h) = -70h + 475.
Say you want to raise money by sponsoring a dance with a live band. You decide to sell tickets to the dance for $5 each, and the band costs $200 for the night. The amount of money that you will raise, m (in dollars), is a function of how many tickets that you sell, t, say m = h(t). Since you start "in the hole" by $200 for the band, but you raise $5 each time you sell a ticket (i.e., t goes up by 1), h must be given by the equation, h(t) = 5t - 200.
Notice that, in each case, the quantity whose units are a ratio ($/min., mi./hr., $/ticket) correspond to the scaling factor. Moreover, see how the units in each equation combine correctly, when we write in the units by each term.:
b ($) = .05 ($/min.) m (min.) + 10 ($): ($/min.) times (min.) leaves ($), and ($) + ($) = ($).
d (mi.) = -70 (mi./hr.) h (hr.) + 475 (mi.): (mi./hr.) times (hr.) leaves (mi.), and (mi.) + (mi.) = (mi.).
m ($) = 5 ($/ticket) t (tickets) - 200 ($): ($/ticket) times (tickets) leaves ($), and ($) - ($) = ($).
Checking the units in this manner is one way to verify that a mathematical model is reasonable.
Make sure that you can derive the equation for a linear function from a graph,
table, or applied setting, by completing the following exercises.
In the previous section, we were able to derive linear equations in a variety of situations. Specifically, if we were given a table or graph of a function where the values for inputs of 0 and 1 were clearly visible, it was an easy matter to write down the equations. Since a line is determined by any two points, we should be able to derive the equation for a linear function from its values at any two inputs. We can, and this follows from some basic algebra.
For example, if we know that a linear function, y = f(x) = a x + b takes the values:
| x | y = f(x) |
|
-3 2 |
4 8 |
we then know, by plugging-in y = f(x) = a x + b, that the two equations:
4 = a (-3)
+ b
8 = a (2)
+ b
must be true. Subtracting the second equation from the first gives:
4 - 8 = -3a - 2a + b - b
or -4 = -5a, so that a = 4/5 or 0.8. Plugging this value for a into the second equation gives 8 = (4/5) (2) + b, or b = 8 - 8/5 = 32/5 or 6.2. This means that f(x) = 4/5 x + 32/5 or f(x) = 0.8x + 6.2.
Although we can simply apply this procedure any time we wish to determine a linear equation, if we perform this procedure using variables in place of specific points, we can derive some useful formulas. Note: This is typically how all mathematical formulas are discovered -- by generalizing what we know from specific examples, and is one of the most important uses of Algebra. So let's repeat the previous calculation assuming that the linear function, y = f(x) = a x + b takes the values:
| x | y = f(x) |
|
x1 x2 |
y1 y2 |
Notice how we use the subscripts 1 and 2 to allow us to reuse the basic variables names, x and y, to create four different variables with descriptive names.
We then have the two equations:
y1 = a x1
+ b
y2 = a x2 + b
so that, by subtracting one equation from the other:
y1 - y2 = ax1 - ax2 + b - b
or y1 - y2 = a(x1 - x2), so that . We can summarize what we have discovered as follows:
If a linear function, f(x) = a x + b, goes through the two points (x1, y1) and (x2, y2) , then . This quantity is known as the slope of the line.
Note: We can plug the slope formula for a into the second equation to obtain the formula ; in practice, it is easiest to carry out the procedure to solve for b with specific numbers, since this formula is so complex.
This formula allows us to quickly determine the equation of a linear function from two points, read either from a table or graph. For example, consider the line:

Notice how the axes were chosen to intersect at (4,4), instead of (0,0); that is because we chose a plot window of [4,16] on the horizontal and vertical axes. There are three clearly identifiable points at (5, 7), (10, 10), and (15, 13). From this, we can calculate the slope of k, a = (10 - 7)/(10 - 5) = 3/5, so we know that k(x) = 3/5 x + b.
Since we cannot see where this graph will cross the y-axis, we need to solve for b. We can simply plug-in any one of these points and solve to determine b: 7 = k(5) = 3/5 (5) + b = 3 + b, so 7 = 3 + b, or 4 = b, and k(x) = 3/5 x + 4. Note: We will get the same equation, no matter what points on the graph we use to calculate the slope or plug-in to find b!
Even though we already have one geometric interpretation for the multiplier, a (as the scaling factor/steepness of the line together with a possible flip factor), this gives another powerful interpretation of this number. Since y1 - y2 measures the change in the outputs and x1 - x2 measures the change in inputs, their ratio, , measures the rate of change (increase or decrease) of the outputs relative to the inputs. Notice that, since (by multiplying top and bottom by -1), the order of the points is not important, as long as we are consistent.
As we mentioned before, this gives an effective test to see if a table of values corresponds to a linear formula:
If the slope calculated between any two input/output pairs of a function is always the same, the function must be given by a linear equation.
Note: It turns out that, if we are given a list of pairs, it is sufficient to only check all consecutive pairs in the list. For example, we can tell, without graphing, that:
| x | y = g(x) | slope |
|
-3 -1 0 3 7 |
7 3 1 -5 -13 |
(7-3)/(-3-(-1)) = -2 (3-1)/(-1-0) = -2 (1-(-5))/(0-3) = -2 (-5-(-13))/(3-7) = -2 |
will graph as a straight line, since the slopes are all the same. You may verify this in XFunctions by selecting g from the list of functions on the left:
In fact, it will be given by the equation g(x) = -2 x + 1, since it crosses the y-axis at 1. By selecting the Example, you can see that the plot of g and the plot of y = -2 x + 1 overlap completely.
In contrast, we can tell that:
| x | y = h(x) | slope |
|
-2 1 3 5 |
-5 -4 -3 -2 |
(-5-(-4))/(-2-1) = 1/3 (-4-(-3))/(1-3) = 1/2 (-3-(-2))/(3-5) = 1/2 |
will have a bend at x = 1; the slope of h changes from 1/3 to 1/2, so the graph will get steeper at that point. Again, you may verify this by selecting h from the list of functions:
Make sure that you can distinguish a linear function from a non-linear one, and
determine its equation from a graph or table, by completing the following exercises.
Go to Pre-Composition and Graphing
| Table of Contents | Glossary |