IB Maths AI HLNon-linear RegressionPaper 1 & 2~8 min read
Linearising using Logarithms
Logs don’t just straighten curves on a graph — they let you find the curve’s equation using ordinary linear regression. Take logs of an exponential (y = abx) or a power (y = axb) model and it rearranges into Y = mX + c. Fit that straight line on your GDC, then equate coefficients to recover a and b. The four-step routine is always the same; the one thing to watch is that the GDC’s “a” and “b” from its line are not the a and b of your model.
📘 What you need to know
Exponentialy = abx → take ln: ln y = ln a + x ln b. Plot ln y against x (semi-log) → straight line.
Powery = axb → take ln: ln y = ln a + b ln x. Plot ln y against ln x (log-log) → straight line.
Both become Y = mX + c — a linear form you can fit with regression.
The 4 steps: (1) linearise the data, (2) find the regression line Y = mX + c, (3) equate coefficients, (4) solve for a and b.
Exponential: m = ln b, c = ln a → a = ec, b = em.
Power: m = b, c = ln a → a = ec, b = m (the power b is just the gradient).
GDC warning: the calculator calls its regression line y = ax + b — its a is yourm, its b is yourc.
The two linearisations
Taking logs and splitting the powers turns each model into a straight line. Compare them side by side — the difference is what you put on the X-axis.
how each model rearranges into Y = mX + c
Exponential logs only the y (so X = x); power logs both (so X = ln x). In both, Y = ln y and c = ln a.
Exponential y = abx
Power y = axb
Logged form
ln y = ln a + x ln b
ln y = ln a + b ln x
X =
x
ln x
gradient m =
ln b
b
intercept c =
ln a
ln a
recover
a = ec, b = em
a = ec, b = m
🧠 Memory aid — “a is always e^c; only b changes”
In both models the intercept gives a = ec. The only difference is b: for a power model b is the gradient itself (b = m); for an exponential model the gradient is ln b, so b = em. Power = plain gradient, exponential = e of the gradient.
The four-step method
🧭 Recipe — finding a and b from linearised data
Linearise: set Y = ln y, and X = x (exponential) or X = ln x (power).
Find the regression line of Y on X: Y = mX + c (the GDC gives m as its “a“, c as its “b“).
Equate coefficients with the logged model (m = ln b or b; c = ln a).
Solve: a = ec; b = em (exponential) or b = m (power).
🤔 Why do the GDC’s a and b not match the model’s?
When you run a linear regression, the GDC always labels its output y = ax + b — that’s its naming, for the straight line through your logged points. But your model’s a and b live inside y = abx or axb. So the GDC’s “a” is your gradient m, and the GDC’s “b” is your intercept c. Always rename them to m and c before equating, or you’ll mix up four different constants.
Rename first: GDC’s a → your m (gradient), GDC’s b → your c (intercept). Then apply a = ec and the right rule for b.
Worked examples
WE 1
Set up the linear form (exponential)
For the model y = abx, write it in linear form and state X, m and c.
take ln of both sidesln y = ln a + x ln bmatch to Y = mX + cY = ln y, X = xm = ln b, c = ln aplot ln y against x (semi-log)exponential: only y is logged, so X = x.
WE 2
Find a and b (exponential)
An exponential model h = abt is linearised with x = t, y = ln h. The regression line of y on x is y = 4.382 − 1.005x. Find a and b.
logged model: ln h = ln a + t ln bequate coefficientsc = ln a = 4.382 → a = e^4.382 = 79.99…m = ln b = −1.005 → b = e^−1.005 = 0.36604…a = 80.0, b = 0.366 (3 sf)exponential: a = e^c, b = e^m.
WE 3
Set up the linear form (power)
For the model y = axb, write it in linear form and state X, m and c.
take ln of both sidesln y = ln a + b ln xmatch to Y = mX + cY = ln y, X = ln xm = b, c = ln aplot ln y against ln x (log-log)power: both logged, so X = ln x and the gradient IS b.
WE 4
Find a and b (power)
A power model t = ahb is coded with x = ln h, y = ln t. The regression line of y on x is y = 0.3 − 1.2x. Find a and b.
logged model: ln t = ln a + b ln hequate coefficientsc = ln a = 0.3 → a = e^0.3 = 1.3498…m = b = −1.2a = 1.35 (3 sf), b = −1.2power: a = e^c, but b is just the gradient (no e needed).
WE 5
Don’t confuse the GDC’s constants
A student fits a power model and the GDC reports the regression line as a = 2.5, b = 1.6. They write the model as y = 2.5x1.6. What’s their error?
the GDC’s a, b are the LINE’s gradient & interceptm = 2.5 (gradient), c = 1.6 (intercept)recover the model’s constantsb = m = 2.5a = e^c = e^1.6 = 4.95…correct model: y = 4.95 x^2.5never plug the GDC’s a, b straight in — rename to m, c first.
a = ec always. Only b differs: power b = m, exponential b = em.
Rename the GDC’s output: its a is your gradient m, its b is your intercept c.
Show the equating step (e.g. ln a = c) — it earns method marks.
Keep full GDC values for m and c before taking ec / em.
For a power model, b can be negative — it’s just the gradient, no exponentiation.
⚠ Common mistakes
Using the GDC’s a, b as the model’s a, b. They’re the gradient and intercept — rename to m, c.
Forgetting to take ec for a. The intercept is ln a, not a.
Taking em for b in a power model. There b = m directly.
Not taking em for b in an exponential model. There the gradient is ln b.
Logging the wrong variable: exponential needs X = x, power needs X = ln x.
Rounding m or c early before exponentiating — keep full values.
That completes the Non-linear Regression unit! You can now fit curves with a GDC, compare them with SSres and R2, read off log scales, and linearise power and exponential models to recover their parameters. These modelling skills are central to Paper 2 and a popular route for the IA.
Need help with Non-linear Regression?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.