In this guide
← Maths AI guides

Functions · AI SL & HL

Straight-line relationships

Use gradients and coordinates to construct lines, identify parallel and perpendicular relationships, and find intersections.

Course focus: AI SL & HL: use technology to support calculation, show the mathematical setup and interpret the result in its context. Additional HL methods are labelled below.

Before you start: Coordinate plotting and rearranging linear equations.

Start with a small example

Build it from the beginning

Gradient measures how much the output changes for each unit increase in the input. A line needs both a slope and a location: equal slopes can belong to different parallel lines. Use a known point to locate the correct one.

A first walkthrough

Find the line of gradient 2 through \((1,5)\).

  1. A slope of 2 gives the form \(y=2x+c\).
  2. Substitute the point: \(5=2(1)+c\), so \(c=3\).
  3. The line is \(y=2x+3\); substitution checks the point.
Try the practice ladder after learning the methods ↓

The foundations behind the method

Understand what the symbols mean

Slope compares a change in output with a change in input: units matter. A slope of 3 metres per second differs from a bare numerical ratio. A vertical line has undefined slope because the input change is zero; it cannot be written as y=mx+c. Intercepts describe where a line meets an axis.

How the ideas connect

The point-slope form fixes one point and states that every displacement along the line has the same slope. Parallel nonvertical lines share slopes. Perpendicular nonvertical lines have product of slopes -1; handle horizontal and vertical pairs separately because a vertical slope is undefined.

01

Start with the idea

Build your understanding

A straight line describes a constant rate of change. Two points determine its direction; one point plus a direction determines its position. Coordinates can represent geometry or measured quantities, so the units and domain matter as much as the equation.

Slope is a ratio

A gradient compares changes in outputs and inputs. Reversing both subtraction orders leaves it unchanged; reversing just one changes the sign incorrectly.

Equation versus model

A geometric line can extend indefinitely. A practical model may only apply over nonnegative or measured inputs, and its intercept may need contextual interpretation.

Compare the approaches

Choose by the information in the question, rather than the formula you recognise first.

Point-gradient form

When it helpsUse one known point and a finite gradient.

Check before using itVertical lines need a separate equation.

General form

When it helpsUse intersections, intercepts or horizontal and vertical cases.

Check before using itThe two coordinate coefficients cannot both vanish for a genuine line.

Your method plan

  1. Find a direction using points or perpendicularity.
  2. Insert a known point before rearranging.
  3. Check units, exceptional slopes and whether the final coordinates fit the model.
02

Learn the methods

Learn step by step

1. Gradient measures change

The gradient is change in y divided by change in x. It is independent of which point you call first as long as the subtraction order is consistent. Horizontal lines have gradient zero; vertical lines have no finite gradient and are written \(x=\text{constant}\).

Gradient is rise divided by run

0246012345xyRun 4Rise 2
  • y = ½x + 1
On y = ½x + 1, moving 4 units right raises the output by 2. The gradient is 2 ÷ 4 = ½. The dashed triangle measures changes, not distances from the origin.

Gradient

Why this formula works

Gradient compares vertical change with horizontal change. Similar right triangles along a straight line have the same ratio, so any two distinct nonvertical points give the same gradient.

The formula

\(m=(y_2-y_1)/(x_2-x_1)\), provided \(x_{2}\ne x_{1}\).

Quick example

From \((1,2)\) to \((4,8)\), the rise is 6 and the run is 3, so the gradient is 2.

2. Build a line from a point

Point-gradient form is the safest starting point when you know a point and a gradient. Substitute both coordinates carefully, then rearrange only if requested. The y-intercept form makes the gradient and vertical intercept easy to read.

Line forms

Why this formula works

For a point \((x_{1},y_{1})\) and any other point (x,y) on the line, the gradient condition is \(\frac{y-y_{1}}{x-x_{1}}=m\). Multiplying gives point-gradient form; setting \(x=0\) gives the y-intercept.

The formula

\(y-y_1=m(x-x_1)\) and \(y=mx+c\).

Quick example

A line of gradient 3 through \((2,5)\) satisfies \(y-5=3(x-2)\), hence \(y=3x-1\).

3. Parallel and perpendicular

Distinct nonvertical parallel lines have equal gradients. Nonvertical perpendicular lines have gradients whose product is −1. A horizontal line is perpendicular to a vertical line; this case cannot use a finite reciprocal gradient. For the perpendicular bisector of a segment, find its midpoint first, then its perpendicular gradient.

Worked example: A perpendicular line

Find the line through \((2,3)\) perpendicular to \(y=2x-1\).

  1. The given gradient is 2, so the perpendicular gradient is −\(\frac{1}{2}\).
  2. Use \(y-3=-\frac12(x-2)\).
  3. Rearrange to \(y=-\frac{x}{2}+4\). Substituting \(x=2\) gives \(y=3\) as required.
Worked example: A perpendicular bisector

Find the perpendicular bisector of the segment from \((0,0)\) to \((4,2)\).

  1. The midpoint is \((2,1)\) and the segment gradient is \(\frac{1}{2}\).
  2. The required gradient is −2, so \(y-1=-2(x-2)\), giving \(y=-2x+5\).
  3. Every point on this line is equally distant from the two endpoints.

4. Intersections and distance

At an intersection both line equations hold, so solve them simultaneously. The distance between two points comes from Pythagoras. A midpoint averages coordinates, not gradients. If a question gives a distance from a point to a line, a perpendicular route is required, not an arbitrary vertical separation.

Midpoint and distance

Why this formula works

The midpoint is halfway along the coordinate displacement, explaining the coordinate averages. The displacement’s perpendicular coordinate components form a right triangle, so Pythagoras gives distance.

The formula

\(M=((x_1+x_2)/2,(y_1+y_2)/2)\) \(d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\).

Quick example

For \((0,1)\) and \((4,4)\), the midpoint is \((2,2.5)\) and distance is \(\sqrt{4^{2}+3^{2}}=5\).

5. Model interpretation

In an equation relating real quantities, the gradient has units “vertical quantity per horizontal quantity”. The intercept predicts the output at input zero, which might be outside the realistic model domain. Explain what the value represents in context.

6. General form, intercepts and exceptional slopes

The equation \(Ax+By+C=0\) accommodates every straight line when A and B are not both zero. If \(B\ne 0\), rearrange to \(y=-(A/B)x-C/B\). If \(B=0\), the line is vertical and has no finite slope; if \(A=0\), it is horizontal. To find an axis intercept set the other coordinate to zero, but first check whether that substitution is possible. A line through the origin has both intercepts at the same point, not two separate plotted points.

General form, intercepts and exceptional slopes

Why this formula works

Rearranging isolates y and reveals the usual slope-intercept form. Setting \(y=0\) or \(x=0\) directly identifies where a line meets each axis without needing a graphing window.

The formula

For \(B\ne 0\) \(m=-A/B\). x-intercept is −\(C/A\) when \(A\ne 0\); y-intercept is −\(C/B\) when \(B\ne 0\).

Quick example

\(2x+3y-12=0\) has slope −\(\frac{2}{3}\) and intercepts \((6,0)\), \((0,4)\). The line \(x=6\) has only a vertical-line description.

Worked example: Construct a line from intercepts

A line passes through \((5,0)\) and \((0,2)\). Write its equation in general form.

  1. Its slope is \(\frac{2-0}{0-5}=-\frac{2}{5}\).
  2. Using the y-intercept gives \(y=-2\frac{x}{5}+2\).
  3. Multiply by 5 and rearrange to \(2x+5y-10=0\). Both stated intercepts satisfy this equation.

7. Use a linear model within its physical domain

For a model, write what the input, output and units mean before interpreting slope or intercept. A declining value model may predict negative values after a certain time; that does not make negative prices physically valid. Solve the relevant boundary and restrict the domain. For word problems with two unknown quantities, write two independent constraints, solve them, and check the resulting values are feasible counts or nonnegative measurements.

Use a linear model within its physical domain

Why this formula works

The slope is change in output per input unit. Setting the model output to a boundary such as zero finds the limiting input. Mathematical line equations exist outside the model’s physical scope, so the boundary is a modelling restriction rather than a change to linear algebra.

The formula

For \(V(t)=V_0-kt\) \(k>0\), requiring \(t\ge 0\) and \(V\ge 0\) gives \(0\le t\le V_0/k\).

Quick example

For \(V=1800-150t\), the annual change is −150 and the nonnegative-value domain is \(0\le t\le 12\).

Worked example: Two prices from two totals

Adult tickets cost a pounds and child tickets c pounds. Two adults and three children pay £31; three adults and one child pay £29. Find both prices.

  1. Write \(2a+3c=31\) and \(3a+c=29\).
  2. From the second, \(c=29-3a\). Substitute: \(2a+87-9a=31\), so \(a=8\).
  3. Then \(c=5\). Check \(16+15=31\) and \(24+5=29\); the values are positive and have the requested currency units.
Quick formula reference

For revision once you understand the methods above. Check the conditions before using a formula.

Gradient

\(m=(y_2-y_1)/(x_2-x_1)\), provided \(x_{2}\ne x_{1}\).

Return to the explanation →

Line forms

\(y-y_1=m(x-x_1)\) and \(y=mx+c\).

Return to the explanation →

Midpoint and distance

\(M=((x_1+x_2)/2,(y_1+y_2)/2)\), \(d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\).

Return to the explanation →

General form, intercepts and exceptional slopes

For \(B\ne 0\), \(m=-A/B\). x-intercept is −\(C/A\) when \(A\ne 0\); y-intercept is −\(C/B\) when \(B\ne 0\).

Return to the explanation →

Use a linear model within its physical domain

For \(V(t)=V_0-kt\), \(k>0\), requiring \(t\ge 0\) and \(V\ge 0\) gives \(0\le t\le V_0/k\).

Return to the explanation →

Learn to diagnose an error

Spot the mistake

The statement below is incorrect. Identify the missing condition or reasoning before opening the explanation.

Incorrect reasoning

The line through (2,5) with slope 3 has equation \(y=3x+5\).

Explain and repair the mistake

The given y coordinate is not automatically the intercept. Use \(y-5=3(x-2)\), giving \(y=3x-1\). Substitution of (2,5) confirms it.

03

Connect and apply

Put the ideas together

A more demanding application of this guide’s methods. This is a learning stage; any additional HL content is labelled separately.

Worked application

A tariff comparison has a boundary

Two transport services charge \(C_A=4+2d\) and \(C_B=10+d\) pounds for distance \(d\ge0\). When is A cheaper?

  1. The fixed fees are £4 and £10; the distance rates are £2 and £1 per unit. The different slopes mean the initial advantage can reverse.
  2. Solve \(4+2d<10+d\), giving \(d<6\). Intersect with the physical domain: \(0\le d<6\).
  3. At \(d=6\), both cost £16, so equality is not part of “cheaper”. For longer journeys B costs less.
  4. Test \(d=2\): A costs £8 and B £12. Test \(d=8\): A costs £20 and B £18, confirming the interpretation.
Pause and explain

What does the point of intersection mean here?

Check your reasoning

It is the distance and charge for which both tariffs give the same cost. It is a model boundary, not an instruction to extend the model to negative journey lengths.

Common mistakes and how to avoid them

  • Keep the same subtraction order in numerator and denominator.
  • The negative reciprocal rule has a special horizontal/vertical case.
  • An intercept is not necessarily a meaningful real-world prediction.
04

Practise independently

Build confidence, then apply it

Try each question before opening its hint or solution. If a method is new, return to the walkthrough, then try again. These learning stages describe the practice sequence; additional HL content is labelled separately.

  1. 1

    Build confidence

    Find the gradient through \((0,2)\) and \((3,8)\).

    Need a starting point?

    Divide change in y by change in x.

    Show the worked solution
    1. \(m=(8-2)/(3-0)=2\).
    2. The slope is 2 output units per input unit.
  2. 2

    Apply and explain

    A line is parallel to \(y=3x-7\) and passes through \((2,1)\). Find it.

    Need a starting point?

    Parallel lines share gradient.

    Show the worked solution
    1. Use \(y=3x+c\). Substitution gives \(1=6+c\), so \(c=-5\).
    2. The required line is \(y=3x-5\).
  3. 3

    Check your understanding

    Find the line through (0,4) and (2,0).

    Show the worked solution

    Its slope is \((0-4)/(2-0)=-2\), so \(y=-2x+4\). Both intercepts satisfy the equation.

  4. 4

    Use the method

    Find the intersection of \(y=3x+1\) and \(y=-x+9\).

    Show the worked solution

    Equate: \(3x+1=-x+9\), so \(x=2\) and \(y=7\). The intersection is \((2,7)\).

  5. 5

    Combine the skills

    General form, intercepts and exceptional slopes

    Find the slope and perpendicular direction for \(4x-8y+1=0\).

    Show the worked solution

    The slope is −\(\frac{4}{-8}=\frac{1}{2}\); a nonvertical perpendicular line has slope −2.

  6. 6

    Combine the skills

    Use a linear model within its physical domain

    A model says height \(h=2t+1\), with t seconds and h metres. Interpret its slope.

    Show the worked solution

    The predicted height increases by 2 metres per second. It is a rate with units \(\frac{m}{s}\), not an initial height.

Finished? Use the linked question bank below to practise selecting the method without a guide telling you which rule to use.

Using these methods in exam questions

AI Paper 1

GDC required

Short-response questions still need mathematical setup and interpretation. Choose the correct tool, enter the model or data carefully, and check units and rounding.

AI Paper 2

GDC required

Extended-response questions connect several steps. Keep intermediate values at full precision and explain how each result answers the context.

For this topic: Label axes, intercepts and relevant asymptotes. For a numerical root, state the equation and search interval; a graph window that misses an intersection is not evidence that no solution exists.

HL only · GDC required

Paper 3: build a connected argument

Both AA HL and AI HL Paper 3 contain two extended problem-solving questions. A question develops a theme, so keep useful earlier results, test small cases and explain any proposed general rule. A calculator pattern can suggest a result; your mathematical reasoning must support it.

  1. Identify what the first part establishes and record the conditions under which it holds.
  2. When a later part introduces a new definition or model, connect it to methods you already know rather than assuming a new formula must have been memorised.
  3. Check the conclusion against an earlier numerical case and explain its meaning or limitation.

For the first-assessment-2021 courses. IB assessment reference ↗

Find a specific method or formula

Now practise the method

If you opened this guide from a question, return to that tab and try the method without looking at the example. Your answer stays in the question tab.

Practise this subtopic →

Want a broader practice session? Explore IB Maths AI SL practice questions →Explore IB Maths AI HL practice questions →Try free IB Maths exam-style questions and worked solutions →

Original Arc Practice teaching notes for Maths AI. Core and HL sections are distinguished above. These notes follow the first-assessment-2021 course and are not an official IB publication or a complete syllabus checklist. IB course reference. Report a correction.