大象传媒

Straight line graphs - OCRy = mx + c

Graphs show the relationship between two variables and are often seen in newspapers and the media. People who work in professions involving maths and science commonly use graphs.

Part of MathsAlgebra

y = mx + c

Any equation that can be rearranged into the form \(y = mx + c\), will have a straight line graph. \(m\) is the gradient, or steepness of the graph, and \(c\) is the \(y\)-intercept, or where the line crosses the \(y\)-axis.

Finding c

The graphs of \(y = 2x + 1\) and \(y = 2x - 2\) are shown below.

Graph showing plots of y=2x+1 & y=2x-2

The graph of \(y = 2x + 1\) crosses the \(y\)-axis at (0, 1). The graph of \(y = 2x - 2\) crosses the \(y\)-axis at (0, -2). The constant term in the equation (the + 1 or 鈥 2) shows the point where the graph crosses the \(y\)-axis.

This is known as the \(y\)-intercept and is represented by the letter \(c\) in \(y = mx + c\).

Finding m

The graphs \(y = 2x\) and \(y = 4x\) are shown below:

Graph showing plots of y=2x & y=4x

The number in front of the \(x\) is the of the graph.

Gradient is a measure of steepness.

As you move along a line from left to right, you might go up, you might go down or you might not change at all.

Gradient = \(\frac{\text{change up}}{\text{change right}}\) or \(\frac{\text{change in y}}{\text{change in x}}\)

Gradients can be:

  • positive 鈥 going up
  • negative 鈥 going down
  • zero - no change (a flat line)

Steep lines will have high gradients like 5 or -8 and equations like \(y = 5x 鈥 4\) or \(y = -8x + 1\).

Fairly flat lines will have low gradients like \(\frac{1}{2}\) or \(- \frac{3}{4}\) and equations like \(y = \frac{1}{2}x + 1\) or \(y = - \frac{3}{4} x + 2\).

Horizontal lines have a gradient of 0 and equations like \(y = 2\).

To work out a gradient, use the scales of the axes and find how many units you go up or down for each unit you move right.

To work out the equation of a line from a graph, find the gradient and the \(y\)-intercept.

Example

Work out the equation of this graph.

Graph showing plots of y=x+3

Gradient = \(\frac{\text{change up}}{\text{change right}}\)

The gradient is the same all along the line, so it doesn鈥檛 really matter where you start or finish, but it is generally a good idea to use two points on the line that are far apart.

Using (0, 3) and (4, 7), as we move along the line from left to right, we move 4 units up (from 3 to 7) and 4 units to the right (from 0 to 4).

So the gradient = \(\frac{4}{4} = 1\)

The \(y\)-intercept is 3 because the line crosses the \(y\)-axis at (0, 3).

So the equation of the line in the form \(y = mx + c\) is \(y = 1x + 3\) or just \(y = x + 3\).

Example 1

Work out the equation of this graph.

A straight line graph that plots the equation y = -2x + 1. A red line passes through minus 3 and 7 on the Y axis and 4 and minus 7 on the X axis.

Gradient = \(\frac{\text{change up}}{\text{change right}}\)

Using (0, 1) and (4, 鈭7), as we move along the line from left to right, we move 8 units down (from 1 to 鈭7). This is the same as moving -8 units up. We also move 4 units right (from 0 to 4).

So the gradient = \(\frac{-8}{4} = -2\)

The \(y\)-intercept is 1 because the line crosses the \(y\)-axis at (0, 1).

So the equation of the line is \(y = -2x + 1\)

Example 2

Work out the equation of this graph.

A straight line graph that plots the equation y = 1 over 3 times 鈥 2. A red line passes through minus 6 and minus 4 on the Y axis and 6 and zero on the X axis.

Gradient = \(\frac{\text{change up}}{\text{change right}}\)

For example, using (0, 鈭2) and (6, 0), as we move along the line from left to right, we move 2 units up (from 鈭2 to 0) and 6 units to the right (from 0 to 6).

So the gradient = \(\frac{2}{6} = \frac{1}{3}\).

The \(y\)-intercept is 鈭2 because the line crosses the \(y\)-axis at (0, 鈭2).

So the equation of the line is \(y = \frac{1}{3}x - 2\).