Equation of a Straight Line (AI SL)

Every straight-line relationship - a taxi fare, a spring's stretch, a sales price against demand - can be written as \(y=mx+c\), where the gradient \(m\) tells you the rate of change and the intercept \(c\) tells you the starting value. This page covers how to build that equation from real data, and how gradients decide whether two lines are parallel or perpendicular. It's part of the broader Linear Models topic.

32 questions on this sub-topic.

Practise straight-line equations → Try exam-style questions

Forms and gradient rules

Covered under IB syllabus reference SL2.1. None of these are in the formula booklet - they're treated as prior knowledge you're expected to recall, so it's worth being fluent in all three forms and the two gradient conditions below.

Gradient-intercept form

\(y=mx+c\)

Not in the formula booklet - prior knowledge. \(m\) is the gradient, \(c\) is the \(y\)-intercept.

Parallel and perpendicular gradients

\(m_1=m_2\) (parallel),   \(m_1\times m_2=-1\) (perpendicular)

Not in the formula booklet - prior knowledge. Compare gradients directly; no need to compare intercepts.

Finding the equation from two points: calculate the gradient from the two points, then substitute either point into \(y=mx+c\) to solve for \(c\).

Need the fuller picture on linear modelling, including how the GDC's linear regression tool finds this equation automatically? See Linear Models.

Worked examples

1
Medium
GDC
[4 marks]

A taxi charges $3 plus $1.50/km.

Write the cost model \(C(d)\) and find the cost for 8 km.

Worked solution

A fixed charge plus a per-km rate is linear: \(C = (\text{rate})d + (\text{fixed})\). M1
Rate \(=$1.50\)/km (the gradient), fixed \(=$3\) (the intercept): \(C(d) = 1.5d + 3.\)A1
\(C(8) = 1.5(8) + 3 = 12 + 3 = $15.\)M1 A1

M1 Linear structure A1 Model M1 Substitute \(d=8\) A1 Substitute and value
2
Hard
GDC
[5 marks]

A shop records weekly sales \(S\) (units) against price \(p\) ($). At \(p=10,\ S=120\); at \(p=16,\ S=84.\) Assume a linear model.

(a) Find the model \(S(p).\)
(b) Predict the sales at \(p=$13.\)

Worked solution

(a) \(m = \frac{84-120}{16-10} = \frac{-36}{6} = -6.\)M1
\(m=-6.\) A1
Substitute \((10,120)\): \(120 = -6(10) + c \Rightarrow c = 180.\) M1
So \(S(p) = -6p + 180.\) The negative gradient shows higher prices reduce sales. A1

(b) At \(p=13\). \(S(13) = -6(13) + 180 = -78 + 180 = 102 \text{ units}.\)A1

M1 Computing the gradient \(\frac{84-120}{16-10}\) A1 Gradient M1 Substituting \((10,120)\) into \(y=mx+c\) to find \(c\) A1 Intercept and model A1 (b) prediction

Common mistakes

Ready to practise properly?

32 straight-line-equation questions, marked instantly like the real exam.

Quick answers

How do I find the equation of a line from two points?

Calculate the gradient \(m=\dfrac{y_2-y_1}{x_2-x_1}\) from the two points, then substitute either point into \(y=mx+c\) and solve for \(c\).

How do I tell if two lines are parallel or perpendicular?

Compare their gradients. Parallel lines have equal gradients, \(m_1=m_2\). Perpendicular lines have gradients that multiply to \(-1\), \(m_1\times m_2=-1\).

← Back to Applications & Interpretation SL topics