P1.4 Straight-line graphs
⤓ Presentation⤓ PowerPointPresentation: opens offline in any browser, simulations live. PowerPoint: editable.
This page covers the coordinate geometry of straight lines: gradients, the three forms of a line's equation, parallel and perpendicular lines, midpoints, lengths, perpendicular bisectors, intersections, areas and collinear points (Pure Mathematics 1, AS). Circles are in P2; tangents and normals to curves are in P1.6; vector equations of lines are in P4.
What this page covers
8 points
- 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_1=m(x-x_1)\) 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_1m_2=-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
6 points
- Almost every straight-line question is built from four small tools (the gradient, the point–gradient equation, the perpendicular rule \(m_1m_2=-1\) and solving two equations at once) used in the right order.
- Gradient \(m=\dfrac{\text{change in }y}{\text{change in }x}=\dfrac{y_2-y_1}{x_2-x_1}\).
- With a point and a gradient, use \(y-y_1=m(x-x_1)\); then rearrange to \(y=mx+c\) or \(ax+by+c=0\) as asked.
- Parallel lines have equal gradients. Perpendicular lines have gradients with product \(-1\): the perpendicular gradient is the negative reciprocal.
- Midpoint \(=\) (mean of the \(x\)s, mean of the \(y\)s); length \(=\sqrt{(\Delta x)^2+(\Delta y)^2}\). Intersection: solve the two equations simultaneously.
- Area: find the vertices first, then use \(\tfrac12\times\text{base}\times\text{height}\) with a horizontal or vertical base or two perpendicular sides; split or subtract for quadrilaterals.
Contents
15 sections
- What is the gradient of a straight line?
- What are the three forms of the equation of a line?
- How do you find the line through two points?
- How do you recognise parallel and perpendicular lines?
- How do you find midpoints, lengths and perpendicular bisectors?
- How do you find where two lines meet?
- How do you find the area of a shape formed by lines?
- How do you show that three points are collinear?
- How do the pieces fit together in a full question?
- Exam tips for P1.4
- Common misconceptions
- How this topic connects
- Key formulae
- Check your understanding
- Specification checklist
What is the gradient of a straight line?
For the line through two points \((x_1, y_1)\) and \((x_2, y_2)\), with \(x_1\ne x_2\),
\[m=\frac{y_2-y_1}{x_2-x_1}\]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\).
- A larger \(|m|\) means a steeper line.
Mixing the order: \((y_2-y_1)\div(x_1-x_2)\) 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?
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.
| Form | What the letters mean | Best for |
|---|---|---|
| Gradient–intercept: \(y=mx+c\) | \(m\) = 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_1=m(x-x_1)\) | the line with gradient \(m\) through the point \((x_1, y_1)\) | writing down a line from a point and a gradient |
| General: \(ax+by+c=0\) | usually with \(a\), \(b\), \(c\) integers; gradient \(-\dfrac{a}{b}\), \(y\)-intercept \(-\dfrac{c}{b}\) (for \(b\ne0\)) | 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, \(\dfrac{y-y_1}{x-x_1}=m\). Multiply both sides by \(x-x_1\) and you have it.
- To read the gradient from \(ax+by+c=0\), make \(y\) the subject. For example, \(4x-6y+9=0\) gives \(y=\tfrac23x+\tfrac32\), so the gradient is \(\tfrac23\).
- 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.
The line \(L\) passes through the point \((-2, 5)\) and has gradient \(-\tfrac34\). 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\).
Point–gradient form: \(y-5=-\tfrac34(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=\tfrac72\). \(y\)-intercept \((0, \tfrac72)\)
Check: \(3(-2)+4(5)-14=0\) ✓, and \(-\dfrac{a}{b}=-\dfrac34\) ✓.
How do you find the line through two points?
- Find the gradient from the two points.
- Put the gradient and either point into \(y-y_1=m(x-x_1)\).
- Rearrange into the form asked for, then check with the other point.
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.
(a) Gradient: \(m=\dfrac{8-(-4)}{5-(-1)}=\dfrac{12}{6}=2\). Through \(A(-1, -4)\): \(y+4=2(x+1)\), so \(y=2x-2\)
Check with \(B\): \(2\times5-2=8\) ✓.
(b) Put \(x=0\): \(y=-2\). Put \(y=0\): \(x=1\). \((0, -2)\) and \((1, 0)\)
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?
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 \(-\tfrac1m\). So for two lines with gradients \(m_1\) and \(m_2\) (neither line vertical):
\[\text{parallel: } m_1=m_2\qquad\text{perpendicular: } m_1m_2=-1,\ \text{so } m_2=-\frac{1}{m_1}\]- 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. \(\tfrac25\) becomes \(-\tfrac52\); \(-3\) becomes \(\tfrac13\).
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\).
Gradient of \(L\): \(2y=x+6\), so \(y=\tfrac12x+3\) and the gradient is \(\tfrac12\).
(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\div\tfrac12=-2\). Then \(y+2=-2(x-5)\), so \(y=-2x+8\)
Taking the perpendicular gradient as just the reciprocal (2) or just the negative (\(-\tfrac12\)). It must be both: multiply your two gradients and check that you get \(-1\).
How do you find midpoints, lengths and perpendicular bisectors?
For the segment from \((x_1, y_1)\) to \((x_2, y_2)\):
\[\text{midpoint}=\left(\frac{x_1+x_2}{2}, \frac{y_1+y_2}{2}\right)\qquad\text{length}=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\]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.
Method: midpoint of \(AB\) → gradient of \(AB\) → negative reciprocal → \(y-y_1=m(x-x_1)\) through the midpoint. Give lengths in exact form unless told otherwise, with surds simplified: \(\sqrt{80}=\sqrt{16\times5}=4\sqrt5\).
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\).
(a) \(AB=\sqrt{8^2+4^2}=\sqrt{80}=\) \(4\sqrt5\)
(b) Midpoint \(M=\left(\dfrac{-3+5}{2}, \dfrac{2+6}{2}\right)=(1, 4)\); gradient of \(AB=\dfrac48=\tfrac12\).
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?
- The point of intersection satisfies both equations, so solve them simultaneously.
- If one equation is \(y=\ldots\), 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.
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\).
(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=\sqrt{(5-2)^2+(-2-4)^2}=\sqrt{45}=\) \(3\sqrt5\)
How do you find the area of a shape formed by lines?
- 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_1m_2=-1\)): area \(=\tfrac12\times\) (one perpendicular side) \(\times\) (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.
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.
(a) \(y=0\): \(x=8\), so \(A(8, 0)\). \(x=0\): \(y=6\), so \(B(0, 6)\). Area \(=\tfrac12\times8\times6=\) 24
(b) Use \(AB\) as the base: \(AB=\sqrt{8^2+6^2}=10\). Then \(\tfrac12\times10\times h=24\), so \(h=\tfrac{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?
- 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\parallel BC\); it is the shared point \(B\) that completes the argument, so mention it.
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\).
(a) Gradient \(AB=\dfrac{1-7}{1-(-2)}=-2\); gradient \(BC=\dfrac{-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?
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.
The line \(l_1\) passes through the points \(A(-1, 6)\) and \(B(5, 3)\).
(a) Find an equation of \(l_1\) in the form \(ax+by+c=0\), where \(a\), \(b\) and \(c\) are integers.
The line \(l_2\) is perpendicular to \(l_1\) and passes through \(C(-1, -4)\).
(b) Find an equation of \(l_2\) 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_2\) meets the \(x\)-axis at \(E\) and \(l_1\) meets the \(y\)-axis at \(F\). Find the area of the region \(R\) enclosed by \(l_1\), \(l_2\) and the positive coordinate axes.
(a) Gradient \(AB=\dfrac{3-6}{5-(-1)}=-\tfrac12\). Then \(y-6=-\tfrac12(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_1\): \(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=\sqrt{4^2+2^2}=\sqrt{20}=2\sqrt5\) and \(CD=\sqrt{4^2+8^2}=\sqrt{80}=4\sqrt5\). Area \(=\tfrac12\times2\sqrt5\times4\sqrt5=\) 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 \(\tfrac12\times10\times4=20\) ✓.
(e) \(E\): \(2x-2=0\) gives \(E(1, 0)\). \(F\): \(2y=11\) gives \(F(0, \tfrac{11}{2})\). Split \(R\) along \(OD\): triangle \(OED=\tfrac12\times1\times4=2\); triangle \(ODF=\tfrac12\times\tfrac{11}{2}\times3=\tfrac{33}{4}\). Area of \(R=2+\tfrac{33}{4}=\) \(\tfrac{41}{4}\) (\(=10.25\))
Exam tips for P1.4
"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.
Write the gradient formula with the numbers in it, brackets round negatives: \(\dfrac{3-6}{5-(-1)}\). Visible method shows exactly where a slip happened, both to you when you check and to whoever reads your work.
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.
Leave lengths as simplified surds (\(\sqrt{80}=4\sqrt5\)) and coordinates as fractions unless a decimal is asked for. Rounding early makes later parts, especially areas, inexact.
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
| Misconception | Why it is wrong | Correct 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 \(=-\tfrac34\). |
| Perpendicular gradient \(=\) reciprocal. | The product of \(m\) and \(\tfrac1m\) is \(+1\), not \(-1\). | Use the negative reciprocal: \(m_2=-\dfrac{1}{m_1}\). |
| 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 \(=\Delta x+\Delta y\). | The run and rise are at right angles; lengths combine by Pythagoras. | Length \(=\sqrt{(\Delta x)^2+(\Delta y)^2}\). |
| 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_1, y_1)\). |
How this topic connects
P1.6 Differentiation
The tangent to a curve at a point is a straight line with gradient \(\dfrac{dy}{dx}\); the normal is perpendicular to it. Both are written with \(y-y_1=m(x-x_1)\).
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_1m_2=-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 \(\div\) run, with units.
Key formulae
| Formula | Use | In the formulae list? |
|---|---|---|
| \(m=\dfrac{y_2-y_1}{x_2-x_1}\) | gradient through two points | No – learn it |
| \(y=mx+c\) | gradient \(m\), \(y\)-intercept \(c\) | No – learn it |
| \(y-y_1=m(x-x_1)\) | line with gradient \(m\) through \((x_1, y_1)\) | No – learn it |
| \(ax+by+c=0\), gradient \(-\dfrac{a}{b}\) | general form; reading the gradient | No – derive it |
| \(m_1=m_2\); \(m_1m_2=-1\) | parallel; perpendicular | No – learn it |
| \(\left(\dfrac{x_1+x_2}{2}, \dfrac{y_1+y_2}{2}\right)\) | midpoint | No – derive it |
| \(\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\) | length of a segment | No – derive it (Pythagoras) |
Check your understanding
1. Find the gradient of the line \(4x-6y+9=0\).
\(6y=4x+9\), so \(y=\tfrac23x+\tfrac32\). Gradient \(=\tfrac23\).
2. Show that the lines \(y=3x-1\) and \(x+3y=12\) are perpendicular.
The second line is \(y=-\tfrac13x+4\). Gradients 3 and \(-\tfrac13\); \(3\times\left(-\tfrac13\right)=-1\), so the lines are perpendicular.
3. \(P\) is \((2, -3)\) and \(Q\) is \((8, 5)\). Find the midpoint and the length of \(PQ\).
Midpoint \(\left(\tfrac{2+8}{2}, \tfrac{-3+5}{2}\right)=\) \((5, 1)\). Length \(\sqrt{6^2+8^2}=\sqrt{100}=\) 10.
4. Find the equation of the line through \((4, 3)\) parallel to \(2x+y=7\).
Gradient \(-2\). \(y-3=-2(x-4)\), so \(y=-2x+11\) (or \(2x+y-11=0\)).
5. Find the area of the triangle formed by the line \(y=2x+6\) and the coordinate axes.
Intercepts \((-3, 0)\) and \((0, 6)\). Area \(=\tfrac12\times3\times6=\) 9.
6. The points \(A(1, 2)\), \(B(4, k)\) and \(C(7, 14)\) are collinear. Find \(k\).
Collinear means gradient \(AB\) equals gradient \(AC\) (the segments share \(A\)). Gradient \(AC=\dfrac{14-2}{7-1}=2\), so gradient \(AB=\dfrac{k-2}{4-1}=2\), giving \(k-2=6\) and \(k=8\).
Specification checklist
Tick every box before the exam. The wording is ours; the numbers refer to the P1 specification sections.
- (P1 2.1) I can find the gradient of a line from its equation or from two points on it.
- (P1 2.1) I can write the equation of a line as \(y-y_1=m(x-x_1)\), \(y=mx+c\) or \(ax+by+c=0\) (with integers when asked), and convert between these forms.
- (P1 2.1) I can find the equation of the line through two given points and check it with the second point.
- (P1 2.2) I can use equal gradients for parallel lines and \(m_1m_2=-1\) for perpendicular lines, and prove that lines are parallel or perpendicular.
- (P1 2.2) I can find midpoints and exact lengths of line segments, and the equation of a perpendicular bisector.
- (P1 2.2) I can find the point where two lines meet by solving their equations simultaneously.
- (P1 2.2) I can find areas of triangles and quadrilaterals whose sides lie on given lines or on the coordinate axes.
- (P1 2.2) I can show that three points are collinear, or use collinearity to find an unknown coordinate.