Straight Lines (AA HL)

Straight lines are the foundation coordinate-geometry topic underneath almost everything else in AA HL, from tangents to vectors. This topic covers the different forms for the equation of a line, finding a gradient from two points, the conditions for two lines to be parallel or perpendicular, and finding the midpoint of and distance between two points.

What the syllabus says

This topic maps onto one point in the official IB Analysis & Approaches syllabus, alongside two prior-knowledge results assumed from before the course begins.

CodeSyllabus content
SL2.1Different forms of the equation of a straight line: \(y=mx+c\) (gradient-intercept form), \(ax+by+d=0\) (general form), and \(y-y_1=m(x-x_1)\) (point-gradient form). Gradient and intercepts. Parallel lines \(m_1=m_2\). Perpendicular lines \(m_1m_2=-1\).
Prior knowledgeThe midpoint of a line segment and the distance between two points in the Cartesian plane (via Pythagoras' theorem) are assumed knowledge from before the course, but are examined alongside straight-line questions.

SL2.1 is content common to both Analysis & Approaches and Applications & Interpretation, and is examinable at both SL and HL.

Key terms

Five words worth knowing cold before you touch the formulas below - each with a worked example showing exactly what it means.

What is the gradient of a line?

The gradient measures how steeply a line rises or falls - the change in \(y\) divided by the change in \(x\) between any two points on it: \(m=\dfrac{y_2-y_1}{x_2-x_1}\). A straight line has the same gradient everywhere along it, which is exactly what makes it straight.

e.g. \(A(-1,4)\), \(B(3,12)\): \(m=\dfrac{12-4}{3-(-1)}=\dfrac84=2\).

What is the gradient-intercept form of a line?

\(y=mx+c\) writes a line in terms of its gradient \(m\) and its \(y\)-intercept \(c\) (the point where it crosses the \(y\)-axis, at \((0,c)\)). It's the most convenient form for reading off both features at a glance, and for sketching quickly.

e.g. Through \((-1,4)\) with \(m=2\): \(y-4=2(x+1)\Rightarrow y=2x+6\), so \(c=6\).

What's the condition for two lines to be parallel?

Two lines are parallel exactly when they have the same gradient: \(m_1=m_2\). This makes sense geometrically - lines that never meet must rise and fall at exactly the same rate.

e.g. \(y=2x+1\) and \(y=2x-5\) are parallel: both have gradient \(2\).

What's the condition for two lines to be perpendicular?

Two lines are perpendicular exactly when the product of their gradients is \(-1\): \(m_1m_2=-1\), equivalently \(m_2=-\dfrac{1}{m_1}\), the "negative reciprocal." The one exception is a horizontal line (\(m=0\)) and a vertical line, which has no defined gradient.

e.g. Gradient \(\tfrac12\) is perpendicular to gradient \(-2\), since \(\tfrac12\times(-2)=-1\).

What is the midpoint of a line segment?

The midpoint of the segment joining \((x_1,y_1)\) and \((x_2,y_2)\) is the average of the two \(x\)-coordinates and the average of the two \(y\)-coordinates: \(\left(\dfrac{x_1+x_2}{2},\dfrac{y_1+y_2}{2}\right)\). It's the exact centre point, equidistant from both ends.

e.g. \(P(-3,5)\), \(Q(7,-1)\): midpoint \(=\left(\dfrac{-3+7}{2},\dfrac{5-1}{2}\right)=(2,2)\).

Key formulas

Seven formulas cover every question on this topic. The two tables below summarise all of them at a glance - the explanations underneath go into more depth on each one.

Formula reference

None of these are printed in the AA formula booklet - the three forms of a line, the parallel/perpendicular conditions, and the midpoint and distance results are all treated as things you're expected to know without looking them up.

FormulaUsed forBooklet?
\(y=mx+c\)Gradient-intercept formNot in booklet
\(ax+by+d=0\)General form of a lineNot in booklet
\(y-y_1=m(x-x_1)\)Point-gradient formNot in booklet
\(m_1=m_2\)Condition for parallel linesNot in booklet
\(m_1m_2=-1\)Condition for perpendicular linesNot in booklet
\(d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\)Distance between two pointsNot in the formula booklet - prior knowledge
\(\left(\dfrac{x_1+x_2}{2},\dfrac{y_1+y_2}{2}\right)\)Midpoint of a segmentNot in the formula booklet - prior knowledge

Parallel vs perpendicular

These two conditions look similar but describe opposite relationships between two gradients - this table keeps them straight.

FeatureParallel linesPerpendicular lines
Gradient condition\(m_1=m_2\)\(m_1m_2=-1\)
Geometric meaningNever meet; same steepnessMeet at a right angle
Gradient relationshipIdenticalNegative reciprocals
Example pair\(y=2x+1\), \(y=2x-5\)\(y=2x+1\), \(y=-\tfrac12x+3\)

Forms of a straight line

The same line can be written three different ways - choosing the right form for the information you're given saves algebra.

Gradient-intercept form

\[y=mx+c\]

Best when you know (or want to find) the gradient and the \(y\)-intercept directly.

Not in the formula booklet - prior knowledge

General form

\[ax+by+d=0\]

Useful for whole-number coefficients; rearrange to \(y=mx+c\) to read off the gradient \(-\tfrac{a}{b}\).

Not in the formula booklet - prior knowledge

Point-gradient form

\[y-y_1=m(x-x_1)\]

The fastest route from "a gradient and a point" to a full equation - then expand and simplify.

Not in the formula booklet - prior knowledge

Parallel, perpendicular, midpoint & distance

These four results all follow directly from the gradient formula and Pythagoras' theorem, and appear constantly alongside straight-line questions.

Parallel condition

\[m_1=m_2\]

Match the gradient of a new line to a given one to guarantee they never meet.

Not in the formula booklet - prior knowledge

Perpendicular condition

\[m_1m_2=-1\]

Take the negative reciprocal of a gradient to get a line at right angles to it.

Not in the formula booklet - prior knowledge

Midpoint

\[\left(\dfrac{x_1+x_2}{2},\dfrac{y_1+y_2}{2}\right)\]

Average the \(x\)-coordinates and the \(y\)-coordinates separately.

Not in the formula booklet - prior knowledge

Distance

\[d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\]

Pythagoras' theorem applied to the horizontal and vertical gaps between two points.

Not in the formula booklet - prior knowledge

Worked examples

Two full exam-style questions, marked exactly like the real thing. Try each one yourself before checking the worked solution.

1
Easy
No calc
[4 marks]

The points are \(A(-1,\,4)\) and \(B(3,\,12)\).

(a) Find the gradient of \([AB]\).
(b)(i) Find the gradient, giving the equation of the line through \(A\) and \(B\) in the form \(y=mx+c.\)
(b)(ii) Find the value of \(c.\)

Worked solution

(a) Gradient \(=\dfrac{12-4}{3-(-1)}=\dfrac84\) M1
\(=2.\) A1

(b)(i) Gradient \(=2\) (from part (a)). M1

(b)(ii) \(y-4=2(x+1)\Rightarrow y=2x+6,\) so \(c=6.\) A1

M1 Substituting the coordinates of A and B into the gradient formula A1 Correct gradient value of 2 M1 Using the gradient found in part (a) to set up the point-gradient equation of the line through A and B A1 Correct value of c from rearranging into y=mx+c form
2
Medium
No calc
[4 marks]

The line \(L\) has equation \(y=\tfrac12x+1\). The point \(P(4,\,7)\) is given.

(a) Find the equation of the line through \(P\) perpendicular to \(L\).
(b) Find the coordinates of the foot of the perpendicular from \(P\) to \(L\).

Worked solution

(a) Perpendicular gradient \(=-2.\) M1
\(y-7=-2(x-4)\Rightarrow y=-2x+15,\) so \(c=15.\) A1

(b) \(\tfrac12x+1=-2x+15\Rightarrow\tfrac52x=14\Rightarrow x=5.6.\) M1
\(y=3.8,\) so \((5.6,3.8).\) A1

M1 Finding the negative reciprocal of the gradient of L to get the perpendicular gradient A1 Correct equation of the perpendicular line through P in the form y=mx+c M1 Equating the two line equations to find the x-coordinate of the foot of the perpendicular A1 Correct coordinates of the foot of the perpendicular

Common mistakes

The four slip-ups that account for most of the marks lost on this topic - worth reading before you start practising, not just after you get one wrong.

  • Mixing up the order of subtraction in the gradient formula. \(m=\dfrac{y_2-y_1}{x_2-x_1}\) needs the same point order on top and bottom - swapping just one flips the sign of the whole answer.
  • Flipping the gradient without also negating it. A perpendicular gradient is the negative reciprocal, \(-\dfrac{1}{m}\) - taking only the reciprocal (or only the negative) gives a line that isn't actually at right angles.
  • Sign errors when rearranging the general form. Dividing \(ax+by+d=0\) through by \(b\) to reach \(y=mx+c\) is a common place to lose a minus sign, especially when \(b\) itself is negative.
  • Confusing the midpoint and distance formulas. The midpoint averages coordinates; the distance uses Pythagoras on the coordinate differences - computing the wrong one when asked for the other is a very common slip.

Using your GDC

Straight-line questions are usually done by hand, but one real GDC feature is worth knowing here - the second pre-matched guide for this topic (normal distribution probabilities) turned out to be about statistics, not lines, so it's been left out below.

Show steps for:
Draw a tangent and read its gradient

Get the gradient of a plotted line straight off the graph - a fast way to check a gradient you've calculated by hand.

  1. Graph the line with the point on screen.
  2. 2nd → PRGM (DRAW) → 5:Tangent(, type the x-value (or move the cursor), ENTER - the tangent and its equation appear.TI-84
  3. Use the derivative template to evaluate \(f'(a)\), or draw a tangent with the Geometry tools.Nspire
  4. With the graph shown, SHIFT → F4 (Sketch) → Tangent, then enter the x-value.Casio
  5. The displayed line gives both the gradient and the tangent's equation.

Tip: For a straight line the "tangent" at any point is just the line itself, so this instantly confirms the gradient you calculated by hand.

See the full GDC guide for more calculator models and topics.

Ready to practise properly?

Straight lines questions, marked instantly like the real exam.

Quick answers

The questions students on this topic ask most often.

How do I find the gradient between two points?

Use \(m=\dfrac{y_2-y_1}{x_2-x_1}\), keeping the same order of subtraction on top and bottom. For \(A(-1,4)\) and \(B(3,12)\) this gives \(m=\dfrac{12-4}{3-(-1)}=2\).

How do I find the equation of a perpendicular line?

First take the negative reciprocal of the original gradient (\(m_2=-\tfrac{1}{m_1}\)), then substitute that new gradient and the given point into the point-gradient form \(y-y_1=m(x-x_1)\) and rearrange.

What's the difference between the midpoint and the distance formula?

The midpoint formula averages the two \(x\)-coordinates and the two \(y\)-coordinates to find the exact centre point. The distance formula applies Pythagoras' theorem to the coordinate differences to find the length between the two points - they answer different questions and are easy to mix up.

Do I need my GDC for straight-line questions?

Rarely for the algebra itself, but a GDC can quickly confirm a gradient you've calculated by hand - graph the line and use the tangent tool to read the gradient straight off the screen.

Sub-topics

Straight Lines broken down into its individual skills, each with its own focused page.