Skip to content

Straight-line graphs: gradients and equations

A straight line has a constant rate of change. Its equation connects every point on the line, its gradient describes the line’s direction and steepness, and its intercept records where it crosses an axis.

These ideas are essential for coordinate geometry, simultaneous equations, differentiation, kinematics and mathematical modelling.

You should be able to:

  • plot and read coordinates;
  • substitute into an expression;
  • rearrange and solve linear equations;
  • calculate accurately with negative numbers and fractions.

Review coordinate geometry, linear equations or rearranging formulae if needed.

For two distinct points (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2) on a non-vertical line, the gradient is

m=change in ychange in x=y2y1x2x1.\boxed{m=\frac{\text{change in }y}{\text{change in }x} =\frac{y_2-y_1}{x_2-x_1}}.

Gradient is a ratio, not an angle or a length. It tells you how much yy changes when xx increases by 11.

GradientBehaviour from left to right
m>0m>0the line rises
m<0m<0the line falls
m=0m=0the line is horizontal
undefinedthe line is vertical

The steeper line has the greater value of m|m|. Thus a line of gradient 5-5 is steeper than one of gradient 22, even though 5<2-5<2.

Worked example 1: gradient from two points

Section titled “Worked example 1: gradient from two points”

Find the gradient of the line through A(3,5)A(-3,5) and B(5,1)B(5,-1).

Use the same subtraction order in numerator and denominator:

m=155(3)=68=34.m=\frac{-1-5}{5-(-3)} =\frac{-6}{8} =-\frac34.

So every increase of 44 in xx produces a decrease of 33 in yy.

Reversing both subtraction orders gives the same result:

5(1)35=68=34.\frac{5-(-1)}{-3-5}=\frac6{-8}=-\frac34.

Common misconception: mismatched subtraction

Section titled “Common misconception: mismatched subtraction”

If you calculate y2y1y_2-y_1 on top, you must calculate x2x1x_2-x_1 underneath. Mixing the orders changes the sign incorrectly.

Find the gradient through (2,4)(2,-4) and (6,8)(-6,8).

Answer m=8(4)62=128=32.m=\frac{8-(-4)}{-6-2}=\frac{12}{-8}=-\frac32.

Every non-vertical straight line can be written as

y=mx+c,\boxed{y=mx+c},

where:

  • mm is the gradient;
  • cc is the yy intercept, the value of yy when x=0x=0.

For example, in

y=2x+7,y=-2x+7,

the gradient is 2-2 and the line crosses the yy axis at (0,7)(0,7).

The equation is a rule for generating points. If x=3x=3, then

y=2(3)+7=1,y=-2(3)+7=1,

so (3,1)(3,1) lies on the line.

Sketch y=23x2y=\dfrac23x-2.

  1. The yy intercept is (0,2)(0,-2), so plot that point.
  2. The gradient 23\dfrac23 means a change of 33 right and 22 up.
  3. This reaches (3,0)(3,0). Repeat to reach (6,2)(6,2).
  4. Join the points with a straight line and extend it in both directions.

A table gives the same points:

xx003366
yy2-20022

Choose convenient xx values. When the gradient contains thirds, multiples of 33 avoid awkward plotting decimals.

To find where a graph crosses an axis:

  • on the yy axis, x=0x=0;
  • on the xx axis, y=0y=0.

For 3x+2y=123x+2y=12:

When x=0x=0,

2y=12y=6,2y=12\quad\Longrightarrow\quad y=6,

so the yy intercept is (0,6)(0,6).

When y=0y=0,

3x=12x=4,3x=12\quad\Longrightarrow\quad x=4,

so the xx intercept is (4,0)(4,0). Two points determine a unique line, so these intercepts are enough to draw it.

Common misconception: confusing cc with the xx intercept

Section titled “Common misconception: confusing ccc with the xxx intercept”

In y=mx+cy=mx+c, cc is the yy intercept because setting x=0x=0 gives y=cy=c. The xx intercept must usually be calculated by setting y=0y=0.

An equation may need rearranging before its gradient and yy intercept are visible.

Worked example 4: rearrange to y=mx+cy=mx+c

Section titled “Worked example 4: rearrange to y=mx+cy=mx+cy=mx+c”

Find the gradient and intercepts of

4x2y=10.4x-2y=10.

Make yy the subject:

2y=104xy=2x5.\begin{aligned} -2y&=10-4x\\ y&=2x-5. \end{aligned}

Therefore the gradient is 22 and the yy intercept is (0,5)(0,-5).

For the xx intercept, set y=0y=0 in either form:

4x=10x=52.4x=10\quad\Longrightarrow\quad x=\frac52.

Hence the xx intercept is (52,0)\left(\dfrac52,0\right).

Do not read the coefficient 44 in 4x2y=104x-2y=10 as the gradient. The equation must first be rearranged into a form where yy is the subject.

Different information suggests different methods.

Substitute directly into y=mx+cy=mx+c.

A line has gradient 52-\dfrac52 and crosses the yy axis at (0,4)(0,4). Its equation is

y=52x+4.\boxed{y=-\frac52x+4}.

If a line of gradient mm passes through (x1,y1)(x_1,y_1), use the point-gradient form

yy1=m(xx1).\boxed{y-y_1=m(x-x_1)}.

This says that the change in yy from the known point equals mm times the change in xx.

Find the equation of the line with gradient 33 through (2,5)(-2,5).

Substitute m=3m=3, x1=2x_1=-2 and y1=5y_1=5:

y5=3(x(2))=3(x+2).y-5=3(x-(-2))=3(x+2).

Rearrange if y=mx+cy=mx+c is required:

y5=3x+6y=3x+11.y-5=3x+6 \quad\Longrightarrow\quad \boxed{y=3x+11}.

Check the known point:

3(2)+11=5.3(-2)+11=5.

An equally valid method is to begin with y=3x+cy=3x+c, substitute (2,5)(-2,5), and solve 5=6+c5=-6+c.

First calculate the gradient. Then use either point to find the equation.

Worked example 7: equation through two points

Section titled “Worked example 7: equation through two points”

Find the equation through P(2,7)P(2,7) and Q(8,2)Q(8,-2).

First,

m=2782=96=32.m=\frac{-2-7}{8-2}=\frac{-9}{6}=-\frac32.

Use P(2,7)P(2,7) in point-gradient form:

y7=32(x2).y-7=-\frac32(x-2).

Expand:

y7=32x+3,y-7=-\frac32x+3,

so

y=32x+10.\boxed{y=-\frac32x+10}.

Check QQ:

32(8)+10=12+10=2.-\frac32(8)+10=-12+10=-2.

Checking the second point catches most arithmetic and sign errors.

Find the equation of the line through (4,1)(-4,-1) and (2,8)(2,8).

Answer m=8(1)2(4)=96=32.m=\frac{8-(-1)}{2-(-4)}=\frac96=\frac32.

Using (2,8)(2,8),

y8=32(x2),y-8=\frac32(x-2),

so

y=32x+5.\boxed{y=\frac32x+5}.

A horizontal line has equation

y=k,\boxed{y=k},

because every point has the same yy coordinate. Its gradient is 00.

A vertical line has equation

x=k,\boxed{x=k},

because every point has the same xx coordinate. Its gradient is undefined: calculating change in yy divided by change in xx would require division by zero.

A vertical line cannot be written as y=mx+cy=mx+c. It is not a function of xx, because one xx value corresponds to many yy values.

The line through (4,3)(4,-3) and (4,9)(4,9) is

x=4.\boxed{x=4}.

The line through (5,2)(-5,2) and (7,2)(7,2) is

y=2.\boxed{y=2}.

Do not try to force either result through the general two-point calculation without first noticing the equal coordinates.

Parallel non-vertical lines have equal gradients:

m1=m2.\boxed{m_1=m_2}.

Distinct parallel lines have different intercepts. If both gradient and intercept are equal, the equations describe the same line.

Perpendicular lines meet at a right angle. For finite, non-zero gradients,

m1m2=1.\boxed{m_1m_2=-1}.

Therefore the perpendicular gradient to mm is the negative reciprocal

1m.-\frac1m.

One gradient changes sign and the fraction turns upside down. Horizontal and vertical lines form the exceptional perpendicular pair.

Find the equation of the line parallel to 2x+5y=72x+5y=7 through (5,1)(5,-1).

Rearrange the given line:

5y=2x+7y=25x+75.5y=-2x+7 \quad\Longrightarrow\quad y=-\frac25x+\frac75.

The required gradient is therefore 25-\dfrac25. Through (5,1)(5,-1):

y+1=25(x5).y+1=-\frac25(x-5).

Hence

y+1=25x+2y=25x+1.y+1=-\frac25x+2 \quad\Longrightarrow\quad \boxed{y=-\frac25x+1}.

Find the equation of the perpendicular bisector of the segment joining A(2,3)A(-2,3) and B(6,7)B(6,7).

The midpoint is

M=(2+62,3+72)=(2,5).M=\left(\frac{-2+6}{2},\frac{3+7}{2}\right)=(2,5).

The gradient of ABAB is

mAB=736(2)=48=12.m_{AB}=\frac{7-3}{6-(-2)}=\frac48=\frac12.

The perpendicular gradient is 2-2, since

12(2)=1.\frac12(-2)=-1.

Using the midpoint:

y5=2(x2),y-5=-2(x-2),

so

y=2x+9.\boxed{y=-2x+9}.

This line is perpendicular to ABAB and passes through its midpoint, so both required properties have been established.

Common misconception: only change the sign

Section titled “Common misconception: only change the sign”

The perpendicular gradient to 33 is 13-\dfrac13, not 3-3. The perpendicular gradient to 47-\dfrac47 is 74\dfrac74, not 47\dfrac47.

At an intersection, the same point satisfies both line equations. If both equations give yy, set their right sides equal.

Find where

y=3x4andy=x+8y=3x-4 \qquad\text{and}\qquad y=-x+8

intersect.

At the intersection,

3x4=x+8.3x-4=-x+8.

Therefore

4x=12x=3.4x=12 \quad\Longrightarrow\quad x=3.

Substitute into either equation:

y=3(3)4=5.y=3(3)-4=5.

The intersection is

(3,5).\boxed{(3,5)}.

Substitution in the other equation gives 3+8=5-3+8=5, confirming the result. This is the graphical meaning of solving two simultaneous equations.

In a model

y=mx+c,y=mx+c,

the gradient has units

units of yunits of x,\frac{\text{units of }y}{\text{units of }x},

and the intercept is the modelled value of yy when x=0x=0. Interpret both in context.

A taxi fare CC pounds is modelled by

C=2.4d+3.5,C=2.4d+3.5,

where dd is the distance in kilometres.

  • The gradient 2.42.4 means the fare increases by £2.402.40 for each additional kilometre.
  • The intercept 3.53.5 represents the initial charge of £3.503.50.
  • For a 77 km journey,
C=2.4(7)+3.5=20.3,C=2.4(7)+3.5=20.3,

so the model predicts a fare of £20.3020.30.

The algebraic line extends indefinitely, but the practical model may only be sensible for distances in a stated domain, usually d0d\geq0.

When solving a straight-line problem:

  1. Identify what is known: points, gradient, intercept, parallelism or perpendicularity.
  2. Calculate the gradient carefully, preserving subtraction order.
  3. Use yy1=m(xx1)y-y_1=m(x-x_1) when a point and gradient are known.
  4. Rearrange only if the requested form requires it.
  5. Substitute known points to check the equation.
  6. Treat horizontal and vertical lines separately.
  7. Include units and interpretation in modelling questions.
  1. State the gradient and yy intercept of y=53xy=5-3x.
  2. Find both axis intercepts of 2x+3y=182x+3y=18.
  3. Find the equation of the line with gradient 14\dfrac14 through (8,3)(8,-3).
  4. Find the equation through (1,6)(-1,6) and (3,2)(3,-2).
  5. Find the equation of the line parallel to 3y=6x+73y=6x+7 through (4,1)(4,1).
  6. Find the equation of the line perpendicular to y=35x+4y=-\dfrac35x+4 through (3,2)(-3,2).
  7. Find the intersection of y=2x+1y=2x+1 and y=10xy=10-x.
  8. The line through (a,4)(a,4) and (7,16)(7,16) has gradient 33. Find aa.
  9. Find the perpendicular bisector of the segment from (1,2)(1,-2) to (5,6)(5,6).
  10. A tank contains V=1208tV=120-8t litres after tt minutes. Interpret the gradient and intercept, then find when the model predicts that the tank is empty.
  1. m=3m=-3 and c=5c=5.
  2. Setting y=0y=0 gives (9,0)(9,0); setting x=0x=0 gives (0,6)(0,6).
  3. y+3=14(x8)y+3=\dfrac14(x-8), so y=14x5\boxed{y=\dfrac14x-5}.
  4. m=263(1)=2m=\dfrac{-2-6}{3-(-1)}=-2, so y=2x+4\boxed{y=-2x+4}.
  5. The given gradient is 22. Thus y1=2(x4)y-1=2(x-4), so y=2x7\boxed{y=2x-7}.
  6. The perpendicular gradient is 53\dfrac53. Thus y2=53(x+3)y-2=\dfrac53(x+3), so y=53x+7\boxed{y=\dfrac53x+7}.
  7. 2x+1=10x2x+1=10-x gives x=3x=3, then y=7y=7. The intersection is (3,7)(3,7).
  8. 3=1647a=127a3=\dfrac{16-4}{7-a}=\dfrac{12}{7-a}, so 7a=47-a=4 and a=3\boxed{a=3}.
  9. The midpoint is (3,2)(3,2) and the segment gradient is 22, so the perpendicular gradient is 12-\dfrac12. Hence y2=12(x3)y-2=-\dfrac12(x-3), or y=12x+72\boxed{y=-\dfrac12x+\dfrac72}.
  10. The initial volume is 120120 litres and the volume decreases by 88 litres per minute. Setting V=0V=0 gives 1208t=0120-8t=0, so the tank is empty after 1515 minutes.

Continue to graphs of functions to compare straight lines with other important graph families, and graph transformations to understand how equations move and reshape graphs.

For the full A-level treatment, including exact coordinate arguments and more demanding line problems, study straight lines in coordinate geometry. The same gradient ideas underpin differentiation and gradients.