# Straight line graphs

The graph of each of these equations is a straight line:

• $x = 3$
• $y = 2$
• $y = x$
• $y = -2x$
• $y = 3x - 1$
• $x + y = 3$
• $3x - 4y = 12$
• $y - 2 = 3(x + 4)$

If an equation can be rearranged into the form $$y = mx + c$$, then its graph will be a straight line.

In the above:

$$x + y = 3$$ can be rearranged as $$y = 3 - x$$ (which can be re-written as $$y = −x + 3$$).

$$3x - 4y = 12$$ can be rearranged as $$y = \frac{3}{4}x - 3$$.

$$y - 2 = 3(x + 4)$$ can be rearranged as $$y = 3(x + 4) + 2$$ or $$y = 3x + 14$$.

## Vertical and horizontal lines

Vertical lines have equations of the form $$x = k$$.

Horizontal lines have equations of the form $$y = c$$.

### Example

Draw the graph of $$x = 3$$.

Mark some points on a grid which have an $$x$$-coordinate of 3, such as (3, 0), (3, 1), (3, -2).

The points lie on the vertical line $$x = 3$$.

Lines in the form $$x = k$$ are vertical and lines in the form $$y = c$$ are horizontal, where $$k$$ and $$c$$ are numbers.

## Plotting straight line graphs

A table of values can be used to plot straight line graphs.

### Example

Draw the graph of $$y = 3x - 1$$.

Create a table of values:

 x y -1 0 1 2 3 $\begin{array}{l} y = 3x - 1 \\ y = 3 \times - 1 - 1 \\ y = -3 - 1 \\ y = -4 \end{array}$ $\begin{array}{l} 3 \times 0 - 1 \\ = -1 \end{array}$ 2 5 8

Plotting the coordinates and drawing a line through them gives:

This is the graph of $$y = 3x - 1$$.

## Sketching straight line graphs

If you recognise that the equation is that of a straight line graph, then it is not actually necessary to create a table of values.

Just two points are needed to draw a straight line graph, although it is a good idea to do a check with another point once you have drawn the graph.

### Example

Draw the graph of $$y = 3x - 1$$.

If you recognise this as a straight line then just choose two ‘easy’ values of $$x$$, work out the corresponding values of $$y$$ and plot those points.

When $$x = 0$$, $$y = 3 \times 0 - 1 = −1$$. Plot (0, −1).

When $$x = 2$$, $$y = 3 \times 2 - 1 = 5$$. Plot (2, 5).

Drawing the line through (0. -1) and (2, 5) gives the line above.

### Example

Draw the graph of $$2x + 3y = 12$$.

If you recognise this as a straight line then:

When $$x = 0$$, then $$2 \times 0 + 3y = 12$$ means $$3y = 12$$, so $$y = 4$$. Plot (0, 4).

When $$y = 0$$, then $$2x + 3 \times 0 = 12$$ means $$2x = 12$$, so $$x = 6$$. Plot (6, 0).

Draw the line through (0, 4) and (6, 0).

Now check:

The drawn graph passes through (3, 2).

Does (3, 2) satisfy $$2x + 3y = 12?$$

$$2 \times 3 + 3 \times 2$$ does equal 12, so we can be confident that our line is correct.