Sub topic 4
Linear functions: slope and intercepts
What this chapter assumes
You should be able to solve linear and quadratic equations, plot points on the coordinate plane, and read function notation such as f(x). The chapter on graphs showed how to plot a function by tabulating points. Here we look at the simplest function family and the facts about it that CAT questions use most often.
The working model
A linear function has the form
f(x) = mx + c
Here m is the slope and c is the y-intercept. The graph is a straight line.
- The slope m is the change in f(x) for each increase of 1 in x. It equals rise divided by run: m = (y2 − y1) / (x2 − x1).
- The y-intercept c is the value of f(0), the point where the line crosses the y-axis.
- The x-intercept is the input where f(x) = 0. Solving mx + c = 0 gives x = −c/m, provided m ≠ 0.
The sign and size of m tell you the shape of the line without plotting it.
| Slope | Behaviour of the line | Column | Column |
|---|---|---|---|
| m > 0 | Rises from left to right | ||
| m < 0 | Falls from left to right | ||
| m = 0 | Horizontal line, f(x) = c (a constant function) | ||
| Large \ | m\ | Steep | |
| Small \ | m\ | Shallow |
A vertical line such as x = 4 has no defined slope and is not a function, because one input would have many outputs.
Building a line from information
Most problems give you two facts and ask you to recover the line. There are three common forms.
- Slope-intercept form: y = mx + c. Use it when you know m and c.
- Point-slope form: y − y1 = m(x − x1). Use it when you know one point and the slope.
- Two-point form: compute m from the two points, then use point-slope.
Worked example
Find the linear function with f(2) = 7 and f(5) = 16.
- Slope: m = (16 − 7) / (5 − 2) = 3.
- Use point-slope with (2, 7): y − 7 = 3(x − 2), so y = 3x + 1.
- Check with the other point: 3(5) + 1 = 16. Correct.
The x-intercept is −1/3 and the y-intercept is 1.
The same steps in code:
def line_through(p, q):
(x1, y1), (x2, y2) = p, q
m = (y2 - y1) / (x2 - x1)
c = y1 - m * x1
return m, c
m, c = line_through((2, 7), (5, 16))
print(m, c) # 3.0 1.0
print(-c / m) # x-intercept: -0.333...Key properties used in CAT questions
Constant rate of change
A linear function changes by the same amount for equal steps in x. If f is linear, then f(x + h) − f(x) = mh for every x. This lets you extend a table quickly. If f(3) = 10 and f(7) = 22, then m = 3, so f(10) = 22 + 3 × 3 = 31.
Parallel and perpendicular lines
- Two lines are parallel when their slopes are equal (and the intercepts differ).
- Two lines are perpendicular when the product of their slopes is −1, so m2 = −1/m1.
For example, a line perpendicular to y = 2x + 5 has slope −1/2.
Intersection of two lines
Set the two expressions equal and solve for x. For y = 2x + 1 and y = −x + 7, we get 2x + 1 = −x + 7, so x = 2 and y = 5.
Two distinct lines can meet in exactly one point, no point (parallel), and never in exactly two points. If both slope and intercept match, they are the same line and share infinitely many points. This is the graphical meaning of a pair of linear equations having one, no, or infinitely many solutions.
Intercept form
A line with x-intercept a and y-intercept b (both nonzero) can be written
x/a + y/b = 1
This form is useful for area questions. The line together with the two axes encloses a right triangle of area |ab|/2. For 3x + 4y = 12, rewrite it as x/4 + y/3 = 1, so the intercepts are 4 and 3 and the triangle has area 6.
Composition and linear functions
Composing two linear functions gives another linear function. If f(x) = ax + b and g(x) = cx + d, then f(g(x)) = acx + (ad + b). The slopes multiply. This shortcut helps when a question applies the same linear rule several times.
Domain and range
A linear function with m ≠ 0 has domain and range equal to all real numbers. Every output is reachable, and it is one-to-one, so it has an inverse that is also linear. A constant function (m = 0) has range {c}, one value only.
Restricting the domain changes the range. If f(x) = 2x − 3 on 1 ≤ x ≤ 4, the line is increasing, so the minimum is f(1) = −1 and the maximum is f(4) = 5. The range is [−1, 5]. For a linear function on a closed interval, extreme values always occur at the endpoints.
Common errors
- Swapping the order in the slope formula. Subtract y values and x values in the same order: (y2 − y1)/(x2 − x1). Mixing orders flips the sign.
- Reading the y-intercept from a line not written as y = mx + c. In 2y = 6x + 8, the intercept is 4, not 8. Divide through first.
- Treating the slope of a perpendicular line as the negative of the original. It is the negative reciprocal.
- Assuming a linear function must pass through the origin. Only f(x) = mx does. When c ≠ 0, f(2x) is not 2f(x).
- Forgetting that a line that "increases" on a restricted domain still has its extremes at the ends of that domain, not at a vertex.
Checking your answer quickly
On exam day, plug in two simple inputs. After finding a line, verify that it reproduces both given points. Then check the sign of the slope against whether values should rise or fall. A short check takes about ten seconds and catches most arithmetic slips.
Practice
Exercise
A linear function satisfies f(1) = 4 and f(4) = −2. Find f(x), its x-intercept, and the area of the triangle formed by the line and the two axes.
Show answer
The slope is m = (−2 − 4)/(4 − 1) = −2. Using (1, 4): y − 4 = −2(x − 1), so f(x) = −2x + 6. The y-intercept is 6. Setting f(x) = 0 gives x = 3. The triangle has legs 3 and 6, so its area is (3 × 6)/2 = 9.
Exercise
Line L passes through (0, 5) and is perpendicular to the line 3y = 6x + 2. Where does L cross the x-axis?
Show answer
Rewrite 3y = 6x + 2 as y = 2x + 2/3, so its slope is 2. The perpendicular slope is −1/2. Line L is y = −x/2 + 5. Setting y = 0 gives x = 10, so L crosses the x-axis at (10, 0).
Exercise
If f(x) = 3x + 1 and g(x) = −x + 4, find f(g(x)) and the value of x at which f(g(x)) = g(f(x)).
Show answer
f(g(x)) = 3(−x + 4) + 1 = −3x + 13. g(f(x)) = −(3x + 1) + 4 = −3x + 3. Setting −3x + 13 = −3x + 3 gives 13 = 3, which is false. The two lines are parallel with different intercepts, so there is no such x.