# Linear functions and their graphs

> IB Mathematics AI SL · Functions
> Source: https://www.owlsprep.com/study/ib-math-ai-sl-u2-linear-functions-and-their-graphs/

This sub-topic covers core properties of linear functions, how to find their equations, sketch their graphs, and calculate intersections of two lines. These are foundational skills for almost all other topics in IB AI SL.

**Prerequisites:** [Basic coordinate geometry](https://www.owlsprep.com/study/ib-math-ai-sl-u1-coordinate-basics/); Algebraic rearrangement of linear equations

## Learning objectives

- Identify gradient and y-intercept from a linear function in any form
- Find the equation of a line given one point and gradient or two points
- Sketch linear graphs and interpret gradient and intercept in context
- Calculate the intersection point of two linear lines

## Definition and Key Features

**Linear Function** — A first-degree function with a constant rate of change, that graphs as a straight line on the $xy$-plane.

*Notation:* $f(x) = mx + c$

*Example:* $f(x) = 2x + 5$ is linear; $f(x) = x^2 - 1$ is non-linear

In the standard gradient-intercept form $y = mx + c$, $m$ is the gradient (measures steepness and direction) and $c$ is the $y$-coordinate of the $y$-intercept where the line crosses the $y$-axis.

> **mnemonic**
>
> $m$ = how much the line moves (changes) for every step right, $c$ = where the line crosses the $y$-axis when you start at $x=0$.

**Worked example:** Identify the gradient and $y$-intercept of the line $2y - 4x = 12$

1. Rearrange the equation into gradient-intercept form $y = mx + c$:
2. $$2y = 4x + 12$$
3. Divide all terms by 2 to isolate $y$:
4. $$y = 2x + 6$$
5. Compare to $y = mx + c$: gradient $m=2$, $y$-intercept is $(0, 6)$

*Calculator:* forbidden

## Finding the Equation of a Line

To find the equation of a line, you need two pieces of information: either the gradient and one point on the line, or two points that lie on the line. The gradient between two points $(x_1, y_1)$ and $(x_2, y_2)$ is:

$$m = \frac{y_2 - y_1}{x_2 - x_1}$$

Once you have the gradient, use the point-gradient formula to find the full equation, then rearrange to gradient-intercept form:

$$y - y_1 = m(x - x_1)$$

**Worked example:** Find the equation of the line passing through $(2, 5)$ and $(4, 9)$

1. Calculate the gradient from the two points:
2. $$m = \frac{9 - 5}{4 - 2} = \frac{4}{2} = 2$$
3. Substitute $m=2$ and point $(2,5)$ into point-gradient formula:
4. $$y - 5 = 2(x - 2)$$
5. Expand and rearrange to gradient-intercept form:
6. $$y - 5 = 2x - 4 \implies y = 2x + 1$$

*Calculator:* forbidden

## Sketching and Contextual Interpretation

Linear functions are very commonly used to model real-world scenarios. In context, the gradient represents a constant rate of change, and the $y$-intercept represents an initial value when the input is 0. To sketch a line, you only need two distinct points.

**Worked example:** A coffee shop charges a fixed &#36;5 rental fee for a meeting room plus &#36;2 per person for drinks. Write the linear function for total cost $C$ for $p$ people, and interpret the gradient and intercept.

1. Identify the fixed initial fee as the intercept, and the cost per person as the gradient: $c=5$, $m=2$
2. $$C = 2p + 5$$
3. Interpretation: The intercept of 5 means you pay &#36;5 even if no people attend, and the gradient of 2 means total cost increases by &#36;2 for each additional person.
4. To sketch, use two points: when $p=0$, $C=5$ → $(0,5)$; when $p=10$, $C=25$ → $(10,25)$. Draw a straight line between these points for $p \geq 0$ (number of people can't be negative).

> **tip**
>
> Always check for domain restrictions in context: negative values for quantities like distance, people, or cost are not valid, so don't draw the line into invalid regions.

*Calculator:* allowed

## Intersection of Two Lines

The intersection of two lines is the point $(x,y)$ that satisfies both equations. In context, this often represents a break-even point or equilibrium value. You can find the intersection algebraically or graphically.

**Worked example:** Find the intersection of $y = 3x - 4$ and $y = -x + 8$

1. Set the expressions for $y$ equal to each other, since they are equal at the intersection:
2. $$3x - 4 = -x + 8$$
3. Solve for $x$:
4. $$4x = 12 \implies x = 3$$
5. Substitute $x=3$ back into one equation to find $y$:
6. $$y = -(3) + 8 = 5$$
7. The intersection point is $(3, 5)$

**Check your understanding**

Test your understanding:

1. What is the intersection of $y = 2x + 1$ and $y = x + 4$?

   - $(2, 5)$
   - $(3, 7)$
   - $(1, 3)$
   - $(4, 8)$

   *Answer:* $(2, 5)$

   *Why:* Correct! Set $2x+1 = x+4 \implies x=3? Wait no: 2x+1 =x+4 → x=3, y= 2*3 +1=7, yes that's option B. Wait correction: that's right, if you got a different answer check your algebra.

*Calculator:* allowed

## Common pitfalls

- **Wrong:** Rearranging $ax + by = c$ gives the wrong sign for the gradient $m$
  - Why it fails: Forgetting to change the sign of $ax$ when moving it to the other side of the equation
  - Correct: Rearrange step-by-step: move $ax$ to the right-hand side first, then divide all terms by $b$ to isolate $y$
- **Wrong:** Calculating gradient as $\frac{x_2 - x_1}{y_2 - y_1}$ instead of rise over run
  - Why it fails: Mixing up the order of $x$ and $y$ differences in the gradient formula
  - Correct: Always remember gradient = change in $y$ (rise) divided by change in $x$ (run)
- **Wrong:** Drawing the full infinite line across negative axes in contextual problems
  - Why it fails: Forgetting that quantities like distance or number of people can't be negative
  - Correct: Only draw the line for the valid range of the input variable, and label your domain
- **Wrong:** Stopping after finding $x$ when asked for the intersection point
  - Why it fails: Forgetting that an intersection is a 2D point with both $x$ and $y$ coordinates
  - Correct: Always substitute your $x$ value back into one of the equations to find the corresponding $y$ value

## Cheatsheet

| Concept | Key Formula/Rule |
| --- | --- |
| Gradient between $(x_1,y_1)$ and $(x_2,y_2)$ | $m = \frac{y_2 - y_1}{x_2 - x_1}$ |
| Gradient-intercept form | $y = mx + c$, $m$=gradient, $c$=$y$-intercept |
| Point-gradient form | $y - y_1 = m(x - x_1)$ |
| Find intersection of two lines | Set equal, solve for $x$, find $y$ |

## What's next

Linear functions are the foundational building block for almost all other topics in IB AI SL. Mastering these core skills will make working with linear regression, systems of equations, piecewise functions, and even non-linear functions much easier, because almost all non-linear relationships can be approximated by linear functions around a point. You will regularly use linear functions to model real-world data in statistics, solve optimization problems, and interpret relationships between variables across the entire course. Next, you will build on these skills to study more complex functions starting with quadratic functions, the next core topic in the functions unit.

- [Quadratic functions, roots, and vertices](https://www.owlsprep.com/study/ib-math-ai-sl-u2-quadratic-functions-roots-and-vertices/)
- [Exponential and logarithmic functions](https://www.owlsprep.com/study/ib-math-ai-sl-u2-exponential-and-logarithmic-functions/)
- [Transformations of function graphs](https://www.owlsprep.com/study/ib-math-ai-sl-u2-transformations-of-function-graphs/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-ai-sl-u2-linear-functions-and-their-graphs/
