# Real-world modeling with functions

> IB Mathematics: Applications and Interpretation SL · Unit 2: Functions
> Source: https://www.owlsprep.com/study/ib-math-ai-sl-u2-real-world-modeling-with-functions/

This module covers how to translate real-world problems into function models, fit functions to data, interpret results, and make predictions. You will learn to check model validity and comment on prediction reliability for IB exams.

**Prerequisites:** [Linear, exponential, and quadratic functions](https://www.owlsprep.com/study/ib-math-ai-sl-u2-types-of-functions/); [Using GDC for regression](https://www.owlsprep.com/study/ib-math-ai-sl-u4-regression-with-gdc/)

## Learning objectives

- Translate real-world scenarios into clearly defined function models
- Validate model fit and comment on prediction reliability
- Interpret model parameters in context for exam questions
- Select and fit cubic and variation models, and solve equations and systems, using a GDC

## Translating Context to Function Models

The first step in any modeling problem is to clearly define your variables. All variables must be stated in context with units to meet exam marking requirements.

**Function model** — A function that describes the relationship between variables in a real-world scenario, usually fitted to observed data.

*Notation:* $y = f(x)$

*Example:* $d = 4t + 2$, where $d$ = distance (km) and $t$ = time (hours)

**Worked example:** A café sells 120 sandwiches at \$4 each, and 80 sandwiches at \$6 each. Assume the relationship between price $p$ and number sold $n$ is linear. Write the model for $n$ in terms of $p$.

1. We have two points on the line: $(p_1, n_1) = (4, 120)$ and $(p_2, n_2) = (6, 80)$. First calculate the gradient:
2. $$m = \frac{n_2 - n_1}{p_2 - p_1} = \frac{80 - 120}{6 - 4} = -20$$
3. Substitute $m$ and one point into $n = mp + c$ to find the intercept $c$:
4. $$120 = (-20)(4) + c \implies c = 200$$
5. State the full model with defined variables:
6. $$n = -20p + 200 \quad \text{where } n = \text{number sold}, p = \text{price (USD)}$$

> **Exam tip:** Always define your variables with units before writing the model — this is almost always worth 1 mark.

## Fitting Models and Checking Validity

Most IB modeling questions require you to use your GDC to fit a function to given data. After fitting, you check how well the model matches data using the coefficient of determination $R^2$.

> **info**
>
> $R^2$ ranges from 0 to 1. A value close to 1 means the model fits the existing data very well, while a value close to 0 means a poor fit.

**Worked example:** Plant height (cm) after $t$ weeks: $(1, 2.1), (2, 3.9), (3, 5.8), (4, 8.2)$. Use GDC to fit a linear model and comment on fit.

1. Enter data into GDC linear regression. The output gives:
2. $$h = 2.01t + 0.05, \quad R^2 = 0.999$$
3. Interpret the result: $R^2$ is almost 1, so the linear model is an excellent fit for this observed data.

**Check your understanding**

Test your understanding of $R^2$:

1. Which $R^2$ value shows the best model fit?

   - 0.5
   - 0.92
   - 0.99
   - -0.2

   *Why:* Correct! $R^2$ ranges from 0 to 1, with 1 being a perfect fit to existing data.

## Interpolation vs Extrapolation

Once you have a model, you can use it to estimate unknown values. The reliability of your prediction depends on whether the estimate falls inside or outside the range of your original data.

**Prediction reliability** — How confident we can be that a model's prediction matches the real-world value. Interpolation within the data range is almost always more reliable than extrapolation outside the range.

*Example:* Predicting a 25-year-old's height from data for 1-18 year olds is extrapolation, and likely unreliable.

**Worked example:** Using the plant model $h = 2.01t + 0.05$, predict height after 10 weeks and comment on reliability. Original data is for $t = 1$ to $t = 4$.

1. Substitute $t=10$ into the model:
2. $$h = 2.01(10) + 0.05 = 20.15 \text{ cm}$$
3. Comment on reliability: $t=10$ is outside the original data range, so this is extrapolation. Plant growth slows and stops over time, so the linear trend will not continue. This prediction is unreliable.

> **Exam tip:** Always explicitly name your prediction as interpolation or extrapolation when asked to comment on reliability.

## Interpreting Model Parameters in Context

IB exams very frequently ask you to interpret the gradient, intercept, or growth factor of a model in context. You must always reference the variables and context to earn full marks.

**Worked example:** A linear model for car value is $V = -2500t + 20000$, where $V$ is value (USD) and $t$ is age (years). Interpret the gradient and intercept in context.

1. Interpret the intercept (when $t=0$, the car is new): The intercept is 20000, so the original value of the new car is \$20,000.
2. Interpret the gradient (rate of change of value with age): The gradient is -2500, so the value of the car decreases by \$2,500 per year on average.

## Cubic Models

Some real-world data rises, falls, then rises again — for example a company's monthly revenue that grows, dips, then recovers. When a linear, quadratic, or exponential model cannot capture this repeated change of direction, a cubic model is often a good choice.

**Cubic model** — A degree-3 polynomial model with four parameters $a, b, c, d$. It can have up to two turning points, so it suits data that changes direction twice. You fit the parameters using cubic regression on your GDC.

*Notation:* $f(x) = ax^3 + bx^2 + cx + d$

*Example:* $V(t) = -0.4t^3 + 2t^2 + 3t + 2$, modelling a drone's height $V$ (metres) $t$ seconds into a test flight.

> **info**
>
> You are not required to find $a, b, c, d$ algebraically. Enter the data points into your GDC's statistics editor and choose cubic (degree 3) regression — the GDC returns all four coefficients, and on most models an $R^2$ value as well.

**Worked example:** During a test flight a drone's height $H$ (metres) is recorded at time $t$ seconds: $(0, 2), (1, 6.6), (2, 12.8), (3, 18.2), (4, 20.4), (5, 17)$. Use your GDC to fit a cubic model, then estimate the height at $t = 2.5$ s.

1. Enter the six data points into the GDC statistics editor, with $t$ in one list and $H$ in another. Select cubic regression. The GDC returns:
2. $$H = -0.4t^3 + 2t^2 + 3t + 2, \quad R^2 = 1.00$$
3. To estimate the height at $t = 2.5$, substitute $t = 2.5$ into the fitted model (or use the GDC's table/value feature):
4. $$H = -0.4(2.5)^3 + 2(2.5)^2 + 3(2.5) + 2 = 15.75 \approx 15.8 \text{ m}$$
5. Since $t = 2.5$ lies inside the data range $0 \le t \le 5$, this is interpolation, so the estimate is reliable.

> **Exam tip:** For a cubic model, enter the data into your GDC and use cubic (degree 3) regression — you are never expected to find the four coefficients by hand.

## Direct and Inverse Variation Models

Many quantities relate as 'one is a power of the other'. These are modelled by $f(x) = ax^n$, where $n$ is an integer. When $n > 0$ the output grows with the input (direct variation); when $n < 0$ the output shrinks as the input grows (inverse variation).

**Direct and inverse variation** — A power model where the output varies as the $n$-th power of the input. If $n > 0$ (e.g. $y = ax^2$) the output increases as $x$ increases — direct variation. If $n < 0$ (e.g. $y = ax^{-1} = a/x$) the output decreases as $x$ increases — inverse variation.

*Notation:* $f(x) = ax^n, \; n \in \mathbb{Z}$

*Example:* $P = 1200V^{-1}$, i.e. $P = 1200/V$, modelling gas pressure $P$ (kPa) against volume $V$ (litres).

> **warning**
>
> When $n < 0$ the model has a vertical asymptote at $x = 0$ (the y-axis) and a horizontal asymptote at $y = 0$. As $x \to 0^{+}$ the output grows without bound, so an inverse-variation model can never be evaluated at $x = 0$.

**Worked example:** The time $t$ (hours) to fill a tank varies inversely with the pump rate $r$ (litres/min), so $t = a/r$. A pump running at 20 L/min fills the tank in 6 hours. Find the model, then find the time if the rate is increased to 30 L/min.

1. Inverse variation means $t = ar^{-1} = \dfrac{a}{r}$. Use the known pair $(r, t) = (20, 6)$ to find $a$:
2. $$6 = \frac{a}{20} \implies a = 120$$
3. So the model is:
4. $$t = \frac{120}{r}$$
5. Substitute $r = 30$ to find the new filling time:
6. $$t = \frac{120}{30} = 4 \text{ hours}$$

**Check your understanding**

Test your understanding of inverse variation:

1. What happens to the graph of $y = \dfrac{8}{x}$ near $x = 0$?

   - It crosses the y-axis at $y = 8$
   - It has a vertical asymptote at $x = 0$ (the y-axis)
   - It has a turning point at $x = 0$
   - It is a straight line through the origin

   *Why:* Correct! For $y = ax^n$ with $n < 0$, the y-axis is a vertical asymptote and the model is undefined at $x = 0$.

> **Exam tip:** For an inverse-variation model such as $y = a/x$, remember the graph has the y-axis ($x = 0$) as a vertical asymptote — the model can never be evaluated at $x = 0$.

## Solving Equations and Systems with Technology

Once you have a model, exam questions often ask you to solve an equation — for example to find when two models are equal, or which input gives a target output. In AI SL you are expected to do this with technology rather than by hand.

> **info**
>
> Your GDC can solve two kinds of problem for you: (1) systems of up to three linear equations in three unknowns, using the simultaneous-equation solver; and (2) polynomial equations, using the equation solver or the intersection of two graphs.

**Worked example:** Two phone plans charge a monthly cost $C$ (dollars) for $m$ minutes: Plan A is $C = 15 + 0.10m$ and Plan B is $C = 25 + 0.05m$. Use technology to find the number of minutes for which both plans cost the same.

1. The plans cost the same when the two models are equal. Set up the equation:
2. $$15 + 0.10m = 25 + 0.05m$$
3. Enter both expressions as $Y_1$ and $Y_2$ on the GDC and find the intersection (or use the equation solver). The GDC gives:
4. $$m = 200 \text{ minutes}$$
5. Check in context: at 200 minutes both plans cost $C = 15 + 0.10(200) = \$35$, confirming the solution.

**Worked example:** A shop sells small, medium, and large boxes at fixed prices $s$, $m$, $l$ dollars. Three orders are recorded: 2 small + 1 medium + 1 large costs \$16; 1 small + 3 medium + 2 large costs \$27; 3 small + 2 medium + 1 large costs \$23. Use technology to find each price.

1. Translate the three orders into a system of three linear equations in three unknowns:
2. $$\begin{cases} 2s + m + l = 16 \\ s + 3m + 2l = 27 \\ 3s + 2m + l = 23 \end{cases}$$
3. Enter the coefficients into the GDC's simultaneous-equation (3×3 linear system) solver. The GDC returns:
4. $$s = 3, \quad m = 4, \quad l = 6$$
5. State the answer in context: a small box costs \$3, a medium box \$4, and a large box \$6.

> **Exam tip:** When a modelling question asks you to 'solve' or 'find when', let the GDC do the work: use the equation solver or graph intersection for one equation, or the simultaneous-equation solver for a system.

## Common pitfalls

- **Wrong:** Forgetting to define variables with units before writing the model
  - Why it fails: Examiners almost always allocate 1 mark for clear variable definition, which you will lose if you skip this step
  - Correct: Always start your answer by stating what each variable represents, including its units
- **Wrong:** Claiming extrapolation is always unreliable without justification
  - Why it fails: Extrapolation can be reliable if the trend is known to continue beyond the data range; you need to reference the context
  - Correct: Explicitly name the prediction as extrapolation, then explain whether the trend is likely to continue in context
- **Wrong:** Interpreting a negative gradient as an error
  - Why it fails: A negative gradient simply means the dependent variable decreases as the independent variable increases, which is often correct
  - Correct: Interpret the sign according to context: a negative gradient for car value means the value depreciates (decreases) over time, which makes logical sense
- **Wrong:** Assuming a high $R^2$ means extrapolation is reliable
  - Why it fails: A high $R^2$ only confirms the model fits the existing data, it does not guarantee the trend continues beyond the data range
  - Correct: Always judge extrapolation reliability based on the context of the problem, not just $R^2$

## Cheatsheet

| Step | Required Action | Exam Tip |
| --- | --- | --- |
| 1 | Define variables with units | Almost always worth 1 mark |
| 2 | Find/fit the function equation | Double-check GDC data input |
| 3 | Check fit with $R^2$ | $R^2 \approx 1$ = good fit to data |
| 4 | Make prediction | State if interpolation/extrapolation |
| 5 | Comment on reliability | Extrapolation needs context justification |
| 6 | Interpret parameters | Always reference context and units |

## What's next

Real-world modeling with functions is a core skill that appears in every paper of IB AI SL, and forms the foundation for future topics including statistical regression, sequences and series growth models, and calculus applications to rates of change. This skill is also frequently assessed in internal assessment (IA) projects, where you will be expected to create your own model for a real-world dataset you choose. Mastering the process of translating context to a mathematical model, checking fit, and commenting on prediction reliability will earn you easy marks on almost every exam paper, and set you up for success in your IA.

- [Geometry and Trigonometry](https://www.owlsprep.com/study/ib-math-ai-sl-u3-overview/)
- [Volume and surface area of 3D solids](https://www.owlsprep.com/study/ib-math-ai-sl-u3-volume-and-surface-area-of/)
- [Right-angled triangle trigonometry](https://www.owlsprep.com/study/ib-math-ai-sl-u3-right-angled-triangle-trigonometry/)

---

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-real-world-modeling-with-functions/
