topic badge
iGCSE (2021 Edition)

11.12 Finding the equation from a graph

Lesson

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$y=mx+c where $m$m is the gradient and $c$c is the value of the $y$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$y-intercept. That is, we want to find $m$m and $c$c

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

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

Exploration

 

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

 

Every linear equation can be written in the form $y=mx+c$y=mx+c so if we can find $m$m and $c$c we can find the equation.

We can see that the $x$x and $y$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$y-intercept is at $\left(0,-6\right)$(0,6) which means $c=-6$c=6.

To find the gradient $m$m we want to work out how much the $y$y-value increases as $x$x increases by $1$1. As we move along the line from the $x$x-intercept to the $y$y-intercept , we have moved from $\left(0,-6\right)$(0,6) to $\left(2,0\right)$(2,0).That is, the $x$x-value has increased by $2$2 and the $y$y-value has increased by $6$6. This means that every time the $x$x-value increases by $2$2 the $y$y-value increases by $6$6. We can now divide $6$6 by $2$2 to find how much the $y$y-value increases as $x$x increases by $1$1. This means the gradient $m$m is equal to $\frac{6}{2}=3$62=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$x-axis from the point $\left(0,-6\right)$(0,6) has coordinates of $\left(1,-3\right)$(1,3) which confirms the gradient is $3$3 and as expected.

Did you know?

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

This line passes through the origin, we can see it also passes through the point $\left(2,-1\right)$(2,1)

 

Practice questions

Question 1

Consider the graph plotted below.

Loading Graph...

  1. Complete the table of values for the points shown on the line:

    $x$x $-1$1 $0$0 $1$1 $2$2
    $y$y $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
  2. Linear relations can be written in the form $y=mx+c$y=mx+c.

    For this relationship, state the values of $m$m and $c$c:

    $m=\editable{}$m=

    $c=\editable{}$c=

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

  4. Complete the coordinate value for the point on the line where $x=21$x=21:
    $\left(21,\editable{}\right)$(21,)

Question 2

Consider the line shown on the coordinate-plane:

Loading Graph...

  1. Complete the table of values by using the line shown in the graph.

    $x$x $-1$1 $0$0 $1$1 $2$2
    $y$y $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
  2. Linear relations can be written in the form $y=mx+c$y=mx+c.

    For this relationship, state the values of $m$m and $c$c:

    $m=\editable{}$m=

    $c=\editable{}$c=

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

  4. Complete the coordinate value for the point on the line where $x=27$x=27:
    $\left(27,\editable{}\right)$(27,)

Question 3
Consider the line shown on the coordinate-plane:

Loading Graph...

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

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

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

 

General form of a straight line (Extended)

 

General Form

Straight lines can also be written in general form: $ax+by=d$ax+by=d, where $a>0$a>0 and $a,b$a,b and $d$d are integers.

 

Worked Examples

example 2

 

Find the equation of the given line:

a) In gradient-intercept form.

b) In general form, $ax+by=d$ax+by=d.

 

 

 

 

 

 

 

 

 

 

 

 

a) Think: We can see the $y$y-intercept by looking where the line crosses the $y$y-axis. Then we can work out the gradient by considering the triangle formed by the line and the axes.

Do: The line crosses the $y$y-axis at $-6$6, so the $y$y-intercept is: $c=-6$c=6. The gradient can be found by considering the rise and run using the triangle formed by the line and the axes: 
 

$m$m $=$= $\frac{\text{rise}}{\text{run}}$riserun
  $=$= $\frac{6}{2}$62
  $=$= $3$3

Therefore, the equation of the line in gradient-intercept form, $y=mx+c$y=mx+c, is $y=3x-6$y=3x6.

b) Think: We need to rearrange the equation from part (a) into the form $ax+by=d$ax+by=d.

Do

$y$y $=$= $3x-6$3x6

The equation from (a)

$0$0 $=$= $3x-y-6$3xy6

Subtract $y$y from both sides.

$6$6 $=$= $3x-y$3xy

Add $6$6 to both sides.

$3x-y$3xy $=$= $6$6

Swap the sides of the equation so it is in the correct form.

 

 

Example 3

Rearrange the equation of the line $y=-\frac{2}{3}x+7$y=23x+7 into general form.

Think: We must make sure that the coefficient of $x$x in the rearranged equation is positive, and that the coefficients and constant term are integers.

Do: We will need to get rid of the fraction and then move terms to the appropriate sides of the equal sign.

$y$y $=$= $-\frac{2}{3}x+7$23x+7

 

$3y$3y $=$= $-2x+21$2x+21

Multiply both sides by three.

$2x+3y$2x+3y $=$= $21$21

Since the coefficient of $x$x was negative, we need to move it to the LHS to become positive.

Outcomes

0607E3.3

Determination of the value of at most two of a, b, c or d in simple linear, quadratic, cubic, reciprocal, exponential, absolute value and trignometric functions.

0607C4.6

Equation of a straight line as y = mx + c or x = k.

0607E4.6A

Equation of a straight line as y = mx + c.

What is Mathspace

About Mathspace