A student in a school corridor throws a tennis ball straight up at \(20\,\text{m/s}\) and catches it again. Ask the first question: where is the ball one second after the throw? There is one answer, \(15\,\text{m}\) above the hand. Now ask the reverse question: when is the ball \(15\,\text{m}\) above the hand? This time there are two answers, one on the way up and one on the way down.
A rule with one answer
A function is a rule that takes an input and returns exactly one output. The height of the ball is such a rule. With upward positive and \(g = 10\,\text{m/s}^2\), the height after a time \(t\) is \(h(t) = 20t - 5t^2\) metres. Put in \(t = 1\,\text{s}\) and the rule returns \(15\,\text{m}\). Put in \(t = 2\,\text{s}\) and it returns \(20\,\text{m}\).
The ball cannot be in two places at one instant. So every time gives exactly one height, and the height is a function of the time. We write \(h = f(t)\), or simply \(h(t)\). The letter \(f\) names the rule, and \(f(t)\) is its output for the input \(t\).
A function \(f\) is a rule that gives exactly one output \(f(x)\) for each allowed input \(x\). The input is the independent variable and the output is the dependent variable. The set of inputs the rule allows is the domain of the function.
The reverse question has two answers
Now reverse the question and ask when the ball is at \(15\,\text{m}\). Put \(20t - 5t^2 = 15\). Divide by \(5\) to get \(t^2 - 4t + 3 = 0\), which is \((t - 1)(t - 3) = 0\). So the ball is at \(15\,\text{m}\) at \(t = 1\,\text{s}\) and again at \(t = 3\,\text{s}\). One height gives two times, so the time is not a function of the height.
The slider shows a test that works on any graph. Draw a vertical line anywhere across the graph. If every such line meets the graph at most once, the graph is a function of the horizontal variable. A circle fails this test. The line \(x = 3\) meets the circle \(x^2 + y^2 = 25\) at \(y = 4\) and at \(y = -4\).
Which quantity goes on which axis
The independent variable goes along the horizontal axis and the dependent variable along the vertical axis. In a motion, time is almost always the independent variable. In an experiment, the quantity you choose or set is the independent one, and the quantity you measure is the dependent one. The phrase "\(y\) against \(x\)" puts \(y\) on the vertical axis and \(x\) on the horizontal axis.
Here is an example from the photoelectric effect. A student chooses the frequency \(\nu\) of the light with a filter, and then measures the stopping potential \(V_0\). The frequency is set, so it goes along the horizontal axis. The stopping potential is measured, so it goes along the vertical axis. The graph is "\(V_0\) against \(\nu\)".
The domain: where the rule applies
A rule may give numbers where the physics does not apply. The ball leaves the hand at \(t = 0\) and returns to it at \(t = 4\,\text{s}\). So the domain of \(h(t)\) is \(0 \le t \le 4\,\text{s}\). Put \(t = 5\,\text{s}\) into the formula and it returns \(-25\,\text{m}\), a height below the hand. The ball was caught a second earlier, so that number describes nothing.
A domain can also come from the mathematics. The force \(F = k/r^2\) has no value at \(r = 0\), because division by zero is not defined. The period \(T = 2\pi\sqrt{L/g}\) needs \(L \ge 0\), because a negative number has no real square root. A length, a mass and an absolute temperature are never negative.
A formula does not know its own domain. The height formula gives \(-25\,\text{m}\) at \(t = 5\,\text{s}\), and a quadratic can give a negative time. Always ask over which inputs the physics holds. A negative time, a negative length or a height below the floor is a sign that the input has left the domain.
In a laboratory, a student sets the current \(I\) through a wire with a rheostat and reads the voltage \(V\) across it. Which is the independent variable, and where does it go on the graph?
Which of these does not give \(y\) as a function of \(x\)?
The ball has \(h(t) = 20t - 5t^2\) metres. At \(t = 0.5\,\text{s}\) its height is \(8.75\,\text{m}\). At what later time, in seconds, is the ball again at \(8.75\,\text{m}\)?
Moving a graph without changing its shape
Take any function \(f(x)\) and a number \(a\). The new function \(f(x - a)\) has, at the point \(x\), the value that \(f\) had at the point \(x - a\). That point lies a distance \(a\) to the left. So every feature of the old graph appears a distance \(a\) to the right. A peak at \(x = 0\) moves to \(x = a\).
The minus sign inside the bracket moves the graph to the right, and this surprises many students. A plus sign, as in \(f(x + a)\), moves it to the left. A number added outside, as in \(f(x) + c\), is simpler. It raises every point by \(c\), so the graph moves up.
Back to physics: a pulse on a string
A pulse on a stretched string keeps its shape as it travels. Let its shape at \(t = 0\) be \(y = f(x)\). If it travels in the positive \(x\) direction at speed \(v\), then after a time \(t\) it has moved a distance \(vt\). So its shape at time \(t\) is the old shape moved right by \(vt\). That is \(y(x, t) = f(x - vt)\).
A pulse travels in the positive \(x\) direction with speed \(v = 10\,\text{m/s}\). Its shape at \(t = 0\) is \(y(x, 0) = f(x) = \sin x\). Which function gives the shape of the pulse at \(t = 2\,\text{s}\)?
In \(2\,\text{s}\) at \(10\,\text{m/s}\), the pulse travels \(vt = 20\,\text{m}\) towards \(+x\). This is the shift \(a = 20\,\text{m}\).
Replace \(x\) by \(x - 20\) in the first shape: \(y(x, 2) = f(x - 20) = \sin(x - 20)\).
Check with one feature. A crest of \(\sin x\) sits at \(x = \pi/2 = 1.57\,\text{m}\). The new crest sits where \(x - 20 = 1.57\), at \(x = 21.57\,\text{m}\), exactly \(20\,\text{m}\) further on.
How does the graph of \(y = f(x + 3)\) compare with the graph of \(y = f(x)\)?
A pulse on a rope is \(y = \dfrac{0.004}{1 + (x - 5t)^2}\), with \(x\) and \(y\) in metres and \(t\) in seconds. Where is its peak at \(t = 3\,\text{s}\), in metres?
A pulse has the shape \(f(x)\) at \(t = 0\) and travels in the negative \(x\) direction at \(4\,\text{m/s}\). What is its shape at time \(t\)?
Every graph in this book is the graph of a function. The chapter Graphical Understanding of Motion reads the position, the velocity and the acceleration as functions of time. The chapter Introduction to Waves writes a pulse as a function of position, \(y = f(x)\), and a travelling pulse as \(f(x - vt)\). A pulse reflected at a fixed end is the same function turned upside down. The photoelectric experiment plots the stopping potential as a function of the chosen frequency.
- Reading \(f(x - 2)\) as a graph moved to the left.A minus sign inside the bracket moves the graph right. The new graph reaches at \(x = 2\) the value that \(f\) had at \(0\).
- Putting the measured quantity along the horizontal axis.The chosen quantity, or the time, goes across. The measured quantity depends on it and goes up.
- Using a formula outside its domain.Ask where the physics holds, from the throw to the catch, for positive lengths, away from \(r = 0\). A negative time or length is a warning.