Linear function exercises, solved
A linear function changes by the same amount every time its input rises by one, and every exercise about it comes down to two numbers: the rate of change and the starting value. Write the line as y = mx + b, find m and b from whatever the problem gives you, and check the result by substituting a point you were given.
For students and parents planning test prep or coursework: one hour with George Li, one to one by video, is $180, $200 or $160, by subject. You leave with a written plan within one working day.
Book your first session| You are given | Start from | Worked case | Result |
|---|---|---|---|
| A slope and the y-intercept | y = mx + b | slope -3, intercept 2 | y = -3x + 2 |
| A slope and one point | y - y1 = m(x - x1) | slope -3 through (2, -4) | y = -3x + 2 |
| Two points | m = (y2 - y1) over (x2 - x1), then a point | (1, -2) and (5, 6) | slope 2, so y = 2x - 4 |
| An equation in standard form | solve for y | 2x + 5y = 20 | y = -0.4x + 4 |
| A line it is parallel to | the same slope, a new intercept | through (3, 1), parallel to y = -x + 7 | y = -x + 4 |
| A line it is perpendicular to | the negative reciprocal slope | through (2, 5), perpendicular to y = 1.5x - 3 | y = -(2 over 3)x + 19 over 3 |
Standard form Ax + By = C has slope -A over B and y-intercept C over B. The cases are original numbers.
Our own worked cases, each checked by substituting a given point
What do the slope and intercept tell you?
The slope m is the change in the output per one step of the input, and the intercept b is the output when the input is zero. In a word problem, the phrase "per" marks the slope and the phrase "to start with" or "flat fee" marks the intercept. A balance that drops $25 a week has slope -25. A subscription that adds 150 users a month has slope 150.
Slopes come in four kinds. Reading across, a positive slope climbs, a negative slope drops, a slope of zero is the flat line y = c, and a vertical line x = c has no slope at all. The last is not a function at all, because one input would need many outputs, and a flat line is a function because each input has exactly one output.
How do you find the equation from two points?
Find the slope first, then use either point to find the intercept, then check with the other point.
Worked example: A phone plan from two bills. A plan costs $62 after 2 months and $98 after 5 months, and the cost is linear in the number of months. What is the monthly rate, the starting fee and the cost after 9 months?
- Treat the bills as the points (2, 62) and (5, 98).
- The slope is (98 - 62) over (5 - 2), which is 36 over 3, which is 12 dollars a month.
- Put the first point in y = 12x + b: 62 = 24 + b, so b = 38.
- Check the second point: 12 times 5 plus 38 is 98, as given.
- After 9 months the cost is 12 times 9 plus 38, which is 146.
Answer: C = 12m + 38, a $38 starting fee, $12 a month, and $146 after 9 months.
Method: slope from the two bills, intercept from one, the other bill as a check; the numbers are an example.
How do you move between the forms?
Standard form is quick for intercepts: set x to 0 for one and y to 0 for the other. For 2x + 5y = 20 the y-intercept is 4 and the x-intercept is 10. To get slope-intercept form, solve for y: 5y = -2x + 20, so y = -0.4x + 4. In the other direction, y = -4x + 3 becomes 4x + y = 3 when you move the x term to the left.
How do parallel and perpendicular lines show up?
Parallel lines share a slope. Perpendicular lines have slopes whose product is -1, so you flip the fraction and change the sign. The line 3x - 2y = 6 solves to y = 1.5x - 3 with slope 1.5. A line perpendicular to it has slope -2 over 3. Through (2, 5), that gives 5 = -4 over 3 + b, so b = 19 over 3, and the check -4 over 3 + 19 over 3 = 5 works.
How can a table prove a relationship is linear?
Look at the changes in the output for equal steps of the input. If the first differences are constant, the pattern is linear. If those gaps themselves grow at a steady pace, you are looking at a quadratic. If the ratios between neighbors are constant, it is exponential.
| x | 1 | 2 | 3 | 4 | Pattern |
|---|---|---|---|---|---|
| Table A | 5 | 9 | 13 | 17 | differences 4, 4, 4, so y = 4x + 1 |
| Table B | 1 | 4 | 9 | 16 | differences 3, 5, 7, then constant second difference 2 |
| Table C | 2 | 6 | 18 | 54 | ratios 3, 3, 3 |
Practice exercises
Try these before you read the answers.
- Is y = -4 a function, and is x = 7? Answer: y = -4 is a flat line and a function. x = 7 is vertical and is not.
- Fill in a table for y = 3x - 5 at x = 0, 2 and 3. Answer: -5, 1 and 4.
- Find the line with slope -3 through (2, -4). Answer: -4 = -6 + b, so y = -3x + 2.
- Find the line through (1, -2) and (5, 6). Answer: slope 2, so y = 2x - 4.
- Find the line through (3, 1) parallel to y = -x + 7. Answer: y = -x + 4.
- Find the line through (2, 5) perpendicular to 3x - 2y = 6. Answer: y = -(2 over 3)x + 19 over 3.
- A candle 30 cm tall burns 2.5 cm each hour. Write its height and say when it burns out. Answer: h = 30 - 2.5t, which is 0 at t = 12 hours.
- A rental costs $55 a day and $0.35 a mile. What does 240 miles cost for one day? Answer: 55 + 0.35 times 240 is $139.
- Find a and b if f(x) = ax + b, f(0) = 7 and f(2) = 1. Answer: b = 7 and a = (1 - 7) over 2 = -3, so f(x) = -3x + 7.
- For which k do (0, 3), (2, 9) and (5, k) lie on one line? Answer: the slope is 3, so k = 3 + 3 times 5 = 18.
To keep going, try our original math practice set. If a session on lines would help, the math tutoring page lists the options.
Common questions
What is the difference between a linear function and a linear equation?
An equation such as 2x + 5y = 20 relates two variables, and it becomes a function once you solve for y. Every non-vertical line is a linear function.
Is a horizontal line a linear function?
Yes. Its slope is 0, so y = b, and each input gives exactly one output. A vertical line is the one line that fails.
How do I know which form to use?
Use slope-intercept form to graph or read a rate, point-slope form when you have a point and a slope, and standard form for intercepts and systems.
How do I check my line?
Put the original given point or points back into the equation. If a given point does not satisfy it, the intercept is wrong.