Edexcel IAL Maths

P1.4 Straight-line graphs

The full notes page in 14 sections · live simulations · practice questions

Press F for full screen · → or click to move on

ExaminerPrep is an independent tutoring service. It has been developed independently from and is not endorsed by the International Baccalaureate Organization. "International Baccalaureate", "IB" and "IB Diploma Programme" are registered trademarks of the IBO, used here for descriptive purposes only.
Pearson Edexcel and Cambridge are trademarks of their owners; ExaminerPrep is not affiliated with any exam board.

What this page covers
Overview

The gradient of a line and of the segment joining two points

The equation of a line in the forms y=mx+c, y-y₁=m(x-x₁) and ax+by+c=0, and moving between them

The equation of the line through two given points

Parallel lines (equal gradients) and perpendicular lines (m₁m₂=-1)

Midpoints, lengths of line segments and perpendicular bisectors

Points of intersection of two lines and the foot of a perpendicular

Areas of triangles and quadrilaterals formed by lines and the coordinate axes

Showing that three points are collinear

In one minute
Key points

1. Almost every straight-line question is built from four small tools (the gradient, the point–gradient equation, the perpendicular rule m₁m₂=-1 and solving two equations at once) used in the right order.

2. Gradient m=(change in y)/(change in x)=(y₂-y₁)/(x₂-x₁).

3. With a point and a gradient, use y-y₁=m(x-x₁); then rearrange to y=mx+c or ax+by+c=0 as asked.

4. Parallel lines have equal gradients. Perpendicular lines have gradients with product -1: the perpendicular gradient is the negative reciprocal.

5. Midpoint = (mean of the xs, mean of the ys); length =√((Δx)²+(Δy)²). Intersection: solve the two equations simultaneously.

6. Area: find the vertices first, then use ½×base×height with a horizontal or vertical base or two perpendicular sides; split or subtract for quadrilaterals.

What is the gradient of a straight line?
Section 1 of 14

The gradient of a straight line is the increase in y for each increase of 1 in x. On a straight line it is the same between any two points.

For the line through two points (x₁, y₁) and (x₂, y₂), with x₁≠x₂,

m=(y₂-y₁)/(x₂-x₁)

It does not matter which point you call "1", as long as you use the same order on the top and the bottom. The formula is not in the formulae list, so learn it.

Positive gradient: the line rises from left to right. Negative: it falls.

A horizontal line y=k has gradient 0.

A vertical line x=k has no gradient (the run is zero), so it cannot be written as y=mx+c, but it can be written as ax+by+c=0 with b=0.

What is the gradient of a straight line? (continued)
Section 1 of 14
−5−4−3−2−112345−4−3−2−112345Oy = 2x (m = 2)y = −½x (m = −½)y = 3 (m = 0)x = −3
Positive, negative, zero and undefined gradient. The horizontal line has m=0; the vertical line has no gradient at all.

A larger |m| means a steeper line.

What is the gradient of a straight line? (continued)
Section 1 of 14
−2246−6−4−2246810Orun = 6rise = 12A(−1, −4)B(5, 8)
The line through A(-1, -4) and B(5, 8). The run from A to B is 6 and the rise is 12, so the gradient is 12÷6=2. The line meets the axes at (0, -2) and (1, 0).

Common error

Mixing the order: (y₂-y₁)÷(x₁-x₂) gives the right size with the wrong sign. Write both differences with the same point first, and bracket negative coordinates: 5-(-1), not 5-1.

What are the three forms of the equation of a line?
Section 2 of 14

The same line can be written in three ways. Each one is best for a different job, so you need to move between them confidently.

FormWhat the letters meanBest for
Gradient–intercept: y=mx+cm = gradient; c = y-intercept, so the line crosses the y-axis at (0, c)reading the gradient and intercept at a glance
Point–gradient: y-y₁=m(x-x₁)the line with gradient m through the point (x₁, y₁)writing down a line from a point and a gradient
General: ax+by+c=0usually with a, b, c integers; gradient -a/b, y-intercept -c/b (for b≠0)answers "in the form ax+by+c=0"; vertical lines

The point–gradient form is just the gradient formula rearranged: for any other point (x, y) on the line, (y-y₁)/(x-x₁)=m. Multiply both sides by x-x₁ and you have it.

To read the gradient from ax+by+c=0, make y the subject.

What are the three forms of the equation of a line? (continued)
Section 2 of 14

For example, 4x-6y+9=0 gives y=⅔x+(3/2), so the gradient is ⅔.

To reach integer form, collect everything on one side and multiply by the denominators.

To test whether a point lies on a line, substitute its coordinates: the equation must balance exactly.

What are the three forms of the equation of a line? (continued)
Section 2 of 14 · Worked example 1 · Easy · Find
−4−3−2−1123456−11234567O3x + 4y − 14 = 0(−2, 5)(0, 7/2)run 4fall 3
Gradient -¾ means 3 down for every 4 across. The line passes through (-2, 5) and crosses the y-axis at (0, (7/2)).

WORKED EXAMPLE · QUESTION

The line L passes through the point (-2, 5) and has gradient -¾. Find an equation of L in the form ax+by+c=0, where a, b and c are integers, and state the y-intercept of L.

SOLUTION

Point–gradient form: y-5=-¾(x+2).

Multiply by 4 and collect on one side: 4y-20=-3x-6, so 3x+4y-14=0

Intercept: put x=0, so 4y=14 and y=(7/2). y-intercept (0, (7/2))

Check: 3(-2)+4(5)-14=0 ✓, and -a/b=-¾ ✓.

How do you find the line through two points?
Section 3 of 14

1. Find the gradient from the two points.

2. Put the gradient and either point into y-y₁=m(x-x₁).

3. Rearrange into the form asked for, then check with the other point.

How do you find the line through two points? (continued)
Section 3 of 14 · Worked example 2 · Easy · Find

WORKED EXAMPLE · QUESTION

The points A and B have coordinates (-1, -4) and (5, 8). (a) Find the equation of the line AB in the form y=mx+c. (b) Find the coordinates of the points where AB crosses the coordinate axes.

SOLUTION

(a) Gradient: m=(8-(-4))/(5-(-1))=(12/6)=2. Through A(-1, -4): y+4=2(x+1), so y=2x-2

Check with B: 2×5-2=8 ✓.

(b) Put x=0: y=-2. Put y=0: x=1. (0, -2) and (1, 0)

How do you find the line through two points? (continued)
Section 3 of 14

Exam tip

Always check your line with the point you did not use. It takes ten seconds and catches almost every sign slip in the rearranging.

How do you recognise parallel and perpendicular lines?
Section 4 of 14

Parallel lines rise at the same rate, so they have equal gradients. For perpendicular lines, turning a line through 90° swaps its run and rise and changes one sign: a step of (1, m) becomes (-m, 1), which has gradient -1/m. So for two lines with gradients m₁ and m₂ (neither line vertical):

parallel: m₁=m₂  perpendicular: m₁m₂=-1, so m₂=-1/m₁

A horizontal line (gradient 0) is perpendicular to a vertical line, which has no gradient; the product rule does not apply to that pair.

Parallel lines in general form share the same a:b, for example x-2y+6=0 and x-2y-9=0.

To prove two lines are perpendicular, find both gradients, multiply them, show the product is -1, and then say so.

Negative reciprocal: flip the fraction and change the sign. (2/5) becomes -(5/2); -3 becomes ⅓.

How do you recognise parallel and perpendicular lines? (continued)
Section 4 of 14
−3−2−11234−2−112345Oy = ½x + 5/2y = ½x + 1y = ½x − 1y = −2x + 3(4/5, 7/5)
Three lines with gradient ½ are parallel. The line y=-2x+3 is perpendicular to all of them because ½×(-2)=-1; it crosses y=½x+1 at right angles at ((4/5), (7/5)).
How do you recognise parallel and perpendicular lines? (continued)
Section 4 of 14 · Worked example 3 · Medium · Find
−3−2−1123456789−6−5−4−3−2−112345678OL: x − 2y + 6 = 0x − 2y − 9 = 0y = −2x + 8P(5, −2)
The parallel line through P has the same slope as L; the perpendicular line through P crosses L at right angles.

WORKED EXAMPLE · QUESTION

The line L has equation x-2y+6=0. The point P has coordinates (5, -2). Find an equation of (a) the line through P parallel to L, in the form ax+by+c=0; (b) the line through P perpendicular to L, in the form y=mx+c.

SOLUTION

Gradient of L: 2y=x+6, so y=½x+3 and the gradient is ½.

(a) Keep the same x- and y-coefficients and change the constant: x-2y+k=0 through P gives 5-2(-2)+k=0, so k=-9. x-2y-9=0

(b) Perpendicular gradient =-1÷½=-2. Then y+2=-2(x-5), so y=-2x+8

How do you recognise parallel and perpendicular lines? (continued)
Section 4 of 14

Common error

Taking the perpendicular gradient as just the reciprocal (2) or just the negative (-½). It must be both: multiply your two gradients and check that you get -1.

How do you find midpoints, lengths and perpendicular bisectors?
Section 5 of 14

For the segment from (x₁, y₁) to (x₂, y₂):

midpoint=((x₁+x₂)/2, (y₁+y₂)/2)  length=√((x₂-x₁)²+(y₂-y₁)²)

The midpoint averages the coordinates; the length is Pythagoras' theorem on the run and the rise. Neither is in the formulae list, but both can be derived in seconds from those two ideas.

The perpendicular bisector of a segment AB is the line through the midpoint of AB at right angles to AB. Every point on it is the same distance from A and from B.

Method: midpoint of AB → gradient of AB → negative reciprocal → y-y₁=m(x-x₁) through the midpoint. Give lengths in exact form unless told otherwise, with surds simplified: √80=√(16×5)=4√5.

How do you find midpoints, lengths and perpendicular bisectors? (continued)
Section 5 of 14 · Worked example 4 · Medium · Find
−4−3−2−1123456−2−112345678Oy = −2x + 655A(−3, 2)B(5, 6)M(1, 4)(0, 6)
The perpendicular bisector of A(-3, 2) and B(5, 6) passes through the midpoint M(1, 4) with gradient -2. The point (0, 6) on it is 5 units from A and 5 units from B.

WORKED EXAMPLE · QUESTION

The points A and B have coordinates (-3, 2) and (5, 6). (a) Find the exact length of AB. (b) Find an equation of the perpendicular bisector of AB in the form ax+by+c=0.

SOLUTION

(a) AB=√(8²+4²)=√80= 4√5

(b) Midpoint M=((-3+5)/2, (2+6)/2)=(1, 4); gradient of AB=(4/8)=½.

Perpendicular gradient -2, through M: y-4=-2(x-1), so y=-2x+6, which gives 2x+y-6=0

How do you find where two lines meet?
Section 6 of 14

The point of intersection satisfies both equations, so solve them simultaneously.

If one equation is y=…, substitute it into the other; otherwise eliminate by matching coefficients.

Two different lines with equal gradients are parallel and never meet: the simultaneous equations have no solution.

The foot of the perpendicular from a point P to a line is where the perpendicular through P meets the line. The distance from P to the foot is the shortest distance from P to the line.

How do you find where two lines meet? (continued)
Section 6 of 14 · Worked example 5 · Medium · Find
−3−2−112345678−4−3−2−11234567OLP(5, −2)F(2, 4)PF = 3√5
The perpendicular from P(5, -2) to x-2y+6=0 meets it at the foot F(2, 4). PF is the shortest distance from P to the line: √45=3√5.

WORKED EXAMPLE · QUESTION

Continue Worked example 3. The line y=-2x+8 meets L: x-2y+6=0 at the point F. (a) Find the coordinates of F. (b) Find the exact distance from P(5, -2) to L.

SOLUTION

(a) Substitute y=-2x+8 into L: x-2(-2x+8)+6=0, so 5x-10=0 and x=2. Then y=-2(2)+8=4. F(2, 4)

(b) PF is perpendicular to L, so it is the shortest distance: PF=√((5-2)²+(-2-4)²)=√45= 3√5

How do you find the area of a shape formed by lines?
Section 7 of 14

Find every vertex first: axis intercepts (put x=0 or y=0) and intersections of the lines.

Triangle with a side on an axis (or any horizontal or vertical side): the base lies along that side, and the height is the perpendicular distance of the third vertex from it.

Right-angled triangle (two sides perpendicular, shown with m₁m₂=-1): area =½× (one perpendicular side) × (the other).

Quadrilateral: split it along a diagonal into two triangles, or take a large triangle and subtract a smaller one.

A sketch with the vertices marked tells you which method is quickest.

How do you find the area of a shape formed by lines? (continued)
Section 7 of 14 · Worked example 6 · Medium · Find, Hence
−112345678910−112345678OA(8, 0)B(0, 6)h3x + 4y = 24
The line 3x+4y=24 cuts the axes at A(8, 0) and B(0, 6); triangle OAB has a right angle at O, so its area is ½×8×6=24. The dashed height h to AB is the shortest distance from O.

WORKED EXAMPLE · QUESTION

The line 3x+4y=24 meets the x-axis at A and the y-axis at B. O is the origin. (a) Find the area of triangle OAB. (b) Hence find the shortest distance from O to the line.

SOLUTION

(a) y=0: x=8, so A(8, 0). x=0: y=6, so B(0, 6). Area =½×8×6= 24

(b) Use AB as the base: AB=√(8²+6²)=10. Then ½×10×h=24, so h=(24/5)=4.8

The same triangle has two bases and two heights; equating the two area calculations gives a distance without finding the foot of the perpendicular.

How do you show that three points are collinear?
Section 8 of 14

Collinear points are points that all lie on one straight line.

Method 1: gradient AB = gradient BC. Because the two segments share the point B and have the same gradient, they lie on the same line.

Method 2: find the equation of the line through two of the points and show that the third satisfies it.

Equal gradients alone only show AB∥BC; it is the shared point B that completes the argument, so mention it.

How do you show that three points are collinear? (continued)
Section 8 of 14 · Worked example 7 · Medium · Show that, Find
−6−5−4−3−2−11234567−10−8−6−4−22468101214Oy = −2x + 3A(−2, 7)B(1, 1)C(6, −9)D(−5, 13)
AB and BC both have gradient -2 and share the point B, so A, B and C lie on one line, y=-2x+3. D(-5, 13) is on the same line.

WORKED EXAMPLE · QUESTION

The points A, B and C have coordinates (-2, 7), (1, 1) and (6, -9). (a) Show that A, B and C are collinear. (b) The point D(k, 13) also lies on this line. Find k.

SOLUTION

(a) Gradient AB=(1-7)/(1-(-2))=-2; gradient BC=(-9-1)/(6-1)=-2. The gradients are equal and the segments share the point B, so A, B and C are collinear

(b) Line through B: y-1=-2(x-1), so y=-2x+3. Then 13=-2k+3, so k=-5

How do the pieces fit together in a full question?
Section 9 of 14

Longer questions chain the tools: an equation from two points, a perpendicular line, an intersection, then an area. Each part usually feeds the next, so keep exact values (fractions, surds) all the way through.

How do the pieces fit together in a full question? (continued)
Section 9 of 14 · Worked example 8 · Hard · Find
−3−2−11234567−6−5−4−3−2−112345678Ol₁l₂A(−1, 6)B(5, 3)C(−1, −4)D(3, 4)
Part (d): triangle ACD has a right angle at D, so its area is ½×AD×CD. Its side AC is vertical, which gives the quick check.

WORKED EXAMPLE · QUESTION

The line l₁ passes through the points A(-1, 6) and B(5, 3).

(a) Find an equation of l₁ in the form ax+by+c=0, where a, b and c are integers.

The line l₂ is perpendicular to l₁ and passes through C(-1, -4).

(b) Find an equation of l₂ in the form y=mx+c.

(c) The lines meet at D. Find the coordinates of D.

(d) Find the area of triangle ACD.

(e) l₂ meets the x-axis at E and l₁ meets the y-axis at F. Find the area of the region R enclosed by l₁, l₂ and the positive coordinate axes.

How do the pieces fit together in a full question? (continued)
Section 9 of 14 · Worked example 8 · Hard · Find (continued)
23456−11234567OE(1, 0)D(3, 4)F(0, 11/2)233/4l₁l₂
Part (e): the region R has vertices O, E(1, 0), D(3, 4) and F(0, (11/2)); the diagonal OD splits it into two triangles with areas 2 and (33/4).

SOLUTION

(a) Gradient AB=(3-6)/(5-(-1))=-½. Then y-6=-½(x+1), so 2y-12=-x-1, giving x+2y-11=0

(b) Perpendicular gradient 2, through C(-1, -4): y+4=2(x+1), so y=2x-2

(c) Substitute into l₁: x+2(2x-2)-11=0, so 5x=15, x=3, y=4. D(3, 4)

(d) The angle at D is 90° (the lines are perpendicular), so use AD and CD: AD=√(4²+2²)=√20=2√5 and CD=√(4²+8²)=√80=4√5. Area =½×2√5×4√5= 20

Check another way: AC is vertical (both points have x=-1) with length 10, and D is 4 units from it, so the area is ½×10×4=20 ✓.

(e) E: 2x-2=0 gives E(1, 0). F: 2y=11 gives F(0, (11/2)). Split R along OD: triangle OED=½×1×4=2; triangle ODF=½×(11/2)×3=(33/4).

How do the pieces fit together in a full question? (continued)
Section 9 of 14 · Worked example 8 · Hard · Find (continued)

Area of R=2+(33/4)= (41/4) (=10.25)

Exam tips for P1.4
Section 10 of 14

Exam tip 1 — give the form that is asked for

"In the form ax+by+c=0, where a, b and c are integers" means no fractions and everything on one side. Multiply through by the denominators, and check the line with a known point at the end.

Exam tip 2 — show the substitution

Write the gradient formula with the numbers in it, brackets round negatives: (3-6)/(5-(-1)). Visible method shows exactly where a slip happened, both to you when you check and to whoever reads your work.

Exam tip 3 — sketch first

A quick sketch with the points roughly placed shows whether a gradient should be positive or negative, which vertices bound an area and whether an intersection is believable.

Exam tips for P1.4 (continued)
Section 10 of 14

Exam tip 4 — keep answers exact

Leave lengths as simplified surds (√80=4√5) and coordinates as fractions unless a decimal is asked for. Rounding early makes later parts, especially areas, inexact.

Exam tip 5 — finish a "show that" with a sentence

For perpendicular lines, write both gradients, the product, "=-1" and "so the lines are perpendicular". For collinear points, mention the common point. The conclusion is part of the answer.

Common misconceptions
Section 11 of 14
MisconceptionWhy it is wrongCorrect idea
The gradient of 3x+4y-14=0 is 3.The coefficient of x is only the gradient when y is the subject.Make y the subject: gradient =-¾.
Perpendicular gradient = reciprocal.The product of m and 1/m is +1, not -1.Use the negative reciprocal: m₂=-1/m₁.
Gradient AB = gradient CD shows that A, B, C and D are collinear.Equal gradients only show that AB and CD are parallel; they may be two different lines.Compare segments that share a point: AB and BC with equal gradients lie on one line.
Length =Δx+Δy.The run and rise are at right angles; lengths combine by Pythagoras.Length =√((Δx)²+(Δy)²).
A vertical line has gradient 0.Gradient 0 is horizontal; a vertical line has zero run, so no gradient.Vertical: x=k. Horizontal: y=k, gradient 0.
The perpendicular bisector passes through A or B.It bisects AB, so it goes through the midpoint.Use the midpoint of AB as (x₁, y₁).
How this topic connects
Section 12 of 14

P1.6 Differentiation

The tangent to a curve at a point is a straight line with gradient dy/dx; the normal is perpendicular to it. Both are written with y-y₁=m(x-x₁).

Circles (P2), vectors (P4) and statistics (S1)

A perpendicular bisector of a chord passes through the centre of a circle, and a tangent is perpendicular to the radius, so the midpoint, length and m₁m₂=-1 tools are used throughout P2. P4 describes lines in two and three dimensions with vector equations; in S1 the regression line y=a+bx is a straight line whose gradient is interpreted in context.

M1 and IAL Physics

The gradient of a velocity–time graph is an acceleration and the gradient of a displacement–time graph is a velocity: the same rise ÷ run, with units.

Key formulae
Section 13 of 14
FormulaUseIn the formulae list?
m=(y₂-y₁)/(x₂-x₁)gradient through two pointsNo – learn it
y=mx+cgradient m, y-intercept cNo – learn it
y-y₁=m(x-x₁)line with gradient m through (x₁, y₁)No – learn it
ax+by+c=0, gradient -a/bgeneral form; reading the gradientNo – derive it
m₁=m₂; m₁m₂=-1parallel; perpendicularNo – learn it
((x₁+x₂)/2, (y₁+y₂)/2)midpointNo – derive it
√((x₂-x₁)²+(y₂-y₁)²)length of a segmentNo – derive it (Pythagoras)
Check your understanding
Section 14 of 14

1. Find the gradient of the line 4x-6y+9=0.

2. Show that the lines y=3x-1 and x+3y=12 are perpendicular.

3. P is (2, -3) and Q is (8, 5). Find the midpoint and the length of PQ.

4. Find the equation of the line through (4, 3) parallel to 2x+y=7.

5. Find the area of the triangle formed by the line y=2x+6 and the coordinate axes.

6. The points A(1, 2), B(4, k) and C(7, 14) are collinear. Find k.

Check your understanding · answers
Section 14 of 14

1. 6y=4x+9, so y=⅔x+(3/2). Gradient =⅔.

2. The second line is y=-⅓x+4. Gradients 3 and -⅓; 3×(-⅓)=-1, so the lines are perpendicular.

3. Midpoint ((2+8)/2, (-3+5)/2)= (5, 1). Length √(6²+8²)=√100= 10.

4. Gradient -2. y-3=-2(x-4), so y=-2x+11 (or 2x+y-11=0).

5. Intercepts (-3, 0) and (0, 6). Area =½×3×6= 9.

6. Collinear means gradient AB equals gradient AC (the segments share A). Gradient AC=(14-2)/(7-1)=2, so gradient AB=(k-2)/(4-1)=2, giving k-2=6 and k=8.

Check understanding

Practice questions

The answer and each step appear one click at a time.

Question 1 [5 marks]

Figure 1 shows the straight line ℓ. The marked points A and B lie on ℓ at gridline intersections.

(a) Use Figure 1 to write down the coordinates of A and of B. [1]

(b) Find the gradient of ℓ. [1]

(c) Find an equation of ℓ, giving your answer in the form ax + by + c = 0, where a, b and c are integers. [2]

(d) The point (k, −7) lies on ℓ. Find the value of k. [1]

xxyy−5−5−4−4−3−3−2−2−1−11122334455667788−4−4−3−3−2−2−1−1112233445566OOAABBℓℓ

Mark scheme click to reveal each step

A(−3, 5) and B(6, −1), both needed

(−1 − 5) ÷ (6 − (−3)) = −6 ÷ 9 = −²⁄₃, ft their points

y − 5 = −²⁄₃(x + 3) or y + 1 = −²⁄₃(x − 6), ft their gradient

2x + 3y − 9 = 0 (or any non-zero integer multiple)

2k − 21 − 9 = 0, so k = 15, ft their equation

Question 2 [7 marks]

Two taxi companies, A and B, each charge for a journey according to its length. Figure 1 shows the cost, £C, of a journey of d km with each company. The marked points lie on gridline intersections. The cost for each company is modelled by the straight line shown.

(a) Find the gradient of the line for Company A and explain what it represents in this context. [2]

(b) Write down an equation for Company A's cost in the form C = md + c. [1]

(c) Find an equation for Company B's cost. [1]

(d) Use algebra to find the length of journey for which the two companies charge the same, and that cost. [2]

(e) A customer plans a journey of 15 km. State, with a reason, which company is cheaper. [1]

d / kmd / kmC / £C / £224466881010121214144488121216162020242428283232363600Company BCompany BCompany ACompany A

Mark scheme click to reveal each step

(16 − 4) ÷ (8 − 0) = 1.5

the cost per kilometre: each extra km costs £1.50

C = 1.5d + 4

line through (0, 0) and (8, 20): C = 2.5d

1.5d + 4 = 2.5d

d = 4 km, cost £10

A: 1.5 × 15 + 4 = £26.50 and B: 2.5 × 15 = £37.50, so Company A

Keep practising

P1.4 Straight-line graphs

Full notes, every simulation and hundreds of questions with mark schemes, free:

ExaminerPrep is an independent tutoring service. It has been developed independently from and is not endorsed by the International Baccalaureate Organization. "International Baccalaureate", "IB" and "IB Diploma Programme" are registered trademarks of the IBO, used here for descriptive purposes only.
Pearson Edexcel and Cambridge are trademarks of their owners; ExaminerPrep is not affiliated with any exam board.