Title: 2.1 Basic Concepts of Functions
Course: HELM Workbooks 2023-2024

The Function Rule

A function can be thought of as a rule which operates on an input and produces an output. This is often illustrated pictorially in two ways as shown in the figure below. The first way is by using a block diagram which consists of a box showing the input, the output and the rule. We often write the rule inside the box. The second way is to use two sets, one to represent the input and one to represent the output, with an arrow showing the relationship between them.

[Image: Definition of a function]
A general function

More precisely, a rule is a function if it produces only a single output for any given input. The function with the rule ‘treble the input’ is shown in the figure below.

[Image: Input and output of a function]
The function with the rule ‘treble the input’

Note that with an input of \(4\) the function will produce an output of \(12\). With a more general input, \(x\) say, the output will be \(3x\). It is usual to assign a letter or other symbol to a function in order to label it. The trebling function in the figure above has been given the symbol \(f\).

Key Point

A function is a rule which operates on an input and produces a single output from that input.

Exercise

Write down the output from the function shown in the figure below

[Image: output of a function]

When the input is:
1. [value], the output is
2. [value], the output is
Feedback: In each case the function rule instructs you to multiply the input by \(7\) and then subtract \(2\). 1. When the input is [value], the output is \(\left(7 \times [value] - 2\right) = [value].\) 2. When the when the input is \(z\), the output is \([value].\)

Several different notations are used to describe functions. For the trebling function in the figure above, it is common to write

\(\qquad f(x) = 3x.\)

This indicates that with an input \(x\), the function, \(f\), produces an output of \(3x\). The input to the function is placed in the brackets after the '\(f\)'. Now, \(f(x)\) is read as '\(f\) is a function of \(x\)', or simply '\(f\) of \(x\)', meaning that the value of the output from the function depends upon the value of the input \(x\). The value of the output is often called the `value of the function’.

Example

State in words the rule defined by each of the following functions:

1. \(f(x)=6x\).
2. \(f(t)=6t-1\).
3. \(g(x)=x^2-7\).
4. \(h(t)=t^3+5\).
5. \(p(x)=x^3+5\).

Solution

1. The rule for \(f\) is ‘multiply the input by \(6\)’.
2. Here the input has been labelled \(t\). The rule for \(f\) is ‘multiply the input by \(6\) and subtract \(1\)’.
3. Here the function has been labelled \(g\). The rule for \(g\) is ‘square the input and subtract \(7\)’.
4. The rule for \(h\) is ‘cube the input and add \(5\)’.
5. The rule for \(p\) is ‘cube the input and add \(5\)’.

Note from the Example above, parts (d) and (e), that it is the rule that is important when describing a function and not the letters used. Both \(h(t)\) and \(p(x)\) instruct us to ‘cube the input and add \(5\)’. Different letter are used for the variables in each case but both functions do the same thing.

Example

Write down a mathematical function which can be used to describe the following rules:

1. ‘square the input and divide the result by \(2\)’. Use the letter \(x\) for input and the letter \(f\) to represent the function.
2. ‘divide the input by \(3\) and add \(7\)’. Call the function \(g\) and call the input \(t\).

Solution

1. \( \displaystyle{f(x)={x^2\over 2}}\).
2. \( \displaystyle{g(t)={t\over 3} + 7}\).

Example

State the rule of each of the following functions:

1. \(f(x)=5x\),
2. \(f(t)=5t\),
3. \(f(t)=1-t\),
4. \(f(x)=8x+10\),
5. \(f(t)=7t-27\),
6. \(\displaystyle{h(t)={t\over 3}+ {2\over 3}}\),
7. \(\displaystyle{f(x)={1\over 1+x}}\).

Solution

1. multiply the input by \(5\).
2. same as (a).
3. subtract the input from \(1\).
4. multiply the input by \(8\) and then add \(10\).
5. multiply the input by \(7\) and then subtract \(27\).
6. divide the input by \(3\) and then add \(2/3\).
7. add \(1\) to the input and then find the reciprocal of the result.

The Argument of a Function

The input to a function is sometimes called its argument or independent variable. It is frequently necessary to obtain the output from a function if we are given its argument. For example, given the function \(g(t)=3t+2\) we may require the value of the output when the argument is \(4\). We write this as \(g(t=4)\) or more usually and compactly as \(g(4)\). In this case the value of \(g(4)\) is \(3\times 4+2=14\).

Example

Given the function \(f(x)=3x+1\) find

1. \(f(2)\)
2. \(f(-1)\)
3. \(f(6)\)

Solution

1. The output from the function needs to be found when the argument or input is \(2\). We need to replace \(x\) by \(2\) in the expression for the function. We find \( f(2)=3\times 2 + 1 = 7\).
2. Here the argument is \(-1\). We find \(f(-1)=3\times (-1) +1 = -2\).
3. \(f(6)=3\times 6+1=19\).

It is possible to obtain the value of a function when the argument is an algebraic expression. Consider the following Example.

Example

Given the function \(y(x)=3x+2\) find

1. \(y(t)\)
2. \(y(2t)\)
3. \(y(z+2)\)
4. \(y(5x)\)

Solution

The rule for this function is ‘multiply the input by \(3\) and then add \(2\)’. We can apply this rule whatever the argument.

1. In this case the argument is \(t\). Multiplying this by \(3\) and adding \(2\) we find \(y(t)=3t+2\). Equivalently we can replace \(x\) by \(t\) in the expression for the function, so, \(y(t)=3t+2\).
2. In this case the argument is \(2t\). We need to replace \(x\) by \(2t\) in the expression for the function. So \(y(2t)=3(2t)+2=6t+2\).
3. In this case the argument is \(z+2\). We find \(y(z+2)=3(z+2)+2=3z+8\). It is important to note that \(y(z+2)\) is not \(y\times (z+2)=yz+2y\) but instead reads ‘\(y\) of \((z+2)\)’ where ‘ of’ means ‘take the function of’.
4. Here we have a complication. The argument is \(5x\) and so there appears to be a clash of notation with the original expression for the function. There is no problem if we remember that the rule is to multiply the input by \(3\) and then add \(2\). The input now is \(5x\). So \(y(5x)=3(5x)+2=15x+2\).

Exercise

Given \(f\left(x\right) = [value]\) evaluate:

1. \(f\left([value]\right)=\) .
2. \(f\left([value]\right)=\) .
Feedback: 1. We must substitute [value] in place of \(x\) in the definition of the function: \[\begin{array}{rcl}\displaystyle f\left([value]\right) &\displaystyle =&\displaystyle [value] \cdot ([value])^2 + ([value]) \cdot ([value]) + ([value])\\ &\displaystyle =&\displaystyle [value]\mbox{.} \end{array}\] 2. We must substitute [value] in place of \(x\) in the definition of the function: \[\begin{array}{rcl}\displaystyle f\left([value]\right) &\displaystyle =&\displaystyle [value] \cdot ([value])^2 + ([value]) \cdot ([value]) + ([value])\\ &\displaystyle =&\displaystyle [value]\mbox{.} \end{array}\]

Exercise

Suppose \( \displaystyle G\left([value]\right) = [value]\).

1. Evaluate: \( G\left([value]\right)=\) .
2. Find a value of \( [value] \) such that \(G\left([value]\right) \) does not exist. \([value]=\) .
Feedback: 1. We must substitute [value] in place of [value] in the definition of the function: \[\begin{array}{rcl} G\left([value]\right) = \displaystyle \frac{[value]\cdot([value])+([value])}{[value]\cdot([value])+([value])} = \displaystyle \frac{[value]}{[value]} = \displaystyle [value] \end{array}\] 2. We need to find the value of [value] for which the denominator is \(0\). So, \[ [value]=0 \\ [value] = [value] \]

Exercise

Given \(f\left(z\right) = [value]\), Evaluate and fully expand:

1. \(f\left([value]\right)=\) .
2. \(f\left([value]\right)=\) .
3. \(f\left([value]\right)=\) .
4. \(\displaystyle{f\left([value]\right)=}\) .
Feedback: We need to replace \(z\) by the arguments given. Hence, 1. \(f\left([value]\right)= 2\left([value]\right)^2+4=[value]\) 2. \(f\left([value]\right)= 2\left([value]\right)^2+4=[value] \) 3. \(f\left([value]\right)= 2\left([value]\right)^2+4=[value]\) 4. \(f\left([value]\right)=2\left([value]\right)^2+4=[value]\)

Composition of Functions

Consider the two functions \(g(x)=x^2\), and \(h(x)=3x+5\). The Block diagrams below show the rules for these functions.

[Image: composite functions]
Block diagrams of two functions \(g\) and \(h\)

Suppose we place these Block diagrams together in series as shown below, so that the output from function \(g\) is used as the input to function \(h\).

[Image: composite functions 2]
The composition of the two functions to give \(h(g(x))\)

Study the figure above carefully and deduce that when the input to \(g\) is \(x\) the output from the two functions in series is \(3x^2+5\). Since the output from \(g\) is used as input to \(h\) we write

\(h(g(x)) = h(x^2) = 3x^2+5\).

The form \(h(g(x))\) is known as the composition of the functions \(g\) and \(h\).

Suppose we interchange the two functions so that \(h\) is applied first as shown below.

[Image: composite functions 3]
The composition of the two functions to give \(g(h(x))\)

Study the figure above and note that when the input to \(h\) is \(x\) the final output is \((3x+5)^2\). We write

\(g(h(x)) = (3x+5)^2\)

Note that the function \(h(g(x))\) is different from \(g(h(x))\).

Example

Given two functions \(g(t)=3t+2\) and \(h(t)=t+3\) obtain an expression for the composition \(g(h(t))\).

Solution

We have \(g(h(t))= g(t+3)\). Now the rule for \(g\) is ‘triple the input and add \(2\)’, and so we can write \(g(t+3) = 3(t+3) +2= 3t+11\) so, \(g(h(t))= 3t+11\).

Exercise

Given \(f\left(x\right) = [value]\) and \(g\left(x\right) = [value]\) find the composite functions:

1. \(g\left(f\left(x\right)\right)=\) .
2. \(f\left(g\left(x\right)\right)=\) .
Feedback: We are given the functions \(f\left(x\right) = [value]\) and \(g\left(x\right) = [value].\) Both of them have domain the whole \( \mathbb{R}.\) 1. Substituting \(f\left(x\right)=[value]\) for \(x\) in the expression \(g\left(x\right) = [value]\) we obtain the composite function: \[g\left(f\left(x\right)\right)=[value]=[value].\] 2. Similarly, substituting \(g\left(x\right) = [value]\) for \(x\) in the expression \(f\left(x\right)=[value]\) we obtain: \[f\left(g\left(x\right)\right)=[value].\]

Exercise

Given \(f\left(x\right) = [value]\) and \(g\left(x\right) = [value]\) find the composite functions:

1. When simplified \(g\left(f\left(x\right)\right)=\)
What is the domain of \(g\left(f\left(x\right)\right)\)?
2. When simplified \(f\left(g\left(x\right)\right)=\)
What is the domain of \(f\left(g\left(x\right)\right)\)?
Feedback: We are given the functions \(f\left(x\right) = [value]\) and \(g\left(x\right) = [value].\) The function \(f\) has domain \( D_f = \mathbb{R}\) and the function \(g\) has domain \( D_g = [ [value], +\infty) \) 1. Substituting \(f\left(x\right)=[value]\) for \(x\) in the expression \(g\left(x\right) = [value]\) we obtain the composite function: \[g\left(f\left(x\right)\right)=\sqrt{[value]-[value]}=[value].\] For the domain of \(g\left(f\left(x\right)\right) \) we have: \[ x \in D_f \text{ and } f(x) \in D_g \Leftrightarrow x \in \mathbb{R} \text{ and } [value] \geq [value]\] \[ \Leftrightarrow x^2 \geq [value] \Leftrightarrow x \geq \sqrt{[value]} \text{ or } x \leq -\sqrt{[value]} \] 2. Similarly, substituting \(g\left(x\right) = [value]\) for \(x\) in the expression \(f\left(x\right)=[value]\) we obtain: \[f\left(g\left(x\right)\right)=[value]^2+[value].\] For the domain of \( f\left(g\left(x\right)\right)\) we have: \[ x \in D_g \text{ and } g(x) \in D_f \Leftrightarrow x \geq [value] \text{ and } [value] \in \mathbb{R} \] \[ \Leftrightarrow x \geq [value] \]

Exercise

If \(f\left(x\right) = [value]\), find \(f\left(f\left(x\right)\right)\).
Feedback: We substitute \(f\left( x \right)= [value]\) back into it self, so \[f \left( f(x) \right) = f \left ([value] \right)= [value]=[value].\]

Exercise

If \(f\left(x\right) = [value]\) and \(g\left(x\right) = [value]\), Find:

1. \(g\left(f\left([value]\right)\right)=\) .
2. \(f\left(g\left([value]\right)\right)=\) .
3. \(f\left(g\left([value]\right)\right)=\) .
4. \(g\left(f\left([value]\right)\right)=\) .
Feedback: We are given the functions \(f\left(x\right) = [value]\) and \(g\left(x\right) = [value].\) Both of them have domain the whole \( \mathbb{R}.\) Substituting \(f\left(x\right)=[value]\) for \(x\) in the expression \(g\left(x\right) = [value]\) we obtain the composite function: \[g\left(f\left(x\right)\right)=[value]=[value].\] Similarly, substituting \(g\left(x\right) = [value]\) for \(x\) in the expression \(f\left(x\right)=[value]\) we obtain: \[f\left(g\left(x\right)\right)=[value].\] So, 1. \(g\left(f\left([value]\right)\right)= [value]\) 2. \(f\left(g\left([value]\right)\right)= [value]\) 3. \(f\left(g\left([value]\right)\right)= [value]\) 4. \(g\left(f\left([value]\right)\right)= [value]\)

Exercise

Given \(\displaystyle{f\left(x\right) = [value]}\) and \(\displaystyle{g\left(x\right) = [value]}\) find the composite function:

\(g\left(f\left(x\right)\right)=\)
Feedback: We are given the functions \(f\left(x\right) = \displaystyle [value]\) and \(g\left(x\right) = \displaystyle [value].\) The maximum domain of \(f(x)\) is \(D_f: x \neq -[value].\) The maximum domain of \(g(x)\) is \(D_g: x \neq 0.\) The maximum domain of \( g(f(x))\) is determined by: \[ x \in D_f \quad \text{and} \quad f(x) \in D_g \] or, \[\left\{\begin{array}{l} x \neq - [value]\\ f(x) \neq 0 \end{array} \Leftrightarrow \begin{array}{l} x \neq - [value]\\ [value] \neq 0 \end{array} \Leftrightarrow \begin{array}{l} x \neq - [value]\\ x \neq [value] \end{array} \right.\] Substituting \(f\left(x\right)= \displaystyle [value]\) for \(x\) in the expression \(g\left(x\right) =\displaystyle [value]\) we obtain the composite function: \[g\left(f\left(x\right)\right)=\dfrac[value][value]=[value].\]

Domain, range and codomain

Many of the examples of functions we have met so far can be evaluated for any real number. However the function \(\displaystyle{ f(x)=\frac{1}{x}}\) cannot be evaluated at \(0\), and we say that \(f(x)\) is not defined at \(0\). In other cases the argument of a function might represent time so we only take non-negative input values.

We will often want to specify which values we allow as input values and which values the function will give as output values. By domain we mean the possible input values for a function. If we only have the expression for a function, such as \(\displaystyle{ f(x)=\frac{1}{x}}\), then we take as domain the collection of real numbers at which the function is defined; this can sometimes be called the maximum domain of definition.

The collection of all possible output values of a function is called the range of the function. Note that the possible output values will depend on the input values. In other words the range will depend on the domain. For example if \(f(t)=2t+1\) has domain \((0,\infty)\), all positive real numbers, then the range will be any real number greater than \(1\). We write this as

\[f: (0,\infty) \rightarrow (1,\infty)\]

with the domain on the left, and the range on the right.

In general the range of function with a given domain may be difficult to calculate. For a function \(f(x)\) with a given domain we define a codomain to be any collection of values which contains the range of \(f(x)\). A function can have many different codomains, but it will only have one range for each domain.

The concept of the range of a function will be important when we try to reverse the direction and go from the output to the input. This is called the inverse of \(f(x)\) and we will return to this in another section.