mathematics / functions / the function
The Function
A function is not a formula. It is a rule that gives every input it accepts exactly one output, and the three things worth knowing are which inputs it refuses, which outputs it never reaches, and what a graph actually records.
By the end you can
- say what disqualifies a rule from being a function, and test a drawing for it with a vertical line
- work out which inputs a rule refuses, and tell a single refused point from a whole refused stretch
- use 1/x to work out a real balance, and say why its refusal at zero is a physical fact rather than a notation rule
- read a value off a curve going up from the input, and go back the other way from an output
- recognise an open circle as an input the rule has no value at
A function is a machine
A function takes one input, returns one output, and returns the same output every time it is given the same input.
Most people meet a function as a formula with an f in front of it. That description is too loose. It lets in rules that mathematics does not count as functions, and the ones it wrongly lets in are exactly the ones that break everything built later.
A is a rule with three parts: a set of inputs it accepts, a place the outputs live, and an assignment giving every accepted input exactly one output. The words to hold on to are "exactly one".
now: f(4.000) = 9.000
before: none yet
feed a value twice to compare.
Teal marks the input side, amber the output side, and the pipe carries the input through the box to whatever the rule produces. Every output gets its own dot on the bottom line, so the number of dots is the number of answers: right now exactly one comes out. The faint pipes are the last 4 inputs you fed, so feeding one twice lands the new pipe exactly on an old one and nothing new appears on screen. The fourth chip is written y² = x rather than f(x) = something, because that notation already assumes the answer is single, and this rule's answer is not.
A number line of inputs across the top, a machine box below it, and a number line of outputs along the bottom. A pipe runs from the input you set, down through the box, to every output the rule produces.
Count what arrives on the output line. For most of the rules on offer, one thing arrives. For one of them the pipe can split inside the box, two things arrive, and nothing in the rule chooses between them. That count is the whole step.
Then feed the same input a second time and compare the two runs.
Feed the machine the same number twice. The same thing comes out twice. A rule that returned 7 on the first run and 8 on the second would not be a function, however respectable its formula looked, because the input no longer decides the output.
Now the rule that fails. Take y² = x. Ask it for x = 4 and it has two answers, y = 2 and y = −2, because both of those square to 4. Nothing in the rule chooses between them. So y² = x is not a function of x. It is a usable equation and it describes a real curve. It is not a function.
This is repairable, and the repair is where a convention you have already used comes from. The square root sign √ is defined to mean the non-negative root only, so √4 is 2 and never −2. That definition exists to turn a two-answer rule into a one-answer one. Half the curve is thrown away to buy the "exactly one".
One note on notation, because it trips people who read it as algebra. In f(x), the letter f names the rule and x names the input, and f(4) means the output that rule gives when fed 4. There is no multiplication in it.
Not every input is allowed
The domain is the set of inputs a rule accepts, and a rule can refuse a single point or a whole stretch of the line.
A rule can be written down and still have numbers it cannot take. Handing it one of those is not a mistake that produces a bad answer. It produces no answer.
The of a function is the set of inputs it accepts. It is part of the function, not a footnote to it. Two rules with the same formula and different domains are two different functions, and the last step of this page turns on exactly that.
f(1.000) = 1.000.
Teal marks the input side, amber the output side, and the pipe carries the input through the box to whatever the rule produces. Every output gets its own dot on the bottom line, so the number of dots is the number of answers: right now exactly one comes out. The thick teal band covers every input the rule accepts and the thin grey line is where it does not. An open circle is a point taken out, and a filled dot is one that is included. A pipe that reaches the frame edge ends in an open chevron, meaning the value is off the end of this drawing, and the readout under the drawing prints that number in full at every width. The output line here runs from −10 to 10. When nothing comes out there is no pipe below the cap and no chevron either, because a chevron would say the value went off in some direction and there is no value to go anywhere.
The same machine as the previous step, with the input line now marked to show which values the rule accepts and which it refuses.
Move the input onto a refused value, then onto an accepted one beside it. When the rule refuses, nothing runs out of the box, and the readout says in words that there is no value. It never prints a zero there, because zero is a number and this is the absence of one.
Then look at where an accepted stretch ends. The mark at that end says whether the boundary point is included or taken out.
Two refusals matter more than all the others. The first is division by zero. In 1/x, the input 0 is refused, because no number multiplied by 0 gives 1, so the expression 1/0 names nothing. It is not large and it is not zero. There is no number there to name.
The second is the square root of a negative. In √x, every input below 0 is refused, because no real number multiplied by itself is negative. Complex numbers do give √(−4) a value, and they are a different subject from this page. Here the answer is that the rule refuses.
Those two refusals have different shapes, and the shape is worth seeing. 1/x punches out a single point and keeps everything on both sides of it. √x cuts off a whole half of the line at once and keeps the rest. A domain is not always a formula with a hole in it, and it is not always an interval.
One honest warning about the picture. 1/x has no ceiling near zero. At x = 0.1 it is 10, at x = 0.01 it is 100, at x = 0.001 it is 1000, and the numbers keep going for as long as you keep dividing. No drawing can show all of that, so whatever the figure does when the output leaves the top of its scale, that is the drawing running out of room and not the machine returning a finite answer.
The mark for an excluded point has a name and it is used from here on. An drawn on a line or a curve says the point sits there and is not included. It is drawn so you can see where it would be, and left unfilled so you can see that it is not there. The last step of this page comes back to it, and a later page in this series is built on almost nothing else.
The rule doing a job
A weight 12 kg at one metre from a pivot is balanced by 12/d kilograms at distance d, and the beam checks that arithmetic by going level.
Here is a job with no f(x) in it. A beam sits on a pivot. A 12 kg block is bolted to the beam one metre to the left of the pivot and cannot be moved. You have a stack of one kilogram blocks and the whole right arm to put them on. How heavy does your stack need to be?
The answer depends on where you stand it, and the mechanism is old. A beam balances when the turning effect on one side matches the turning effect on the other, and the turning effect of a weight is its mass multiplied by its distance from the pivot. The left side gives 12 · 1.0 = 12, fixed. So your stack, at distance d, must satisfy m · d = 12, which rearranges to m = 12/d. That is the rule from the previous step, scaled by 12, and it now has a unit attached to it.
m = 12 / d = 12 / 2.000 = 6.000 kg
Tipped 16.0° to the left. 0.000 · 2.000 = 0.000 against 12.000.
The block on the left is fixed at 12 kg, 1.0 m from the pivot, and cannot be moved. You choose where your stack stands and how heavy it is, one kilogram per block. Your blocks are outlined in amber, the hue this subject gives the output side, because their total mass is the number the rule works out. The line above the drawing is worked out from the rule and the distance and nothing else; the tilt is worked out from the blocks actually on the beam and nothing else. They are two separate sums, and the beam goes level exactly when they agree. The dashed outline behind your stack is the height the rule asks for, so a stack that fills it exactly is a stack that balances. Right now the rule asks for 6.000 kg and you have 0.000 kg on the beam. A stack taller than the frame is cut off at the top with an open chevron and its true height printed beside it, because the drawing has run out of room and the count has not.
A beam on a pivot. The block on the left is fixed at 12 kg, one metre out. The movable stack is yours: you choose how far from the pivot it stands and how heavy it is.
Look at the beam rather than at the stack. The line above the drawing is worked out from the rule and the distance, and nothing else. The tilt is worked out from the blocks that are on the beam, and nothing else. They are two separate sums, so the beam going level is a check on the rule rather than a restatement of it.
Two calculations run in this figure and neither one reads the other. The line above the drawing works out 12/d from the rule and the distance, and nothing else. The tilt of the beam is worked out from the mass and the distance of the blocks that are actually on it, and nothing else. They agree by coming out the same, not by being the same sum written twice, which is what makes the beam going level a check on the rule rather than a picture of it.
Now walk the stack in towards the pivot. At 2.0 m the rule asks for 6 kg. At 1.0 m it asks for 12. At 0.5 m it asks for 24, which is every block the drawing has. At 0.2 m it asks for 60, and you cannot build that here. It would be easy to conclude that you need a bigger machine, and for every distance above zero that is true: the number exists and something could be stacked that high. At exactly the pivot the conclusion breaks. Distance 0 means turning effect 0, whatever the mass is, so twenty-four blocks on the pivot turn the beam exactly as much as no blocks do. Nothing levels it. That is the difference between a number too big to draw and no number at all, and it is what 12/0 being undefined means with your hands on it.
What comes out
The range is the set of values a function actually produces, and large parts of the output line can be values it never reaches.
The domain answers which inputs go in. It says nothing about what comes out, and those are separate questions with separate answers.
The of a function is the set of values it produces as the input runs over the whole domain. Not the values it is allowed to produce, the ones it does produce.
x = 1.000 maps to 1.000
reached so far: nothing yet
never reached: −2.000 to 9.000
Teal marks the input side and amber the output side. Every arrow joins one input to one output. The thick bands are what has been visited on the input line and produced on the output line; a thin grey stretch is somewhere nothing has ever landed. The output line is drawn at the size it will have once it stands up as a vertical axis, which is why it is shorter than the input line. Right now the rule has reached nothing yet, and its whole range is every number that is 0 or bigger.
Two number lines. The upper one is the input, the lower one is the output. An arrow runs from the input you set down to the value the rule gives it, and where the rule gives nothing the figure draws no arrow.
Watch the lower line rather than the upper one. Sweeping the input marks every value that has come out. Whatever is still unmarked on the lower line after a full sweep is a set of values nothing on this stretch of input produced, and that is the range being found rather than stated.
Take x², whose domain is every real number, so nothing is refused at the input end at all. Squaring a positive gives a positive. Squaring a negative also gives a positive, because two negatives multiplied give a positive. Squaring zero gives zero. So no matter how far you sweep the input in either direction, the output never lands below 0. The whole negative half of the output line is unreachable, and it stays empty because of what the rule does, not because you have not swept far enough.
That is the range being found rather than stated, and it is worth noticing that the input side gave no hint of it. A rule that accepts everything can still produce almost nothing.
The range is usually harder to pin down than the domain, and pretending otherwise helps nobody. Finding a domain is a search for local failures: a zero on the bottom of a fraction, a negative under a root. Finding a range is a question about the rule as a whole, and for many rules it takes real work.
Two more, for contrast. 1/x refuses the input 0, and it also never outputs 0, because a fraction with 1 on top is never zero however large the bottom gets. Every other number does come out. And 2x + 1 refuses no input and misses no output: give it any target y and the input (y − 1)/2 hits it. That last case matters more than it looks. A page this full of refusals leaves a reader assuming every rule has one, and this one has none at either end.
The graph is the function
A graph is not a picture that resembles a formula, it is the record of every input and output pair, one point each.
Here is the misreading this step exists to remove. A graph is not a drawing of a formula, and the curve is not an illustration of the algebra. The graph is a record.
For every input the function accepts, take the pair made of that input and its output. Mark the point that far along and that far up. The graph is the set of all those points and it contains nothing else. A curve looks continuous because the points are dense, not because a line was drawn through a formula.
x = 1.000 maps to 1.000
answer first
Try it How many times does the forked curve meet the vertical line at x = 0?
Pick one The figure holds the answer back until you do.
Teal marks the input side and amber the output side. Every arrow joins one input to one output. When the output line stands up, each arrow bends at the corner where its input and its output meet, and that corner is a point of the graph. Nothing is added and nothing is thrown away: the curve is the arrows. The curve itself is plain ink rather than teal or amber, because a point on it is an input and an output at once. The vertical line becomes available once the plane is folded, and it reports how many outputs the rule gives for the input it stands on.
Two number lines with arrows between them, and the same pairs again as points on a pair of axes. The figure holds one of those two states at a time, and a control moves between them.
Take the figure to each state at least once before reading on. Then pick one point on the curve and find the arrow that became it, because the claim of this step is that they are the same pair recorded twice.
A vertical line can be placed on the axes state. Count how many times it meets the drawing.
The two number lines you swept in the previous step already hold every pair. They hold them awkwardly. To see how the output changes as the input moves, you have to follow the far end of a moving arrow across a gap. Standing the output line up at right angles turns each arrow into one point, and a moving input then leaves a path you can take in at once. The fold adds no information and loses none. It is the same set of pairs, filed differently.
With the plane built, the test people are given first falls out on its own. The : put a vertical line anywhere on the plane. That line picks out one input value and every output that input has. If the line meets the drawing more than once, that input has more than one output, and the drawing is not the graph of a function.
Bring back y² = x from the machine. Its drawing is a sideways curve, and a vertical line to the right of 0 cuts it twice, at y and at −y. That is the machine forking, drawn. The test is not an extra rule to remember. It is the definition read off the page.
Horizontal lines are a different matter, and nothing stops one crossing a curve many times. Many inputs sharing one output is ordinary and allowed. One input with many outputs is what the definition bans. The next step is what that asymmetry feels like from the inside.
Reading a value off the graph
Go up from the input to the curve, then across to the output axis, and the same route run backwards asks a different question with possibly several answers.
Somebody hands you a plotted curve and no formula: a calibration chart for a sensor, a figure in a paper whose data table was not published. The procedure for getting the output at one input is two moves. Go up from your input on the horizontal axis until you meet the curve, then go across to the vertical axis and read the value where you land. Up finds the pair, across reports it.
Up from x = 2.000 meets the curve, then across gives y = 4.000.
The teal guide goes up from the input on the horizontal axis, and the amber guide goes across from the curve to the output on the vertical one. The curve itself is plain ink, because a point on it is an input and an output at the same time. Going the other way, the hollow square on the vertical axis casts an amber line that crosses the curve wherever some input produces that output, with a teal guide dropping from each crossing to the input that made it. Right now the figure is reading forwards, and x = 2.000 gives 4.000. Two inputs sharing one output is allowed. One input with two outputs is not, which is what the fold showed.
A curve on axes, with a handle on each axis. One handle is live and the other is dimmed, and a control decides which.
From the horizontal axis the figure reads up to the curve and then across to the vertical axis, which is the ordinary way to look a value up. From the vertical axis it runs the other way, marking every input that produces the output you set.
That second question can have two answers, one, or none. Either direction can also come up empty, and the figure says so rather than drawing a guess.
Now run it backwards, because that is where the definition shows its shape. Start at a value on the output axis, go across to the curve, then down. You are asking a different question: which inputs produce this output?
The backwards question can have more than one answer. For x², the output 9 comes from x = 3 and from x = −3, so going across from 9 meets the curve twice and drops to two different inputs. It can also have none: no input makes x² equal −1, so going across from −1 never meets the curve at all.
Many inputs to one output is allowed. One input to many outputs is not. That is the asymmetry the whole definition rests on, and it is why the test that fell out of the fold is about vertical lines and there is no matching test for horizontal ones.
When the machine jams
A rule can refuse one single input while behaving perfectly on both sides of it, which leaves a curve with a point missing rather than a value.
The domain step had refusals you could see coming. 1/x runs away near zero and √x cuts off half the line. This one is quieter.
Take the rule (x² − 1)/(x − 1). The bottom is 0 when x = 1, so 1 is refused and is not in the domain. Nothing new so far.
Now factor the top. x² − 1 is (x − 1)(x + 1). For every input other than 1, the factor of x − 1 appears on the top and on the bottom and cancels, so the rule returns x + 1. Its graph is the straight line of x + 1 with a single point taken out of it, marked with the open circle from the domain step.
x = 0.000 gives 1.000.
| x | x² − 1 | x − 1 | the ratio |
|---|---|---|---|
| 0.900 | −0.190 | −0.100 | 1.900 |
| 0.990 | −0.020 | −0.010 | 1.990 |
| 1.000 | 0.000 | 0.000 | undefined |
| 1.010 | 0.020 | 0.010 | 2.010 |
| 1.100 | 0.210 | 0.100 | 2.100 |
| 0.000 marker | −1.000 | −1.000 | 1.000 |
Teal marks the input side and amber the output side: the dashed teal guide drops from the marker to its x on the horizontal axis, and the dashed amber one runs across to its y on the vertical one. The curve is a straight line with one point taken out of it. The open circle marks where that point would be: a hollow ring means the curve does not include it, and every filled dot means it does. On both sides of the ring the rule behaves perfectly, and the table shows what it gives at five values of x. At the missing x the last column reads undefined, not because the cell is empty but because the rule produces nothing there: it divides by 1 − 1, and no number is the answer to that. The marker cannot be dragged onto it. It skips across, and the readout says why.
A curve that looks straight, with one open circle on it, and a table of values under the drawing.
The open circle marks an input the rule refuses. Every other point drawn is a value the rule returns. Move the marker along the curve and watch it reach the circle: it cannot land there, and the readout says why rather than going blank.
The refused input has a row in the table like every other input in it. That row says in words that there is no value. An empty cell would look like an oversight, and this is not one.
Compare the two kinds of refusal directly. Near 0, the values of 1/x have no settled behaviour at all: they climb without bound on one side and fall without bound on the other. Here, neither side runs away. At x = 0.9 the rule gives 1.9. At x = 0.99 it gives 1.99. At x = 1.01 it gives 2.01. The values sit close together on both sides and get closer as the input moves in. At exactly x = 1 the rule gives nothing.
You could write down a second rule, x + 1, that refuses nothing. It agrees with this one at every input this one accepts. It is not the same function, because a function includes its domain and these two do not have the same domain. One of them has a value at 1 and the other has an input it turns away.
So stop here with the question, because it is a better thing to leave with than an answer. The values on both sides crowd towards something. The rule itself has nothing at the point they crowd towards. Whether that gap can be filled, what it would be filled with, and by what right anyone would fill it, are not questions this page can settle. A later page in this series is built entirely on them.
Every number on this page is worked out from the controls as you set them, including the ones in the legends and in the table. Nothing here was stored as a picture. Each figure keeps its own input and its own choice of rule, because the rules on offer differ from one figure to the next.
Challenge
m = 12 / d = 12 / 2.000 = 6.000 kg
Tipped 16.0° to the left. 0.000 · 2.000 = 0.000 against 12.000.
Try it Put twelve blocks on the beam. Where can they stand so the beam never levels?
Not yet At 2.0 m the rule asks for 6.000 kg. Build a stack that heavy and the beam goes level.
The block on the left is fixed at 12 kg, 1.0 m from the pivot, and cannot be moved. You choose where your stack stands and how heavy it is, one kilogram per block. Your blocks are outlined in amber, the hue this subject gives the output side, because their total mass is the number the rule works out. The line above the drawing is worked out from the rule and the distance and nothing else; the tilt is worked out from the blocks actually on the beam and nothing else. They are two separate sums, and the beam goes level exactly when they agree. The dashed outline behind your stack is the height the rule asks for, so a stack that fills it exactly is a stack that balances. Right now the rule asks for 6.000 kg and you have 0.000 kg on the beam. A stack taller than the frame is cut off at the top with an open chevron and its true height printed beside it, because the drawing has run out of room and the count has not.