topic badge

4.03 Linear functions

Lesson

A linear function is any formula or equation whose graph is a straight line.

For example, the equation $y=3x-5$y=3x5 is a linear function and describes the relationship between two variables $x$x and $y$y.

Linear functions are characterised by their gradient and intercepts. We will explore these concepts further below.

 

The gradient of a line

A line is said to be increasing if it slopes upwards as we move from left to right. Increasing lines always have a positive gradient.

Increasing line - positive gradient

A decreasing line slopes downwards as we move from left to right. Decreasing lines always have a negative gradient.

Decreasing line - negative gradient

The following applet allows us to see how the value of the gradient changes with the steepness of the line. Confirm that increasing lines have a positive gradient and decreasing lines have a negative gradient.

 

Calculating the gradient of a line

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').
 

Gradient of a line
$\text{Gradient }$Gradient $=$= $\frac{\text{change in }y\text{-coordinates}}{\text{change in }x\text{-coordinates}}$change in y-coordinateschange in x-coordinates
  $=$= $\frac{\text{rise }}{\text{run }}$rise run

 

Worked example

Example 1

Find the gradient of the line below:

Solution

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.

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.

 

Practice questions

Question 1

Find the gradient of the line that passes through Point A $\left(2,-6\right)$(2,6) and the origin using $m=\frac{\text{rise }}{\text{run }}$m=rise run .

Question 2

Plot the graph of the line whose gradient is $-3$3 and passes through the point $\left(-2,4\right)$(2,4).

  1. Loading Graph...

 

Finding the gradient from a table of values

A linear function is a relationship that has a constant rate of change. This means that the $y$y-values change by the same amount for constant changes in $x$x-values. We can calculate the gradient by analysing the change in $y$y-values with respect to the $x$x-values.

 

Worked example

Example 2

Determine the gradient for the linear function represented by the following table of values:

$x$x $2$2 $3$3 $4$4 $5$5
$y$y $9$9 $6$6 $3$3 $0$0

Think: The $x$x-values increase by the same amount. We can determine how the $y$y-values change for a given change in $x$x in order to calculate the gradient.

Do:

We see a constant change in $y$y (the rise) of $-3$3 for an equivalent change in $x$x (the run) of $1$1. Therefore, we can calculate the gradient as follows:

Gradient $=$= $\frac{\text{rise}}{\text{run}}$riserun
Gradient $=$= $\frac{-3}{1}$31
Gradient $=$= $-3$3

 

Finding the gradient between two points

If we are given the coordinates of two points on the coordinate plane, we can find the gradient of the line that would pass through these points.

 

Worked example

Example 3

Find the gradient of the line between the points $\left(3,6\right)$(3,6) and $\left(7,-2\right)$(7,2).

Solution

It is good practice to first draw a sketch of the two points. A sketch means the location of the points doesn't have to be exact. As long as the points are in the correct quadrant and correctly positioned relative to each other.

We can then add a right-angled triangle that shows the 'rise' and 'run'. This allows us to see immediately whether the line is increasing or decreasing, and if it has a positive or negative gradient.

The run is the horizontal distance between the points. We can see that the left-most point has an $x$x-coordinate of $3$3 and the right-most point has an $x$x-coordinate of $7$7, so the horizontal distance between them is $4$4 units.

The rise is the vertical distance between the points. We can see that one point is $6$6 units above the horizontal axis and the other point is $2$2 units below, so the vertical distance between them is $8$8 units.

If we start at the left-most point, we move $4$4 units to the right and then $8$8 units down to reach the right-most point. This gives us a run of $4$4 and a rise of $-8$8.

We can now calculate the gradient:

$\text{Gradient }$Gradient $=$= $\frac{\text{rise }}{\text{run }}$rise run
  $=$= $\frac{-8}{4}$84
  $=$= $-2$2

 

Another way to find the gradient, without drawing a sketch, is to consider the changes in the $y$y-coordinates and $x$x-coordinates of the two points.

$\text{Gradient }$Gradient $=$= $\frac{\text{change in }y\text{-coordinates}}{\text{change in }x\text{-coordinates}}$change in y-coordinateschange in x-coordinates
  $=$= $\frac{-2-6}{7-3}$2673
  $=$= $\frac{-8}{4}$84
  $=$= $-2$2

 

Notice that we always subtract the coordinates of the left-most point from the coordinates of the right-most point (the left-most point will have the lowest value for the $x$x-coordinate).

 

Practice questions

Question 3

What is the gradient of the line shown in the graph, given that Point A $\left(3,3\right)$(3,3) and Point B $\left(6,5\right)$(6,5) both lie on the line?

 

Loading Graph...
A number plane with a line passing through points A$\left(3,3\right)$(3,3) and B$\left(6,5\right)$(6,5)

Question 4

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.

question 5

Consider the following graph.

Loading Graph...

  1. Find the coordinates of the $y$y-intercept.

  2. Find the gradient of the line.

 

Using the gradient and $y$y-intercept to sketch the graph of a line

If we know the gradient and the $y$y-intercept of a line, then we can state its equation or rule. A line with gradient $m$m and $y$y-intercept $c$c has equation $y=mx+c$y=mx+c.

The gradient-intercept form

$y=mx+c$y=mx+c

where $m$m is the gradient and $c$c is the $y$y-intercept

 

Here are some examples:

$y=2x+4$y=2x+4 has gradient $2$2 and $y$y intercept = $4$4

$y=-3x-7$y=3x7 has gradient $-3$3 and $y$y intercept = $-7$7

$y=\frac{1}{2}x+10$y=12x+10 has gradient $\frac{1}{2}$12 and $y$y intercept = $10$10

A quick method to sketch the graph of a line is to use the $y$y intercept as the starting point and then the gradient to find other points on the line.

 

Practice questions

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

Sketch a graph of the line $y=\frac{1}{2}x-2$y=12x2 using its gradient and $y$y-intercept.

  1. Loading Graph...

 

Horizontal and vertical lines

On horizontal lines, the $y$y-value is always the same for every point on the line. They have the form $y=k$y=k.

On vertical lines, the $x$x-value is always the same for every point on the line. They have the form $x=k$x=k.

 

Practice questions

Question 8

Draw a graph of the line $y=-3$y=3.

  1. Loading Graph...

Question 9

Graph the line $x=-6$x=6.

  1. Plot the line represented by the given points on the number plane.

    Loading Graph...

 

Outcomes

3.3.7

identify the rate of change of the dependent variable, relating it to the difference pattern in a table and the slope of an associated line drawn from practical contexts

3.3.8

determine and describe the significance of the vertical intercept in practical situations

What is Mathspace

About Mathspace