Int 3 for Programmers

Functions, transformations, composition and inverses

3 / 396
Contents

Contents

Int 3 for Programmers

0 of 396 complete

9 min read

The families of shapes

The parent functions you are expected to recognise on sight, and what tells them apart.

Most of the functions in this course are variations on a handful of basic shapes. Learn the shapes once and the rest of the year is small adjustments to them, so it is worth meeting the whole set together before any of them gets its own section.

Rather than being told what they look like, generate them. Run this and read down the columns.

Try CodePython

Add a column for x * x * x * x and run it again. Does the new column look more like the squaring column or the cubing one?

One of those column headings needs naming before anything else. The absolute value of a number, written between two upright bars as ∣x∣|x|, is its distance from zero. So ∣4∣=4|4| = 4 and ∣−4∣=4|-4| = 4: the size is kept and the sign is thrown away.

Three different behaviours are visible on the negative side. The identity column keeps the sign. The absolute value and squaring columns both throw the sign away, so they read the same forwards and backwards. The cubing column keeps the sign but grows far faster than the identity does.

The simplest member of each family, with nothing added, multiplied or shifted, is called the parent function. Everything else in the family is that parent moved or stretched, which is the subject of the next few lessons.

NameRuleShapeDomainRange
Constantf(x)=cf(x) = cA flat horizontal line(−∞,∞)(-\infty, \infty){c}\{c\}
Identity, or linearf(x)=xf(x) = xA straight slanted line(−∞,∞)(-\infty, \infty)(−∞,∞)(-\infty, \infty)
Absolute valuef(x)=∣x∣f(x) = |x|A V with its point at the origin(−∞,∞)(-\infty, \infty)[0,∞)[0, \infty)
Quadraticf(x)=x2f(x) = x^2A U-shaped parabola(−∞,∞)(-\infty, \infty)[0,∞)[0, \infty)
Cubicf(x)=x3f(x) = x^3Rising throughout, with a flat spot at the origin(−∞,∞)(-\infty, \infty)(−∞,∞)(-\infty, \infty)
Square rootf(x)=xf(x) = \sqrt{x}Half a parabola lying on its side[0,∞)[0, \infty)[0,∞)[0, \infty)
Reciprocalf(x)=1xf(x) = \frac{1}{x}Two separate branches either side of a gap{x∣x≠0}\{x \mid x \ne 0\}{y∣y≠0}\{y \mid y \ne 0\}
Exponentialf(x)=2xf(x) = 2^xFlat on the left, climbing steeply on the right(−∞,∞)(-\infty, \infty)(0,∞)(0, \infty)
The parent functions to know on sight. The last three are the subject of later sections; recognise the shape now.

The first five accept every real number. The last three are the ones with something to say about the domain: a square root refuses negatives, a reciprocal refuses zero, and an exponential accepts everything but never produces zero or anything below it.

Two of the ranges are worth pausing on, because they are the ones an exam asks for most often. The V and the U both have range [0,∞)[0, \infty), since neither an absolute value nor a square can be negative, and both reach 0 at the origin. The line and the cubic both have range (−∞,∞)(-\infty, \infty), since each of them produces every output somewhere.

Knowing the family before doing any algebra is what makes the rest of the year quick. If you can see that a rule is a shifted V, then you already know it has a corner, that it falls on one side of that corner and rises on the other, and that its lowest or highest point is there. None of that has to be worked out again for each new question.

One family at a time
y=x1y = x^{1}
-8-4048-2.5-1.2501.252.5
Height at x=2x = 2
2
Height at x=−2x = -2
-2

Drag p through 1, 2, 3 and 4. The odd powers keep the left half below the axis; the even powers fold it up above.

Telling two families apart from a table

Given only a table of values, there is a mechanical way to identify the family, and it is worth doing by machine once so that you trust it. Look at the differences between consecutive outputs.

Try CodePython

Change the rule to x * x and run it again. The change column is no longer constant. Then look at how the change column itself changes.

For 3x+23x + 2 the change is 3 every time. For x2x^2 the changes are 1, 3, 5, 7, 9, which are not constant, but the changes between those are 2, 2, 2, 2. A linear rule has constant first differences. A quadratic rule has constant second differences. A cubic needs three rounds.

A table gives f(1)=2f(1) = 2, f(2)=8f(2) = 8, f(3)=18f(3) = 18, f(4)=32f(4) = 32. Which family is it?

Quadratic. The first differences are 6, 10 and 14, which are not constant, so it is not linear. The second differences are 4 and 4, which are constant, so it is quadratic. The rule is in fact f(x)=2x2f(x) = 2x^2.

Check yourself

Which parent function has domain [0,∞)[0, \infty) and range [0,∞)[0, \infty)?

All lessons in Int 3 for Programmers