\( \definecolor{colordef}{RGB}{249,49,84} \definecolor{colorprop}{RGB}{18,102,241} \)

Functions

Definitions


A function is like a machine that follows a specific rule. For every number you put in, you get exactly one number out.
Let's imagine a machine whose rule is "multiply by 2".
If we put in a 3, we get out a 6. If we put in a 5, we get out a 10. A table of values helps us organize these pairs:
Input 3 5 8 10
Output 6 10 16 20
To work with these rules more efficiently, mathematicians developed a special notation.
To represent this machine, we write \(\textcolor{olive}{f}(\textcolor{colordef}{\text{input}}) = \textcolor{colorprop}{\text{output}}\). The parentheses \((\) \()\) indicate the action of the function \(\textcolor{olive}{f}\) on the input.
We use function notation to name functions and their variables, replacing "\(\textcolor{colordef}{\text{input}}\)" by "\(\textcolor{colordef}{x}\)" and "\(\textcolor{colorprop}{\text{output}}\)" by "\(\textcolor{colorprop}{f(x)}\)".
We can represent a function in the following way:
For example, if the rule is "twice the input":
we have \(\textcolor{olive}{f}(\textcolor{colordef}{x}) = \textcolor{colorprop}{2x}\).
When the input is \(\textcolor{colordef}{x} = \textcolor{colordef}{1}\), we get:$$\begin{aligned}\textcolor{olive}{f}(\textcolor{colordef}{1}) &= 2 \times \textcolor{colordef}{(1)}\\ &= \textcolor{colorprop}{2}\end{aligned}$$

Definition Function
A function, \(f\), is a rule that assigns to each input value from a set called the domain, exactly one output value in a set called the range.
  • \(f\) is the name of the function (the rule).
  • \(x\) is the input variable.
  • \(f(x)\) is the output value when the input is \(x\). It is read as "\(f\) of \(x\)".
  • \(f(x)\) is called the image of \(x\) under \(f\).
Example
The function \(f\) is defined by the rule \(f(x)=2x-1\). Find the value of \(f(5)\).

To find \(f(5)\), we substitute the input value \(x=5\) into the function's rule:$$\begin{aligned}[t]f(x) &= 2x - 1 \\ f(5) &= 2(5) - 1 \\ &= 10 - 1 \\ &= \boldsymbol{9}\end{aligned}$$

Tables of Values

Definition Table of Values
A table of values is a table that organizes the relationship between the input values (\(x\)) and their corresponding output values (\(f(x)\)) for a function.
Example
Complete the table of values for the function \(f(x)=x^2\).
\(x\) \(-2\) \(-1\) \(0\) \(1\) \(2\)
\(f(x)\)

We substitute each value of \(x\) into the function \(f(x)=x^2\):
  • \(\begin{aligned}[t] f(-2) &= (-2)^2 \\ &= 4 \end{aligned}\)
  • \(\begin{aligned}[t] f(-1) &= (-1)^2\\ &= 1 \end{aligned}\)
  • \(\begin{aligned}[t] f(0) &= (0)^2 \\ &= 0 \end{aligned}\)
  • \(\begin{aligned}[t] f(1) &= (1)^2 \\ &= 1 \end{aligned}\)
  • \(\begin{aligned}[t] f(2) &= (2)^2 \\ &= 4 \end{aligned}\)
The completed table is:
\(x\) \(-2\) \(-1\) \(0\) \(1\) \(2\)
\(f(x)\) \(4\) \(1\) \(0\) \(1\) \(4\)

Graphs of Functions

While a table of values is useful for listing some input–output pairs of a function, a graph is a powerful tool for visualizing how the output changes when the input changes. A graph gives us a picture of the function's behavior.
Definition Graph of a Function
The graph of a function \(f\) is the set of all points with coordinates \((\textcolor{colordef}{x}, \textcolor{colorprop}{f(x)})\) in a coordinate plane. The input value, \(x\), is plotted on the horizontal axis (the x-axis), and the output value, \(f(x)\), is plotted on the vertical axis (the y-axis). When the function is defined for all \(x\) in an interval, we can connect these points to form the curve of the function.
Method Plotting a Graph from a Table
To plot the graph of a function from its table of values:
  1. Draw a coordinate plane with a suitable scale on each axis and label the axes.
  2. For each pair \((x, f(x))\) in the table, plot the corresponding point on the coordinate plane.
  3. If the function is defined for all \(x\) in the interval shown, connect the points with a straight line or a smooth curve.
Example
Plot the graph of the function \(f(x) = x - 1\) using its table of values.
\(x\) \(-2\) \(-1\) \(0\) \(1\) \(2\) \(3\)
\(f(x)\) \(-3\) \(-2\) \(-1\) \(0\) \(1\) \(2\)

We plot the points \((-2, -3)\), \((-1, -2)\), \((0, -1)\), \((1, 0)\), \((2, 1)\), and \((3, 2)\) from the table. These points lie on the same straight line, so we connect them to draw the graph of \(f(x)=x-1\).

Finding Outputs from Inputs on a Graph

Method Finding the Value of \(f(x)\) from a Graph
To find the output \(f(x)\) for a given input \(x\) using a graph:
  1. Locate the input value on the horizontal x-axis.
  2. Move vertically from that point until you reach the curve of the function.
  3. Move horizontally from the intersection point to the vertical y-axis and read the corresponding value. This y-value is the output \(f(x)\).
Example
Using the graph of the function \(f\) below, find the value of \(f(2)\).

We follow the graphical method:
  1. Start at \(x=2\) on the horizontal axis.
  2. Move up to meet the curve.
  3. Move horizontally to the vertical axis and read the value, which is \(3\).
Therefore, \(\boldsymbol{f(2) = 3}\).

Finding Inputs from Outputs

We have learned how to take an input (\(x\)) and find its output (\(f(x)\)). Now, we will learn how to work backwards: if we know the output, can we find the input(s) that produced it? This process is called finding the preimage(s) (or input(s)) of a given value.
Method Finding Inputs from Outputs on a Graph
To find the preimage(s) of a value \(y\) (i.e., find all \(x\) such that \(f(x)=y\)):
  1. Locate the output value \(y\) on the vertical y-axis.
  2. Draw a horizontal line from this value across the graph.
  3. Find the intersection point(s) where the horizontal line crosses the function's curve.
  4. Move vertically to the x-axis from each intersection point to read the corresponding input value(s). These are the preimages.
Example
Using the graph of the function \(f\) below, find \(x\) such that \(f(x)= 3\).

We apply the graphical method:
  1. We locate \(y=3\) on the vertical axis.
  2. We draw a horizontal line at \(y=3\).
  3. The line intersects the curve at two points.
  4. We move vertically from these points to the x-axis to read the values, which are \(-2\) and \(2\).
The preimages of \(3\) are \(\boldsymbol{-2}\) and \(\boldsymbol{2}\).

Finding a preimage graphically is useful for visualization, but for an exact answer, we can use algebra.
Method Finding Inputs from Outputs Algebraically
To find the preimage(s) of a value \(y\) for a function \(f(x)\):
  • Set the function's formula equal to the output value: \(\boldsymbol{f(x) = y}\).
  • Solve the resulting equation for \(x\).
Example
Let \(f(x) = 3x + 12\). Find \(x\) such that \(f(x)=0\).

We need to find the value of \(x\) such that \(f(x)=0\). We set up the equation and solve:$$\begin{aligned} f(x) &= 0 \\ 3x + 12 &= 0 \\ 3x &= -12 && \color{gray}\text{(subtract 12 from both sides)} \\ x &= \frac{-12}{3} &&\color{gray}\text{(divide both sides by 3)} \\ x &= -4\end{aligned}$$The preimage of \(0\) is \(\boldsymbol{x = -4}\).
Check: \(f(-4) = 3(-4) + 12 = -12 + 12 = 0\). The answer is correct.

Domain and Range

Definition Domain and Range
  • The domain of a function is the set of all input values \(x\) for which the expression \(f(x)\) is defined (i.e., for which the rule of the function gives a real output).
  • The range of a function is the set of all output values \(f(x)\) actually obtained when \(x\) runs through the domain.
Unless otherwise stated, we work with real-valued functions, so the domain and the range are subsets of the real numbers.
Method Finding the Domain
To find the domain of a function (over the real numbers), we identify any values of \(x\) for which the expression \(f(x)\) would not make sense and exclude them. At this level, we look for two main restrictions:
  1. Division by zero: The denominator of a fraction cannot be zero.
  2. Square roots of negative numbers: For a real square root, the expression inside the root (the radicand) must be greater than or equal to zero.
In word problems, the context (for example, a time or a length that cannot be negative) may impose additional restrictions on the domain.
Example
Find the domain of the function \(f(x)=\dfrac{1}{x-2}\).

The function is undefined when the denominator is zero. We set the denominator equal to zero and solve for \(x\):$$x-2 = 0 \implies x=2.$$So \(x=2\) is not allowed.
The function is defined for all real numbers except \(x=2\), that is, for all \(x\) in the set \(\{x \mid x \neq 2\}\).

Algebra of Functions


Let \(\textcolor{colordef}{f(x)=2x+1}\) and \(\textcolor{colorprop}{g(x)=x^2}\).
\(\textcolor{olive}{(f+g)(x)}\) means that, for any input \(x\) that belongs to the domains of both functions, you calculate \(\textcolor{colordef}{f(x)}\) and \(\textcolor{colorprop}{g(x)}\) separately, then add the results. In other words, \((f+g)\) is a new function defined by \((f+g)(x)=f(x)+g(x)\).
This is illustrated by the function machine below:
So,$$\begin{aligned}[t]\textcolor{olive}{(f+g)(x)} &= \textcolor{colordef}{f(x)} + \textcolor{colorprop}{g(x)} \\ &= \textcolor{colordef}{2x+1} + \textcolor{colorprop}{x^2}.\end{aligned}$$

Definition Operations on Functions
Given two functions \(f\) and \(g\), we can define new functions by performing arithmetic operations on their outputs, for each \(x\) where both are defined:
  • Sum: \((f+g)(x) = f(x) + g(x)\)
  • Difference: \((f-g)(x) = f(x) - g(x)\)
  • Product: \((fg)(x) = f(x) \times g(x)\)
  • Quotient: \(\displaystyle\left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)}\), provided that \(g(x) \neq 0\).
For the sum, difference and product, the domain of the new function is the intersection of the domains of \(f\) and \(g\) (all \(x\) for which both \(f(x)\) and \(g(x)\) are defined).
For the quotient, the domain is the intersection of the domains of \(f\) and \(g\), excluding any \(x\) such that \(g(x)=0\).
Example
Let \(f(x)=2x+1\) and \(g(x)=x^4-1\). Find \((f+g)(x)\).

\(\begin{aligned}(f+g)(x) &= f(x) + g(x) \\ &= (2x+1) + (x^4-1) \\ &= x^4 + 2x.\end{aligned}\)
Since both \(f\) and \(g\) are polynomials, \((f+g)(x)\) is defined for all real numbers \(x\).

Composition of Functions


Let \(\textcolor{colordef}{f(x)=x^2}\) and \(\textcolor{colorprop}{g(x)=2x+1}\).
The composition \(\textcolor{olive}{(f \circ g)(x)}\) means that you first apply \(g\) to \(x\), and then apply \(f\) to the result. In other words, \(x\) goes through machine \(g\) (becoming \(2x+1\)), and that output then goes through machine \(f\).
Algebraically, we write this as:$$\begin{aligned}[t](f \circ g)(x) &= \textcolor{colordef}{f}(\textcolor{colorprop}{g(x)}) \\ &= \textcolor{colordef}{f}(2x+1) \\ &= (2x+1)^2.\end{aligned}$$

Definition Composition of Functions
Given two functions \(f\) and \(g\), the composite function, denoted \(\boldsymbol{f \circ g}\) (read "\(f\) composed with \(g\)"), is defined by:$$\boldsymbol{(f \circ g)(x) = f(g(x))}$$for every \(x\) that belongs to the domain of \(g\) and for which \(g(x)\) belongs to the domain of \(f\).
We first apply the function \(g\) to \(x\), and then apply the function \(f\) to the result \(g(x)\).
Example
Let \(f(x)=x^2\) and \(g(x)=2x+1\).
  1. Find \((f \circ g)(x)\).
  2. Find \((g \circ f)(x)\).
  3. Is composition commutative? (i.e., is \((f \circ g)(x) = (g \circ f)(x)\)?)

  1. \(\begin{aligned}[t] (f \circ g)(x) &= f(g(x)) \\ &= f(2x+1) \\ &= (2x+1)^2 \\ &= 4x^2 + 4x + 1. \end{aligned}\)
  2. \(\begin{aligned}[t] (g \circ f)(x) &= g(f(x)) \\ &= g(x^2) \\ &= 2(x^2) + 1 \\ &= 2x^2 + 1. \end{aligned}\)
  3. No. Since \(4x^2 + 4x + 1 \neq 2x^2 + 1\), the two composite functions are different, so function composition is not commutative in general.

Inverse Functions

In arithmetic, we are familiar with inverse operations. For example, subtraction is the inverse of addition because it "undoes" the addition. If you start with 5, add 3 to get 8, and then subtract 3, you return to 5:$$(5+3) - 3 = 5.$$Similarly, division is the inverse of multiplication:$$(5\times 3) \div 3 = 5.$$The concept of an inverse function follows the same idea. An inverse function, denoted \(\boldsymbol{f^{-1}}\), is a function that "undoes" or reverses the action of another function, \(f\).
If a function \(f\) takes an input \(x\) to an output \(y\), the inverse function \(f^{-1}\) takes that output \(y\) back to the original input \(x\). This creates a perfect loop:
However, not every function has an inverse function. For an inverse to exist, each output \(y\) must come from exactly one input \(x\) (the function must never take the same value twice on its domain).
Definition Inverse Function
Let \(f\) be a function with domain \(D\) and range \(R\). A function \(f^{-1}\) with domain \(R\) and range \(D\) is the inverse function of \(f\) if it "undoes" the action of \(f\). This means that if \(f\) maps an input \(x\) to an output \(y\), then \(f^{-1}\) maps \(y\) back to \(x\):$$ \text{If } f(x) = y, \text{ then } f^{-1}(y) = x. $$This relationship must hold for every \(x\) in the domain \(D\) (and every \(y\) in the range \(R\)). In terms of composition, this means:$$f^{-1}(f(x)) = x \quad \text{for all } x \in D,$$and$$f(f^{-1}(x)) = x \quad \text{for all } x \in R.$$In particular, for an inverse function to exist, each output \(y\) in the range of \(f\) must correspond to exactly one input \(x\).
Method Finding the Inverse Function
To find the inverse of a function \(f\) (when it exists):
  1. Set \(y = f(x)\).
  2. Solve the equation for \(x\) in terms of \(y\). This gives an expression of the form \(x = f^{-1}(y)\).
  3. Swap the variables \(x\) and \(y\) to write the inverse in terms of \(x\). The result is \(y = f^{-1}(x)\).
This procedure defines an inverse function only if each output corresponds to exactly one input (i.e., if \(f\) is invertible on its domain).
Example
Find the inverse of \(f(x) = 4x - 8\).

Set \(y = 4x - 8\) and solve for \(x\):$$\begin{aligned}y &= 4x - 8 \\ y + 8 &= 4x \\ x &= \dfrac{y + 8}{4}.\end{aligned}$$Now, swap the variables \(x\) and \(y\):$$y = \dfrac{x + 8}{4}.$$So, the inverse function is \(\boldsymbol{f^{-1}(x) = \dfrac{x + 8}{4}}\).
Check:$$\begin{aligned}f\bigl(f^{-1}(x)\bigr) &= 4\left(\dfrac{x+8}{4}\right) - 8 = x+8-8 = x,\\ f^{-1}(f(x)) &= \dfrac{(4x-8)+8}{4} = \dfrac{4x}{4} = x,\end{aligned}$$so \(f^{-1}\) really is the inverse of \(f\).

Proposition Symmetry of Inverse Functions
The graphs of a function \(f\) and its inverse \(f^{-1}\) are reflections of each other across the line \(\boldsymbol{y = x}\). Equivalently, if a point \((a,b)\) lies on the graph of \(y=f(x)\), then the point \((b,a)\) lies on the graph of \(y=f^{-1}(x)\).