IB Maths AI HL Log, Logistic & Piecewise Paper 2 & 3 Continuity, intervals ~9 min read

Piecewise Models

A piecewise model stitches together two or more functions, each on its own interval of the domain. Linear piecewise models (different rates over different intervals) handle tariffs, charges, and motion with constant acceleration phases. Non-linear pieces (quadratic, cubic, exponential) handle anything more curved. Continuity at the join lets you pin down unknown parameters.

📘 What you need to know

Choosing the right piece

Two questions arise constantly: “what is f at this x?” and “for what x does f equal this value?”. For the first, locate x in its interval, then plug into the matching piece — only the matching piece, never both. For the second, compute the piece endpoint values to see which interval can produce the target, then solve in that piece. A subtle trap: a solution from algebra might fall outside the piece’s domain, in which case you reject it and try the other piece. Always double-check that any candidate x actually lies in the interval whose formula you used.

Continuity at the join

Real-world piecewise models usually need to be continuous — you can’t have a tank’s water level jumping instantly from one value to another. So if a model is given as continuous and one of its parameters is unknown, the join equation f1(b) = f2(b) is your way in: it’s a single equation that usually has a single unknown. Substitute the join value b into both pieces, set the expressions equal, and solve for the parameter.

Pieces must agree at the join to be continuous Linear piecewise — two slopes x y 2 4 6 8 5 13 25 y = 5 + 2x slope 2 y = 13 + 3(x − 4) slope 3 (steeper) (4, 13) corner (0, 5) Non-linear piecewise — curve then line t h 2 4 6 8 10 8 12 20 h = 0.5 t² quadratic h = 8 + 2(t − 4) linear, slope 2 (4, 8) join (continuous)
Both models are continuous: the pieces meet exactly at the join (orange dot). The left model has a corner (slope changes abruptly); the right model joins smoothly from curve to line at (4, 8).
Piecewise model at a glance f(x) = { f1(x) on ax < b ; f2(x) on bx < c } continuity: f1(b) = f2(b) · check which piece a value or target falls in

Solving piecewise inverse problems

To find x given a target output, compute the piece-endpoint values to see which piece can produce the target, then solve in that piece. If a candidate solution falls outside that piece’s domain, reject it. Sometimes the target falls in a piece’s range but algebra also produces a solution in another piece’s range — check both. If a piece is monotonic, there’s at most one solution per piece; quadratic pieces can produce two candidates of which one (or both) might be valid.

Sanity check: after solving, plug your x back into the model. If the domain restriction or piece selection was wrong, the output will give the answer away.

🧭 Recipe — piecewise models

  1. Evaluate f(v): locate v in the right interval, plug into that piece only.
  2. Find unknown parameter by continuity: f1(b) = f2(b) at the join.
  3. Find x for a target: compute the piece endpoints to identify which piece’s range contains the target.
  4. Solve within that piece, then verify the answer lies in the piece’s domain.
  5. Multiple candidates: a quadratic piece can give two answers — reject any that fall outside the piece’s interval.

Worked examples

WE 1

Linear piecewise — water filling

The volume V(t) in litres of water collected at a filling station after t seconds is V(t) = {0.4t for 0 ≤ t ≤ 5; 2 + 0.6(t − 5) for t > 5}. (a) Find V(3). (b) Find V(10). (c) Find t when V(t) = 8.

(a) t = 3 ≤ 5 → first piece V(3) = 0.4(3) = 1.2 V(3) = 1.2 L (b) t = 10 > 5 → second piece V(10) = 2 + 0.6(5) = 5 V(10) = 5 L (c) V(5) = 2; 8 > 2 → second piece 2 + 0.6(t − 5) = 8 0.6(t − 5) = 6 ⇒ t − 5 = 10 t = 15 sec
WE 2

Mobile data plan

A monthly mobile bill C(d) in dollars when using d MB of data is C(d) = {5 for 0 ≤ d ≤ 500; 5 + 0.01(d − 500) for d > 500}. (a) Find C(300). (b) Find C(1200). (c) Find d when C = $20.

(a) d = 300 ≤ 500 → first piece C(300) = $5 (b) d = 1200 > 500 → second piece C(1200) = 5 + 0.01(700) = 5 + 7 C(1200) = $12 (c) target 20 > 5 → second piece 5 + 0.01(d − 500) = 20 0.01(d − 500) = 15 ⇒ d − 500 = 1500 d = 2000 MB
WE 3

Find missing parameter by continuity

A car accelerates from rest then maintains a constant speed. Its speed s(t) (m/s) at time t (s) is s(t) = {kt for 0 ≤ t ≤ 4; 12 for t > 4}, where the model is continuous. (a) Find k. (b) Find s(2).

(a) continuity at t = 4 k(4) = 12 k = 3 m/s² (b) t = 2 ≤ 4 → first piece s(2) = 3(2) s(2) = 6 m/s
WE 4

Quadratic + linear — water tank

The water height h(t) cm in a tank at time t seconds is h(t) = {0.5t2 for 0 ≤ t ≤ 4; a + 2(t − 4) for t > 4}. The model is continuous. (a) Find a. (b) Find h(2) and h(10). (c) Find t when h(t) = 12.

(a) continuity at t = 4 0.5(4)² = a + 0 8 = a a = 8 (b) t = 2 ≤ 4 → first piece h(2) = 0.5(4) = 2 t = 10 > 4 → second piece h(10) = 8 + 2(6) = 20 h(2) = 2 cm, h(10) = 20 cm (c) h(4) = 8; target 12 > 8 → second piece 8 + 2(t − 4) = 12 ⇒ t − 4 = 2 t = 6 sec
WE 5

Linear then quadratic — distance travelled

A vehicle’s distance from base d(t) km at time t hours is d(t) = {60t for 0 ≤ t ≤ 2; −5(t − 10)2 + A for 2 < t ≤ 10}. The model is continuous. (a) Find A. (b) Find d(5) and d(10). (c) Find t when d(t) = 260.

(a) continuity at t = 2 60(2) = −5(2 − 10)² + A 120 = −5(64) + A = A − 320 A = 440 (b) second piece for both d(5) = −5(25) + 440 = 315 d(10) = −5(0) + 440 = 440 (vertex) d(5) = 315 km, d(10) = 440 km (c) d(2) = 120, d(10) = 440; 260 is between → second piece −5(t − 10)² + 440 = 260 5(t − 10)² = 180 ⇒ (t − 10)² = 36 t − 10 = ±6 ⇒ t = 4 or t = 16 domain 2 < t ≤ 10 → reject 16 t = 4 hours (clean!)
WE 6

Comprehensive: parameter, max, target across pieces

A product’s monthly sales S(m) (in hundreds of units) over m months is S(m) = {100 + 30m for 0 ≤ m ≤ 8; a − 5(m − 12)2 for 8 < m ≤ 16}. The model is continuous. (a) Find a. (b) State the maximum sales and when. (c) Find S(15). (d) Find m when sales were 280.

(a) continuity at m = 8 100 + 30(8) = a − 5(8 − 12)² 340 = a − 80 a = 420 (b) second piece is downward parabola vertex at m = 12, S = 420 max 420 hundred units at m = 12 (c) m = 15 in second piece S(15) = 420 − 5(9) = 375 S(15) = 375 hundred units (d) S(8) = 340; target 280 < 340 → first piece 100 + 30m = 280 30m = 180 m = 6 checking the second piece for 280 gives m = 12 ± √28, but neither is in (8, 16] in a way that beats the first solution — so m = 6 from the first piece is correct.

💡 Top tips

âš  Common mistakes

Chapter complete — you now have all three modelling-with-functions topics: Natural Logarithmic, Logistic, and Piecewise. Together they cover the heart of AI HL Paper 2 and 3 modelling problems.

Need help with Piecewise Models?

Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.

Book Free Session →