2 Notation
The ideas which are here expressed so laboriously are extremely simple …. The difficulty lies, not in the new ideas, but in escaping from the old ones, which [branch]1, for those brought up as most of us have been, into every corner of our minds. — John Maynard Keynes The General Theory of Employment, Interest, and Money, 1936
Good notation makes the writer’s intent clear to the reader. In our study of calculus, each component of notation will refer to a mathematical object of some kind. Consequently, the notation should, on its own, indicate the kind of object.
In the previous chapter, we described three different kinds of objects: functions, quantities, and spaces. We introduced mathematical and computer notation to make clear what is the name of a function and the names of inputs. In this chapter, we will introduce constants, parameters, and special inputs. We will see how input names, like \(x\) in \(g(x) \equiv x^3 + 3\) refer to a kind of space called a domain.
Notation (noun): a series or system of written symbols used to represent numbers, amounts, or elements in something such as music or mathematics. –Oxford Dictionaries
It makes obvious sense to use a mathematical notation with which you are already familiar. We will supplement this notation with simple rules for naming, intended to make it clear just from the name what kind of mathematical object is being named.
Since you will be using computing extensively, it will pay to be aware of how traditional mathematical notation sometimes conflicts with the requirements of computing. (Chapter 3 introduces computing with the R language.)
Traditional mathematical notation makes extensive use of spatial arrangement, as for instance in \(\frac{3}{4}\) or \(x^{-3}\) or \(\sqrt[4]{\strut y^2 - 6}\). For those familiar with it, this notation can be both concise and beautiful. But it was developed in an era of parchment and pen, without any inkling of keyboards and the strictly linear sequence of characters so widely used in written communication. Most mainstream computer languages are based on keyboard input.
Traditional mathematical notation was developed for communicating between people and, like everyday language, has gaps and ambiguities that get sorted out (not always correctly) by long experience. In contrast, computer language needs to be precise and unambiguous so they can be interpreted by machines.
We will attempt to use mathematical notation in a way that limits the conflict between tradition and computer notation. This conflict is particularly acute when it comes to the idea of an “equation,” so widely used in high-school mathematics but not a component of mainstream computer languages.
2.1 Functions, inputs, parameters
Our style of notation will be to give functions and their inputs explicit names. The basic principle is that a function name is a sequence of letters followed by an empty pair of parentheses, for instance, sin() or ln(). The parentheses provide clear indication that this is a function name.
Chapter 1 provided notation for defining a function includes the names of the parameters. In our mathematical notation, both the name of the function and the names of the inputs are shown on the left-hand side of the \(\equiv\) symbol. For instance, \[g(u, z) \equiv u\,\cos(z)\] defines a function named \(g()\) that takes two inputs. The input names are listed in the parentheses following the function name.
The right-hand side of a function definition is a formula. The formula specifies how each of the inputs will get used in a computation of the function output. When a function has more than one input, the input names serve to indicate where each input goes in the formula defining the calculation. For instance: \[h(x, y) \equiv x^2 e^y\ .\] \(h()\) is a completely different function than, say, \(f(x, y) \equiv y^2 e^x\).
A sensible person will define a function because they are planning to use it later on, perhaps multiple times. “Using” a function might mean including it in the formula in the definition of another function. But there is also a more specific sense of “using” to which we need to give a precise name. To apply a function means providing specific input quantities so that the output of the function can be calculated. An equivalent phrase is evaluate a function on an input(s). Consider, for instance, a simple function \[z(t) \equiv t^2\ .\] To apply the function \(z()\) to the input quantity 3, any of the following notation styles can be used: \[z(3)\ \ \ \text{or}\ \ \ \ z(t=3) \ \ \ \text{or}\ \ \ \ z(t)\left.\Large\strut\right|_{t=3}\ .\] Remember that \(z(3)\) or its equivalents are not themselves functions. They are the quantity that results from applying a the function to a specific input quantity, namely \(3\) in this example.
In defining a function, say, \(z(t) \equiv t^2\), one uses specific names for the arguments and writes the function formula using these same names. The application of a function to an input is different. When a function is being applied, the argument can be a numeral or any name that contains the value to serve as input. For instance, any of \(z(b)\), \(z(\text{age})\), or \(z(\text{orbit\_duration})\) can be correct ways to apply z()$.
2.1.1 Input names
To reduce human cognitive load in parsing function definitions, we will often select input names from a small set. This way, the name itself is a clue to what role that name is playing. Here are the most commonly used input names.
- \(x\) or \(y\) or \(z\).
- \(t\). This name is typically used when the input is meant to represent a time or duration.
- Less frequently, \(u\), \(v\), \(w\) when the other arguments are already in use.
Of course, it’s often appropriate to use other names for arguments. In modeling, to make clearer the relationship of functions and the real-world setting, it is a good idea to use more descriptive names, like \(T\) for “temperature” or \(V\) for volume, or even \(\text{altitude}\) (which helpfully describes itself).
In everyday speech, an “argument” is a discussion between people with differing views. But in mathematics and computing, argument means something else entirely: it is a synonym for “input to a function.”
Often, the functions we define will have formulas that include quantities other than the inputs. For instance, we might define: \[h(t) \equiv A \sin(t) + B\ .\] This definition explicitly identifies \(t\) as the name of the function input. The quantities named \(A\) and \(B\) that appear in the formula are not listed as inputs on the left side of \(\equiv\) but they are nonetheless essential for evaluating the function \(h()\).
There is a case to be made for identifying as inputs to the function all quantities needed for evaluating the function. In this style, the function would be defined as \(h(t,A,B) \equiv A \sin(t) + B\).
In writing mathematical notation for the human reader, there is a tradition of distinguishing between quantities that will differ from one evaluation to another and quantities that will be the same each time the function is evaluated. These latter quantities are called parameters.
In reading a definition such as \[h(t) \equiv A \sin(t) + B\ ,\] the named quantities that are not listed inside the parentheses on the left-hand side of the definition—\(A\) and \(B\) in this example—will be the parameters. By writing a name in the parameter style, we are signaling that these quantities will not be changing when we apply the function. That leaves unstated what are the values of the parameters, a source of confusion for many newcomers to calculus.
There is no absolute rule for identifying a named quantity used in a function’s formula as a parameter rather than as an input. It is a matter of style and the conventions of the field in which you’re working. When we get to the computer notation for defining functions, you will see that we simplify things by considering all named quantities used in a function formula as inputs.
A pendulum is a device that swings back and forth from a fixed pivot. The period of a pendulum is the time it takes to go through one complete cycle of motion—one “back” and one “forth.” It happens that it is simple to compute the period of a pendulum, \[\text{period}(L) \equiv \sqrt{\strut L/g\ }\] where \(L\) is the length of the pendulum, \(g\) is the “acceleration due to gravity.”
We could have written the function as \(\text{period}(L, g) \equiv \sqrt{\strut L/g\ }\), treating both quantities \(L\) and \(g\) as inputs. We wrote instead \(\text{period}(L)\) to signify something to the human reader: that we are anticipating the user of \(\text{period}()\) to be calculating the periods of various pendula, with different \(L\), but all in about the same location. That location will presumably be near the surface of the Earth, where \(g \approx 9.8\) m/s2. In other words, the definition of \(\text{period}(L)\) treats the acceleration due to gravity as a parameter rather than an input.
Of course, you might be the kind of person who puts pendula in elevators or on Mars. If so, you would need to use a different value for \(g\) than \(9.8\) m/s2.
You will see much more use of parameters in Block 11 when we use parameters to “fit” functions to data.
2.1.2 Parameter names
To make it easy to recognize parameters, we will use names like \(a\), \(b\), \(c\), \(\ldots\), or their upper-case cousins \(A\), \(B\), \(\ldots\). For instance, here is a definition of a function called a “cubic polynomial”: \[h(x)\equiv a + b x + c x^2 + d x^3\ .\]
But there will be occasions where we need to compare two or more functions and run out of appropriate names from the start of the alphabet. A way to keep things organized is to use subscripts on the letters, for instance comparing \[g(x) \equiv a_0 + a_1 x^2 + a_2 x^2 + a_3 x^3 + a_4 x^4\] to \[f(x) \equiv b_0 + b_1 x^2 + b_2 x^2\ .\]
Pronounce names \(a_0\) or \(b_3\) as “a-sub-zero” and “b-sub-three” respectively.
The tradition of using letters from the start of the alphabet as parameter names dates from the time of Isaac Newton.
Mathematicians and scientists often reach further back in history and use Greek letters as parameter names: \(\alpha\), \(\beta\), \(\gamma\), \(\delta\), … In this book, we minimize the use of Greek, but mastering the Greek alphabet is an important form of socialization when becoming a scientist.
2.2 Special inputs
We will create functions as models of a real-world situation. Once created, we generally have to extract information from the function that informs the real-world choice, decision, or understanding that we need to make or develop.
There are many forms that the extracted information will take, depending on circumstance. With surprising frequency, two types of information turn out to be useful:
- The set of inputs that produces a maximum or minimum output.
- Inputs that produce a specific output.
We will call these special inputs and will study the techniques for determining them later in the book. Here, we focus on the notation we will use so that you can spot when a special input is being used.
As we’ve stated before, the names of inputs will tend to be letters from the back of the alphabet: \(t\), \(u\), \(v\), \(x\), \(y\), \(z\). Each such name refers to the entire set of possible values, that is, a space in the sense of Chapter 1.
When we want to refer to a specific input value that describes a particular feature of a function, we will use the standard input names with a superscript—for instance, \(x^\star\)—or a subscript like \(y_1\) or \(u_0\).
Original word: “ramify”↩︎