topic badge

4.03 Graphing linear functions

Lesson

Identifying key features

The graph of a linear relationship will create a straight line. All linear functions can be written in either of these two common forms:

Gradient intercept form General form
$y=mx+c$y=mx+c $ax+by+c=0$ax+by+c=0

If we sketch a linear relationship on a plane, the straight line formed will be one of the following types:

  • An increasing graph means that as $x$x-values increase, the $y$y-values increase.
  • A decreasing graph means that as $x$x-values increase, the $y$y-values decrease.
  • A horizontal graph means that as $x$x-values change the $y$y-value remains the same
  • In a vertical graph the $x$x-value is constant.

Regardless of all different shapes all linear functions have some common characteristics.

 

Intercepts

All linear functions have at least one intercept. Linear functions might have:

  • An $x$x-intercept only (in the case of a vertical line)
  • A $y$y-intercept only (in the case of horizontal lines)
  • Or both an $x$x and a $y$y (in the case of increasing or decreasing functions)
Intercepts

The $x$x-intercept occurs at the point where $y=0$y=0.

The $y$y-intercept occurs at the point where $x=0$x=0.

 

Gradient

The gradient (or slope) of a line is a measure of how steep the line is. For a linear function the gradient is constant. That is, as the $x$x-values increase by a constant amount, the $y$y-values also increase (or decrease) by a constant amount. The gradient of a line is defined as the vertical change in the $y$y-coordinates (the 'rise') between two points on the line, divided by the horizontal change in the corresponding $x$x-coordinates (the 'run'). And we can calculate the gradient from any two points $\left(x_1,y_1\right)$(x1,y1), $\left(x_2,y_2\right)$(x2,y2) on a line:

Gradient
$m$m $=$= $\frac{rise}{run}$riserun
  $=$= $\frac{y_2-y_1}{x_2-x_1}$y2y1x2x1

The gradient is usually represented by the letter $m$m and has the following properties:

  • If $m<0$m<0, the gradient is negative and the line is decreasing
  • If $m>0$m>0, the gradient is positive and the line is increasing
  • If $m=0$m=0 the gradient is $0$0 and the line is horizontal
  • For vertical lines, we say that the gradient $m$m is undefined
  • The gradient can be read directly, as the coefficient of $x$x, from a linear equation in gradient intercept form ($y=mx+c$y=mx+c)
  • By rearranging general form ($ax+by+c=0$ax+by+c=0) we can see the gradient will be $m=-\frac{a}{b}$m=ab
  • The gradient tells us as the $x$x-values increase by $1$1, the $y$y-values change by $m$m
  • The larger the size of $m$m (if we ignore the sign) then the steeper the line

Worked example

Example 1

Find the gradient of the line below:

Think: We begin by choosing any two points on the line and use them to create a right-angled triangle, where the line itself forms the hypotenuse of the triangle.

Do: In this case we have chosen the points $\left(-1,0\right)$(1,0) and $\left(0,2\right)$(0,2). The 'run' (highlighted red) and the 'rise' (highlighted blue) form the sides of the right-angled triangle.

If we start at the left most point, we see that the run is $1$1 and the rise is $2$2. Both values are positive because we move first to the right $1$1 unit, then up $2$2 units. We calculate the gradient as follows:

$\text{Gradient }$Gradient $=$= $\frac{\text{rise }}{\text{run }}$rise run
  $=$= $\frac{2}{1}$21
  $=$= $2$2

Practical meaning of gradient

Remember: the run is how many units we move across from left to right. The rise is how many units we move up (positive) or down (negative).

A gradient of $\frac{2}{1}$21 means move across $1$1, up $2$2 from a starting point.

A gradient of $-\frac{1}{2}$12 means move across $2$2, down $1$1 from a starting point.

A gradient of $\frac{2}{3}$23 means move across $3$3, up $2$2 from a starting point.

A gradient of $\frac{-3}{5}$35 means move across $5$5, down $3$3 from a starting point.

 

 

Horizontal lines

On horizontal lines, the $y$y-value is always the same at every point on the line. In other words, there is no rise - it's completely flat.

$A=\left(-4,4\right),B=\left(2,4\right),C=\left(4,4\right)$A=(4,4),B=(2,4),C=(4,4)

All of the $y$y-coordinates are the same. Every point on the line has a $y$y-value equal to $4$4, regardless of the $x$x-value.

The equation of this line is $y=4$y=4.

Since gradient is calculated by $\frac{\text{rise }}{\text{run }}$rise run and there is no rise (i.e. $\text{rise }=0$rise =0), the gradient of a horizontal line is always zero.

 

Vertical lines

On vertical lines, the $x$x value is always the same for every point on the line.

Let's look at the coordinates of points $A$A, $B$B, and $C$C on this line.

$A=\left(5,-4\right),B=\left(5,-2\right),C=\left(5,4\right)$A=(5,4),B=(5,2),C=(5,4)

All of the $x$x-coordinates are the same. Every point on the line has an $x$x-value equal to $5$5, regardless of the $y$y-value.

The equation of this line is $x=5$x=5.

Vertical lines have no "run" (i.e. $\text{run }=0$run =0). If we tried to substitute this into the $\frac{\text{rise }}{\text{run }}$rise run expression, we'd have a fraction with $0$0 as the denominator, which is undefined. So, the gradient of a vertical line is always undefined.

 

Practice questions

Question 1

State the gradient and $y$y-value of the $y$y-intercept of the equation, $y=2x+3$y=2x+3

  1. Gradient $\editable{}$
    $y$y-value of the $y$y-intercept $\editable{}$

Question 2

A line has the equation $3x-y-4=0$3xy4=0.

  1. Express the equation of the line in gradient-intercept form.

  2. What is the gradient of the line?

  3. What is the $y$y-value of the $y$y-intercept of the line?

Question 3

What is the gradient of the line going through A $\left(-1,1\right)$(1,1) and B $\left(5,2\right)$(5,2)?

Loading Graph...
A number plane with the line passing through the points A(-1, 1) and B(5, 2) plotted. The points A(-1, 1) and B(5, 2) are also plotted on the number plane as solid dots.

 

Plotting the graph of a linear relationship

We have seen we can use a table of values to graph a linear function. In fact, to graph any liner relationship we only need two points that are on the line. We can use any two points from a table of values, or substitute in any two values of $x$x into the equation and solve for the corresponding $y$y-values. Using the intercepts is often the most convenient way to sketch the line.

 

Sketching from any two points

If we are given the equation of a linear relationship, like $y=3x+5$y=3x+5, then to sketch it we need two points. We can pick any two points we like.

Start by choosing any two $x$x-values - often the $x$x-value of $0$0 is a good choice, as the calculation for $y$y will be simpler. For our example, $y=3x+5$y=3x+5 becomes $y=0+5$y=0+5, and so $y=5$y=5. This gives us the point $\left(0,5\right)$(0,5)

Similarly look for other easy values to calculate such as $1$1, $10$10, or $2$2. Let's choose $x=1$x=1 for our other point. Then for $y=3x+5$y=3x+5 we have $y=3\times1+5$y=3×1+5, and so $y=8$y=8. This gives us the point $\left(1,8\right)$(1,8)

Now we plot the two points and create a line.

 

Sketching from the intercepts

A special case of graphing a line from two points is to use the axes intercepts as the given points. This is particularly useful when graphing from a line in the general form, where both the $x$x- and $y$y-intercepts can be found quite efficiently.

For example, consider the line $3y+2x-6=0$3y+2x6=0.

The $x$x-intercept happens when the $y$y-value is $0$0:

$3y+2x-6$3y+2x6 $=$= $0$0
$0+2x-6$0+2x6 $=$= $0$0
$2x$2x $=$= $6$6
$x$x $=$= $3$3

The $y$y-intercept happens when the $x$x-value is $0$0:

$3y+2x-6$3y+2x6 $=$= $0$0
$3y+0-6$3y+06 $=$= $0$0
$3y$3y $=$= $6$6
$y$y $=$= $2$2

From here it is pretty straightforward to sketch, we plot the $x$x intercept at $\left(3,0\right)$(3,0) and the $y$y intercept at $\left(0,2\right)$(0,2), and draw the line that passes through both.

 

Sketching from the gradient and a point

Start by plotting the single point that you are given.

Remembering that gradient is a measure of change in the rise per change in run, we can step out one measure of the gradient from the original point given.

A line with gradient $4$4. Move $1$1 unit across and $4$4 units up. A line with gradient $-3$3. Move $1$1 unit across and $3$3 units down. A line with gradient $\frac{1}{2}$12. Move $2$2 units across and $1$1 unit up.

The point can be any point $\left(x,y\right)$(x,y), or it could be an intercept. Either way, plot the point, step out the gradient and draw your line!

For example, plot the line with gradient $-2$2 and has $y$y-intercept of $4$4.

First, plot the $y$y-intercept that has coordinates $\left(0,4\right)$(0,4)

Step out the gradient, ($-2$2 means $1$1 unit across, $2$2 units down)

Connect the points and draw the line.

 

 

Practice questions

Question 4

Consider the equation $2x-y-2=0$2xy2=0

  1. Complete the table of values for this equation:

    $x$x $-1$1 $0$0 $1$1
    $y$y $\editable{}$ $\editable{}$ $\editable{}$
  2. Plot the line on the graph.

    Loading Graph...

  3. What are the coordinates of the $y$y intercept?

    $\left(0,\editable{}\right)$(0,)

  4. What are the coordinates of the $x$x intercept?

    $\left(\editable{},0\right)$(,0)

  5. What is the $y$y value when $x=-2$x=2?

Question 5

Plot the graph of the linear equation $8x+2y-16=0$8x+2y16=0 by plotting both the $x$x-intercept, labelled $X$X, and the $y$y-intercept, labelled $Y$Y.

  1. Loading Graph...

question 6

Consider the linear equation $y=3x+1$y=3x+1.

  1. State the $y$y-value of the $y$y-intercept of this line.

  2. Using the point $Y$Y as the $y$y-intercept, sketch a graph of the equation $y=3x+1$y=3x+1.

    Loading Graph...

Question 7

Plot the line $x=-8$x=8 on the number plane.

  1. Loading Graph...

 

Outcomes

ACMEM123

graph linear functions for all values of x with pencil and paper and with graphing software

What is Mathspace

About Mathspace