topic badge
Australia
Year 8

6.05 Finding the equation from a graph

Lesson

Introduction

So far we have looked at methods for sketching graphs given their equation. We know that all linear equations can be written in the form y=mx+c where m is the gradient and c is the value of the y-intercept.

Knowing this, we can also work out the equation of a straight line if we are given its graph - we just need to work out the gradient and y-intercept. That is, we want to find m and c.

Equation from a graph

To find c we can just look at where the line crosses the y-axis. The value of y at this point is our y-intercept.

To find the gradient, we want to choose two points on the line that we can easily identify the coordinates of, ideally points with integer coordinates. Using these two points we can identify by how much the y-value has increased, or decreased, as x increases by 1. If our two points are more than 1 unit apart on the x-axis we can divide the change in the y-coordinate by the change in the x-coordinate.

Consider the following graph. How can we work out its equation?

-4
-3
-2
-1
1
2
3
4
x
-7
-6
-5
-4
-3
-2
-1
1
y

We can see that the x and y-intercepts are clearly marked on the graph and to find the equation of a straight-line graph we actually only need to know two points, so let's use the two intercepts.

The y-intercept is at (0,-6) which means c=-6.

To find the gradient m we want to work out how much the y-value increases as x increases by 1. As we move along the line from the y-intercept to the x-intercept, we have moved from (0,-6) to (2,0). That is, the x-value has increased by 2 and the y-value has increased by 6.

This means that every time the x-value increases by 2 the y-value increases by 6. We can now divide 6 by 2 to find how much the y-value increases as x increases by 1. This means the gradient m is equal to \dfrac62=3.

We could have chosen any two points on this line, but sometimes the coordinates might not be clear if they are not integer values. In this case, the point that is one unit along the x-axis from the point (0,-6) has coordinates of (1,-3) which confirms the gradient is 3 as expected.

If the line passes through the origin (0,0) the x and y-intercept both occur at this point, so you will need to find a second point to calculate the gradient.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y

This line passes through the origin, we can see it also passes through the point (2,-1).

Examples

Example 1

Consider the line shown on the coordinate-plane:

-4
-3
-2
-1
1
2
3
4
x
-6
-5
-4
-3
-2
-1
1
2
3
4
5
6
y
a

Complete the table of values.

x-1012
y
Worked Solution
Create a strategy

Use the x-values given in the table and find the corresponding points on the line graph.

Apply the idea
-3
-2
-1
1
2
3
x
-7
-6
-5
-4
-3
-2
-1
1
2
3
4
5
6
7
y

The coordinates of the points are (-1,6), (0,2), (1,-2), and (2,-6).

x-1012
y62-2-6
b

Linear relations can be written in the form y=mx+c.

For this relationship, state the values of m and c.

Worked Solution
Create a strategy

Use the values from the table in part (a) where:

  • m is equal to the change in the y-values for every increase in the x-value by 1, and

  • c is the value of y when x=0.

Apply the idea

We can see that the y-values are decreasing by 4 for every increase in x-value by 1. So m=-4.

The value of y is 2 when x=0. So c=2.

c

Write the linear equation expressing the relationship between x and y.

Worked Solution
Create a strategy

Substitute the values found in part (b) into the equation y=mx+c.

Apply the idea

y=-4x+2

d

Complete the coordinates for the point on the line where x=27: \, (27,⬚).

Worked Solution
Create a strategy

Substitute the given value of x into the equation found in part (c).

Apply the idea
\displaystyle y\displaystyle =\displaystyle -4\times(27)+2Substitute x=27
\displaystyle =\displaystyle -108+2Evaluate the multiplication
\displaystyle =\displaystyle -106Evaluate

(27, -106)

Example 2

Consider the line shown on the coordinate-plane:

-3
-2
-1
1
2
3
x
-3
-2
-1
1
2
3
4
y
a

State the value of the y-intercept.

Worked Solution
Create a strategy

The y-intercept is the point where the line intersects the y-axis, when x=0.

Apply the idea
-3
-2
-1
1
2
3
x
-3
-2
-1
1
2
3
4
y

The line intersects at (0,1) in the y-axis, so the y-intercept is y=1.

b

By how much does the y-value increase as the x-value increases by 1?

Worked Solution
Create a strategy

Move 1 unit to the right from the y-intercept, then count spaces need to move up to the next point on the line.

Apply the idea
-3
-2
-1
1
2
3
x
-3
-2
-1
1
2
3
4
y

From the y-intercept, moving 1 unit to the right and 3 units up gets us to the next point on the line.

So, the increase of y-value is 3.

c

Write the linear equation expressing the relationship between x and y.

Worked Solution
Create a strategy

Use the values found in part (a) and (b) to substitute to the equation y=mx+c, where:

  • m is the increase in y-values when x-value increases by 1, and

  • c is the y-intercept.

Apply the idea

We found from part (b) that the increase in the y-values or the m is 3.

In part (a), we found that the y-intercept or c is 1.

So, the linear equation is y=3x+1.

Idea summary

We could choose any two points on the line to find the equation of a line with a linear relationship.

All linear equations are of the form:

\displaystyle y=mx+c
\bm{m}
is the increase in y-values as x-value increases by 1
\bm{c}
is the y-intercept

Outcomes

ACMNA193

Plot linear relationships on the Cartesian plane with and without the use of digital technologies

What is Mathspace

About Mathspace