Graphs of Linear Functions
Draw the graph of a linear function from a table of values, read values from it, find where it crosses the axes, compare two lines, and draw and read straight-line graphs from real life.
Before you start
- A point is given by its coordinates , the -coordinate first. is units to the right of the origin and units down.
- A linear function can be written in the form , where and are numbers: multiplies , and stands on its own. In , and . The function can be written as , so and .
- A table of values lists some values of and the value of that the rule gives for each. To substitute a negative number, use brackets: when , .
- To find when you know , solve an equation: if , then and .
Drawing the Graph of a Linear Function
When the rule connecting and is a linear function , the points of its table of values always lie on one straight line. That line, drawn with a ruler, is the graph of the function: the coordinates of every point on it make the equation true.
The graph of a linear function
The graph of a linear function is a straight line.
To draw it:
(1) make a table of values for the given values of , with at least three pairs;
(2) choose a scale for each axis, so that every value in the table fits, and draw the axes;
(3) plot the points;
(4) draw a straight line through the points with a ruler, across the given values of only;
(5) label the line with its equation.
Why at least three points?
Two points are enough to fix a straight line. The third point is a check: if the three points do not lie on one straight line, one of the values in the table is wrong. Work the table out again before you draw.
Example 1: Drawing the graph of
Draw the graph of for values of from to .
Solution
In the lesson Functions and Graphs of Ordered Pairs you made this table of values, plotted its six points and saw that they lie on a straight line. Now draw the line itself.
Step 1: the table of values. As a reminder, substitute each value of into :
:
:
:
: , : , :
Step 2: the scales. runs from to and from to , so the -axis must reach at least from to , and the -axis from to . One unit to each square on both axes fits (on graph paper, 1 cm to 1 unit).
Step 3: plot the points , , , , and .
Step 4: draw and label the line. The six points lie on one straight line. Draw it with a ruler from to , no further, and write beside it.
The graph of is the straight line from to , through all six points of the table.
Example 2: A line that goes down
Copy and complete the table of values for . Then draw the graph of for values of from to .
| ? | ? | ? | ? |
Solution
can be written as , a linear function with and . Substitute each missing value of :
:
:
:
:
Scales: runs from to and from to , so the -axis must reach from to and the -axis from to . One unit to each square on both axes fits.
Plot the six points. They lie on one straight line, so the table checks. This line goes down from left to right: each time increases by , decreases by . Draw it from to and label it.
The missing values of are , , and . The graph is the straight line from to .
Example 3: Choosing a scale
Draw the graph of for values of from to .
Solution
Take , , and (three pairs are enough; the fourth is a further check):
: ; : ; : ; :
Scales: goes up to . With one unit to each square, the -axis would need squares, far too many. Let each square on the -axis stand for units instead, so that is squares up. The -axis keeps one unit to each square.
The two axes may have different scales, but along one axis every square must stand for the same amount: , , , , … up the -axis.
Plot the four points, draw the line from to and label it.
With unit to each square across and units to each square up, the graph is the straight line from to .
Reading Values from a Graph
Once a graph is drawn, it can be used to find values without working them out. Draw light dashed guide lines from one axis to the line, and from the line to the other axis.
Reading from a graph
To find for a given : start at the value on the -axis, go straight up (or down) to the line, then straight across to the -axis, and read the value there.
To find for a given : start at the value on the -axis, go straight across to the line, then straight down (or up) to the -axis, and read the value there.
Example 4: Reading the graph of
Use the graph of drawn in Example 1 to find
(a) the value of when ,
(b) the value of when ,
(c) the value of when .
Solution
(a) From on the -axis (halfway between and ), go up to the line at , then across to the -axis. The reading is .
(b) From on the -axis, go across to the line at , then down to the -axis. The reading is halfway between and , that is, .
(c) From on the -axis, go across to the line at , then down to the -axis. The reading is halfway between and , that is, .
Check each reading by calculation:
(a)
(b) , so and
(c) , so and
(a) (b) (c)
How exact is a reading?
A value read from a graph is only as exact as the drawing. Read to the nearest half of a small square, or as closely as the scale allows. When you know the equation, check the reading by calculation, as in Example 4.
Points on a Line, and Where a Line Crosses the Axes
The coordinates of every point on the graph of make the equation true, and every point whose coordinates make the equation true lies on the line (the drawn part may need to be extended to reach it). So there are two ways to tell whether a point lies on a line: substitute its coordinates into the equation, or plot it and look.
Does a point lie on the line?
A point lies on the line exactly when its coordinates make the equation true. Substitute the -coordinate into : if the result equals the -coordinate, the point is on the line; if not, the point is not on the line.
Example 5: Testing points
Do the points , and lie on the line ? Decide by substitution, then check by drawing the line for values of from to .
Solution
: , which equals the -coordinate, . So lies on the line.
: , but the -coordinate is . So does not lie on the line.
: , but the -coordinate is . So does not lie on the line.
For the graph, a table with , and gives , and . Draw the line from to and plot , and :
The drawing agrees: is on the line, is unit above it and is unit below it.
lies on the line ; and do not.
Every point on the -axis has -coordinate , and every point on the -axis has -coordinate . This is how to find where a line crosses each axis.
Where a line crosses the axes
A line crosses the -axis where . For this gives , so the line crosses the -axis at the point .
A line crosses the -axis where . Put in the equation and solve it for .
Example 6: Where crosses the axes
For the line , find the coordinates of the point where it crosses
(a) the -axis,
(b) the -axis.
Then draw the line for values of from to to check.
Solution
(a) On the -axis, : . The line crosses the -axis at .
(b) On the -axis, :
The line crosses the -axis at .
A third point: when , . Draw the line from to ; it passes through on the -axis and on the -axis, halfway between and .
(a) The line crosses the -axis at . (b) It crosses the -axis at .
Horizontal and Vertical Lines
When , the function becomes : the value of is the same whatever is. For the table of values is:
The points , and all have -coordinate , so they lie on a horizontal line, units above the -axis.
In the same way, points with the same -coordinate lie on a vertical line. The vertical line is the set of every point whose -coordinate is , such as , and . It is not the graph of a function : a function gives one value of for each , but the line has every value of at , and no point at all at any other .
Horizontal and vertical lines
The graph of is a horizontal line through . It is the linear function with .
The line is a vertical line through . It is not the graph of a linear function .
The -axis is the line , and the -axis is the line .
A horizontal line , where is not , never crosses the -axis.
Example 7: Drawing , and
On the same axes, draw the lines , and . Write down the coordinates of the points where the line meets each of the other two lines.
Solution
: every point has -coordinate , for example , and . Draw the horizontal line through them.
: the horizontal line through , and .
: every point has -coordinate , for example , and . Draw the vertical line through them.
Where meets , the point has -coordinate and -coordinate : it is . In the same way, meets at . The lines and are both horizontal and never meet.
The line meets at and meets at .
Two Lines on the Same Axes
Drawing two lines on the same axes lets you compare them and find where they meet. The point where two lines meet lies on both of them, so its coordinates make both equations true.
Example 8: Two lines that never meet
On the same axes, draw the graphs of and for values of from to . Describe how the two lines are related.
Solution
Tables of values, with , and :
For every value of , the value of is more than the value of . So the line is always units above the line .
Because is always units above , the two lines never meet. Each crosses the -axis at its value of : and .
The lines never meet: is always units above . They cross the -axis at and .
Example 9: One line up, one line down
On the same axes, draw the graphs of and for values of from to . Say which way each line goes, and find the point where the two lines meet.
Solution
For example, gives and .
In , is positive: as increases, increases, so the line goes up from left to right.
The function is , so is negative: as increases, decreases, so the line goes down from left to right.
The lines meet at . Check in both equations: and .
goes up from left to right and goes down; the lines meet at .
What a and b tell you about the line
In : when is positive, the line goes up from left to right; when is negative, it goes down from left to right; when , it is horizontal.
The line crosses the -axis at .
Example 10: Matching equations to lines
The lines , and below are the graphs of , and , in some order. Match each line to its equation.
Solution
All three equations have , so all three lines cross the -axis at . That point cannot tell them apart, so test another one. Take :
: , so this line passes through .
: , so this line passes through .
: , so this line passes through .
On the graph, at , line is at , line is at and line is at .
Check with : gives , and passes through ; gives , and passes through ; gives , and passes through .
This agrees with the rule above: is the only line going down, and is the only equation with a negative . Line is steeper than line .
Line is , line is and line is .
Linear Graphs in Real Life
Many quantities in daily life are linked by a linear function: a fixed amount, plus the same amount for each unit. The graph is then a straight line, and it can be read instead of calculating each time. In such a graph:
• each axis is named with its quantity and its unit, such as "Distance (km)" and "Fare ($)";
• the two axes usually have different scales, so say what one square stands for on each;
• only the first quadrant is used when the quantities cannot be negative, and the line is drawn only over the values the question gives;
• the points are joined by a line when every value in between makes sense (a time, a distance, an amount of money or of water). When only whole numbers make sense, such as a number of tickets or of people, the points are plotted and not joined.
Example 11: A currency conversion graph
Mei Ling is going to Malaysia. The exchange rate is S$1 = RM3.50 (Singapore dollars to Malaysian ringgit).
(a) Draw a graph to convert amounts from S$0 to S$50 into ringgit.
(b) Use the graph to convert S$30 into ringgit.
(c) Use the graph to convert RM140 into Singapore dollars.
Solution
(a) Each Singapore dollar is worth RM3.50, so Singapore dollars are worth ringgit, where . This is a linear function with and .
: ; : ; :
| Singapore dollars, | |||
|---|---|---|---|
| Ringgit, |
Scales: across, one square stands for S$5; up, one square stands for RM10. Any amount of money in between makes sense, so the points are joined by a straight line from to .
(b) From S$30 on the horizontal axis, go up to the line, then across. The reading is halfway between RM100 and RM110, that is, RM105. Check: .
(c) From RM140 on the vertical axis, go across to the line, then down. The reading is S$40. Check: .
(b) S$30 is worth RM105. (c) RM140 is worth S$40.
Example 12: A taxi fare
A taxi charges a flag-down fare of $4, and then $0.60 for each kilometre, worked out on the exact distance. The fare for a trip of km is dollars, where .
(a) Draw the graph of the fare against the distance for trips of up to 20 km.
(b) Use the graph to find the fare for a trip of 15 km.
(c) Ali paid a fare of $7. How far did he travel?
Solution
(a) : ; : ; :
| Distance, km | |||
|---|---|---|---|
| Fare, dollars |
Scales: across, one square stands for 2 km; up, one square stands for $1. Any distance in between makes sense, so the points are joined by a straight line from to .
(b) From 15 km (halfway between 14 and 16), go up to the line, then across. The reading is $13. Check: .
(c) From $7, go across to the line, then down. The reading is 5 km (halfway between 4 and 6). Check: , so and .
The line meets the fare axis at : before the taxi has moved at all, the fare is already the flag-down fare of $4.
(b) The fare for 15 km is $13. (c) Ali travelled 5 km.
Example 13: A tank draining
A tank holds 60 litres of water. When its tap is opened, water drains out at 4 litres per minute. After minutes, the volume of water left is litres, where .
(a) Draw the graph of against for the first 15 minutes.
(b) Use the graph to find the volume left after 2.5 minutes.
(c) After how many minutes are 30 litres left?
(d) Where does the line meet the time axis, and what does that point tell you?
Solution
(a) : ; : ; : ; :
| Time, minutes | ||||
|---|---|---|---|---|
| Volume, litres |
Scales: across, one square stands for 1 minute; up, one square stands for 5 litres. Time and volume take every value in between, so the points are joined. The line goes down from left to right, because the volume decreases as time goes on ( is negative).
(b) From 2.5 minutes, go up to the line, then across. The reading is 50 litres. Check: .
(c) From 30 litres, go across to the line, then down. The reading is 7.5 minutes. Check: . Add to both sides: . Subtract : , so .
(d) The line meets the time axis at : after 15 minutes no water is left, so the tank is empty. (It meets the volume axis at : the 60 litres at the start.)
(b) 50 litres (c) After 7.5 minutes (d) At : the tank is empty after 15 minutes.
Common Mistakes
- Joining the points with a curve or with zigzag pieces. The graph of is one straight line, drawn with a ruler. If your points do not lie on one straight line, a value in your table is wrong.
- Leaving out the brackets for a negative . For at : . Working loses the minus sign of .
- An uneven scale. Numbering equally spaced grid lines , , , , makes the graph wrong. Every square along one axis must stand for the same amount.
- Starting on the wrong axis. To find for a given , start on the -axis; to find for a given , start on the -axis.
- Writing coordinates the wrong way round. The line crosses the -axis at , not at .
- Mixing up and . is the vertical line of points with -coordinate ; is the horizontal line of points with -coordinate .
- Drawing the line beyond the values asked for. For "values of from to ", the line starts at and stops at .
Practice Questions
Draw each graph on graph paper or squared paper before you open its solution. The questions get harder as you go.
Question 1
Copy and complete the table of values for . Then draw the graph of for values of from to .
| ? | ? | ? | ? | ? |
ShowHide solution
:
:
:
:
:
The -axis must reach from to ; one unit to each square on both axes. Plot the five points and draw the line from to .
The values of are , , , and . The graph is the straight line from to .
Question 2
Copy and complete the table of values for . Then draw the graph of for values of from to .
| ? | ? | ? | ? | ? |
ShowHide solution
:
:
:
:
:
Plot the points , , , and . They lie on one straight line, which checks the table. Draw it from to :
The values of are , , , and . The graph is the straight line from to , going down from left to right.
Question 3
Draw the graph of for values of from to . Choose a suitable scale for the -axis, and use a third point to check your line.
ShowHide solution
: ; : ; :
The values of go up to , so one square on the -axis could stand for units ( is then squares up); units to a square also fits ( squares). One square on the -axis stands for unit.
Draw the line through and . The third point, , lies on it, so the line is right.
For example, with units to each square up the -axis, the graph is the straight line from to , through the check point .
Question 4
The graph of is drawn below for values of from to . Use it to find
(a) the value of when ,
(b) the value of when ,
(c) the value of when .
Check each answer by calculation.
ShowHide solution
(a) From on the -axis, go up to the line, then across to the -axis: . Check: .
(b) From on the -axis, go across to the line, then down to the -axis: . Check: , so and .
(c) From on the -axis, go across to the line, then up to the -axis: . Check: , so and .
(a) (b) (c)
Question 5
Without drawing, decide which of the points , , and lie on the line . Then draw the line for values of from to , plot the four points, and check your answers.
ShowHide solution
Substitute each -coordinate into and compare the result with the -coordinate:
: , which equals . lies on the line.
: , which equals . lies on the line.
: , not . does not lie on the line.
: , not . does not lie on the line.
To draw the line: gives , gives , and gives . Draw it from to :
The drawing agrees: and are on the line; is unit above it and is units below it.
and lie on the line ; and do not.
Question 6
The line crosses the -axis at and the -axis at .
(a) Find the coordinates of and of .
(b) The point lies on the line. Find the value of .
ShowHide solution
(a) At , on the -axis, : . So is .
At , on the -axis, :
So is .
(b) lies on the line, so its coordinates make the equation true. Substitute and :
Check:
(a) and (b)
Question 7
(a) Write down the coordinates of three points on the line .
(b) On the same axes, draw the lines and , and write down the coordinates of the point where they meet.
(c) One of , and is not the graph of a linear function . Which one? Give a reason.
ShowHide solution
(a) Every point on has -coordinate ; the -coordinate can be anything. For example: , and .
(b) is the horizontal line units below the -axis; is the vertical line unit to the right of the -axis.
The meeting point has the -coordinate of and the -coordinate of : it is .
(c) is (, ), and is (, ): both are linear functions. is the vertical line of all the points with -coordinate . At it has every value of , so it is not a function of the form .
(a) For example , and (b) (c) , a vertical line
Question 8
On the same axes, draw the graphs of and for values of from to .
(a) Which line goes down from left to right? Explain how you can tell from its equation.
(b) Find the coordinates of the point where the lines meet, and check them in both equations.
ShowHide solution
For example, gives and .
(a) goes down from left to right. Written as , it has , which is negative: as increases, decreases.
(b) The lines meet at . Check: and .
(a) , because is negative. (b) The lines meet at .
Question 9
The lines , and below are the graphs of , and , in some order. By testing points, match each line to its equation.
ShowHide solution
Where each line meets the -axis (): and both give , and gives .
On the graph, only meets the -axis at , so is . Lines and both meet it at .
To tell and apart, test : , and . Line passes through and line through .
So is and is . This agrees with the directions: goes down, and has .
Check at : , and passes through .
is , is and is .
Question 10 (Setting: Kayak Hire)
A shop at Pasir Ris hires out kayaks for a fixed charge of $10 plus $8 per hour, worked out on the exact time used. The charge for hours is dollars.
(a) Write down a formula for in terms of , and make a table of values for , and .
(b) Draw the graph of the charge against the time, for 0 to 5 hours.
(c) Use your graph to find the charge for 1.5 hours.
(d) Siti paid $38. For how long did she hire the kayak?
ShowHide solution
(a) The charge is $10 plus $8 for each of the hours: .
: ; : ; :
| Time, hours | |||
|---|---|---|---|
| Charge, dollars |
(b) Scales: across, one square stands for half an hour; up, one square stands for $2. Any time in between makes sense, so the points are joined by a straight line from to .
(c) From 1.5 hours, go up to the line, then across: the reading is $22. Check: .
(d) From $38, go across to the line, then down: the reading is 3.5 hours. Check: , so and .
(a) (c) $22 (d) Siti hired the kayak for 3.5 hours.
Question 11 (Setting: A Trip to Bangkok)
Wei Ming's family is going to Bangkok. The exchange rate is S$1 = 25 Thai baht.
(a) Make a table converting S$0, S$20 and S$40 into baht.
(b) Draw a conversion graph for amounts from S$0 to S$40.
(c) Use your graph to convert S$12 into baht.
(d) Use your graph to convert 650 baht into Singapore dollars.
ShowHide solution
(a) Each Singapore dollar is worth 25 baht: Singapore dollars are worth baht.
, ,
| Singapore dollars | |||
|---|---|---|---|
| Thai baht |
(b) Scales: across, one square stands for S$2; up, one square stands for 50 baht. Any amount in between makes sense, so the points are joined by a straight line from to .
(c) From S$12, go up to the line, then across: the reading is 300 baht. Check: .
(d) From 650 baht, go across to the line, then down: the reading is S$26. Check: .
(c) S$12 is worth 300 baht. (d) 650 baht is worth S$26.
Question 12 (Setting: The School Garden)
In the school garden, Tank A holds 100 litres of water and is drained at 5 litres per minute. At the same time, Tank B, which starts empty, is filled at 20 litres per minute. After minutes, Tank A holds litres and Tank B holds litres.
(a) On the same axes, draw the graphs of the volume in each tank against time, for from to .
(b) After how many minutes do the two tanks hold the same volume of water? What is that volume?
(c) Use your graphs to find how much more water Tank B holds than Tank A after 6 minutes.
ShowHide solution
(a) Tank A: : ; : ; : .
Tank B: : ; : ; : .
| Time, minutes | |||
|---|---|---|---|
| Tank A (litres) | |||
| Tank B (litres) |
Scales: across, one square stands for 1 minute; up, one square stands for 10 litres. Time and volume take every value in between, so each set of points is joined by a straight line.
(b) The lines meet at . Check: Tank A holds litres and Tank B holds litres .
(c) At , the graph of Tank B is at 120 litres and that of Tank A at 70 litres: litres.
(b) After 4 minutes, when each tank holds 80 litres. (c) Tank B holds 50 litres more than Tank A.
Key Points
- The graph of a linear function is a straight line.
- To draw it: make a table of values with at least three pairs (the third is a check), choose a scale, plot the points, draw the line with a ruler across the given values of only, and label it.
- Along one axis every square stands for the same amount; the two axes may have different scales.
- To read for a given , go from the -axis to the line, then across to the -axis. To read for a given , go from the -axis to the line, then to the -axis.
- A point lies on the line exactly when its coordinates make the equation true.
- A line crosses the -axis where (for , at ), and the -axis where .
- is a horizontal line. is a vertical line, and it is not the graph of a function .
- When is positive the line goes up from left to right; when is negative it goes down.
- Where two lines meet, the coordinates of the meeting point make both equations true.
- In a real-life graph, name each axis with its quantity and unit, and join the points only when the values in between make sense.