top of page

Equation of a straight line

The general equation of a straight line is represented by:

y = mx + c         where m = y/x = gradient          c = intercept on y axis

where x and y are variables that can have any value so the value of y depends on a given value of x. This can be shown by the simplest equation of a straight line y = x given below where x and y have the same values.

For a given equation m is always a number which is the gradient. It will not appear in the equation if its value is 1. C is the intercept which is the point the line crosses the vertical y axis. If c does not appear in the equation then it has a value of 0 and crosses the y axis at 0 so such a line will always pass through the origin.

y = x

original?tenant=vbu-digital

Drawing a graph given the equation of a straight line

Example 1

Given the equation:

y = 2x + 2

The graph of this line can be drawn by generating values of y given a range of values of x.

The best way to do this is by drawing a table and choosing values that start from negative and end in positive values so x values from -2 to 2.

original?tenant=vbu-digital

Note the values plotted from the table are (-2,-2), (-1,0), (0,2), (1,4), (2,6).

From the graph and the equation the intercept is 2 or sometimes expressed as a co-ordinate (0,2) since x is always 0 at the point where the line crosses the y axis.

The gradient is quite steep (2) and is positive (moves upwards from left to right).

Example 2

original?tenant=vbu-digital

Exercise 1

1. Draw the graph of y = x + 3 using values of x between -2 and 2 constructing a table to generate y values.

2. Draw the graph of y = 2x - 1 using values of x between -2 and 2 constructing a table to generate y values.

3. Draw the graph of y = -½x + 2 using values of x between -2 and 2 constructing a table to generate y values.

How to work out the equation of a straight line given the graph

Example 1

original?tenant=vbu-digital

After having worked out the gradient m = 1 and the intercept c = -2 we simply substitute these values into the general equation of the line which gives:

y = x - 2

Example 2

original?tenant=vbu-digital

The gradient m = 3 and the intercept on the y axis is c = 2 so simply substitute these values into the general equation y = mx + c to give the actual equation of the line:

y = 3x + 2

Exercise 2

1. Determine the equation of the line of the following graphs:

    (each square length equals one unit)

a)

original?tenant=vbu-digital

b)

original?tenant=vbu-digital

Working out the gradient given two points on a straight line

If two points on a straight line are given then the following formula can be used to work out the gradient:

original?tenant=vbu-digital

so gradient m = 2

original?tenant=vbu-digital

so gradient m = -3

bottom of page