Functions Revisited
Deepen your understanding of what functions really are
If you have made it this far in your mathematical journey, you have encountered functions many times before. You have likely evaluated them, graphed them, and maybe even solved equations involving them. But here is the thing: functions are so fundamental to everything that comes next in mathematics that it pays to take a step back and really understand what they are and how they work. Think of this chapter as a tune-up before a long road trip. You probably already know how to drive, but checking the engine, filling the tires, and reviewing the route makes the whole journey smoother.
In everyday life, functions are everywhere. When you check how much your phone will charge in 30 minutes, you are thinking about a function. When you calculate the tip at a restaurant based on the bill, that is a function. When you look at a weather app and see how the temperature will change throughout the day, you are looking at a function’s output over time. Functions simply describe how one quantity depends on another. That is all they do. And that is incredibly powerful.
Core Concepts
What Is a Function, Really?
At its heart, a function is a rule that takes an input and produces exactly one output. This “exactly one output” part is crucial. If you put the same number into a function twice, you must get the same result both times. A function cannot be indecisive; it always knows what to do with whatever you give it.
Think of a function like a very reliable vending machine. You put in your selection (the input), the machine does its thing (applies the rule), and out comes your snack (the output). If you press B7, you always get the same item. The machine does not randomly give you chips one time and candy the next. That predictability is what makes it a function.
Mathematically, we write this relationship as:
$$\text{input} \rightarrow \text{rule} \rightarrow \text{output}$$
Or more formally:
$$x \rightarrow f \rightarrow f(x)$$
The input $x$ goes into the function $f$, and the output $f(x)$ comes out.
Function Notation
When we write $f(x)$, we are not multiplying $f$ by $x$. The parentheses here serve a different purpose: they indicate that $f$ is a function and $x$ is the input to that function. We read $f(x)$ as “f of x” or “the value of f at x.”
There is nothing special about the letters $f$ and $x$. You might see:
- $g(t)$ for a function $g$ with input $t$ (often used when the input is time)
- $h(n)$ for a function $h$ with input $n$ (often used when the input is a counting number)
- $P(x)$ for a polynomial function
- $A(r)$ for an area function in terms of radius
The letter choice often hints at what the function represents or what kind of input it expects, but mathematically, they all work the same way.
Domain and Range
Every function has two important sets associated with it:
The domain is the set of all possible inputs. These are all the values you are allowed to put into the function. Think of it as the function’s menu: what can you order?
The range is the set of all possible outputs. These are all the values the function can actually produce. Think of it as what the function can actually deliver.
Finding the domain usually means asking: “What values would cause problems?” Common restrictions include:
- Division by zero (you cannot divide by zero)
- Square roots of negative numbers (at least, not in the real numbers)
- Logarithms of non-positive numbers
If nothing causes a problem, the domain is all real numbers.
Finding the range is often trickier. You might need to think about the function’s behavior, look at its graph, or consider what outputs are actually achievable.
Find the domain of $f(x) = \frac{3x + 1}{x - 2}$.
Step 1: Identify potential problems. We have a fraction, so we need to worry about division by zero.
Step 2: Find when the denominator equals zero: $$x - 2 = 0$$ $$x = 2$$
Step 3: Exclude this value from the domain.
Answer: The domain is all real numbers except 2. In interval notation: $(-\infty, 2) \cup (2, \infty)$.
Find the domain of $g(x) = \frac{\sqrt{x + 3}}{x - 1}$.
Step 1: Identify potential problems. We have both a square root (cannot have negative under it) and a fraction (cannot divide by zero).
Step 2: For the square root, we need: $$x + 3 \geq 0$$ $$x \geq -3$$
Step 3: For the fraction, we need: $$x - 1 \neq 0$$ $$x \neq 1$$
Step 4: Combine both restrictions.
Answer: The domain is $x \geq -3$ but $x \neq 1$. In interval notation: $[-3, 1) \cup (1, \infty)$.
Evaluating Functions
Evaluating a function means substituting a specific value (or expression) for the input variable and calculating the result. This is something you have done countless times, but it becomes more nuanced when we work with expressions as inputs or piecewise functions.
If $f(x) = 3x^2 - 2x + 5$, find $f(4)$.
Step 1: Replace every $x$ with 4: $$f(4) = 3(4)^2 - 2(4) + 5$$
Step 2: Calculate: $$= 3(16) - 8 + 5$$ $$= 48 - 8 + 5$$ $$= 45$$
Answer: $f(4) = 45$
Piecewise Functions
A piecewise function is defined by different rules for different parts of its domain. Think of it like a pricing structure: the first 100 units cost $10 each, units 101-500 cost $8 each, and units above 500 cost $6 each. The price per unit depends on which “piece” of the quantity you are in.
$$f(x) = \begin{cases} \text{rule 1} & \text{if condition 1} \ \text{rule 2} & \text{if condition 2} \ \text{rule 3} & \text{if condition 3} \end{cases}$$
Let $f(x) = \begin{cases} x^2 & \text{if } x < 0 \ 2x + 1 & \text{if } 0 \leq x < 3 \ 10 & \text{if } x \geq 3 \end{cases}$
Evaluate $f(-2)$, $f(1)$, and $f(5)$.
For $f(-2)$: Since $-2 < 0$, use the first rule: $$f(-2) = (-2)^2 = 4$$
For $f(1)$: Since $0 \leq 1 < 3$, use the second rule: $$f(1) = 2(1) + 1 = 3$$
For $f(5)$: Since $5 \geq 3$, use the third rule: $$f(5) = 10$$
Answers: $f(-2) = 4$, $f(1) = 3$, $f(5) = 10$
The Difference Quotient
The difference quotient is one of the most important expressions in all of calculus, but we can understand it right now without any calculus knowledge. It measures the average rate of change of a function between two points.
$$\frac{f(x + h) - f(x)}{h}$$
Here is what this expression is asking: If you start at $x$ and move a distance $h$ to the right, how much does the function’s output change, on average, per unit of horizontal movement?
Geometrically, this is the slope of the line connecting the points $(x, f(x))$ and $(x + h, f(x + h))$ on the graph. This line is called a secant line.
Find and simplify the difference quotient for $f(x) = x^2 + 3x$.
Step 1: Find $f(x + h)$ by replacing every $x$ with $(x + h)$: $$f(x + h) = (x + h)^2 + 3(x + h)$$ $$= x^2 + 2xh + h^2 + 3x + 3h$$
Step 2: Compute $f(x + h) - f(x)$: $$f(x + h) - f(x) = (x^2 + 2xh + h^2 + 3x + 3h) - (x^2 + 3x)$$ $$= x^2 + 2xh + h^2 + 3x + 3h - x^2 - 3x$$ $$= 2xh + h^2 + 3h$$
Step 3: Divide by $h$: $$\frac{f(x + h) - f(x)}{h} = \frac{2xh + h^2 + 3h}{h}$$ $$= \frac{h(2x + h + 3)}{h}$$ $$= 2x + h + 3$$
Answer: The difference quotient simplifies to $2x + h + 3$.
(Notice that as $h$ gets smaller and smaller, approaching zero, this approaches $2x + 3$. That value, $2x + 3$, is the instantaneous rate of change at $x$, which you will study in calculus as the derivative.)
Function Composition
Function composition is when you use the output of one function as the input to another function. It is like an assembly line: the first machine produces something, and that product immediately goes into the second machine.
We write the composition of $f$ and $g$ as $(f \circ g)(x)$, which means $f(g(x))$. Read this as “f of g of x” or “f composed with g of x.”
Important: $(f \circ g)(x)$ and $(g \circ f)(x)$ are usually NOT the same. The order matters.
Here is how to evaluate a composition: start with the innermost function and work your way out.
Let $f(x) = 2x + 1$ and $g(x) = x^2 - 3$. Find $(f \circ g)(4)$ and $(g \circ f)(4)$.
For $(f \circ g)(4) = f(g(4))$:
Step 1: Evaluate $g(4)$ first: $$g(4) = (4)^2 - 3 = 16 - 3 = 13$$
Step 2: Now evaluate $f(13)$: $$f(13) = 2(13) + 1 = 26 + 1 = 27$$
So $(f \circ g)(4) = 27$.
For $(g \circ f)(4) = g(f(4))$:
Step 1: Evaluate $f(4)$ first: $$f(4) = 2(4) + 1 = 8 + 1 = 9$$
Step 2: Now evaluate $g(9)$: $$g(9) = (9)^2 - 3 = 81 - 3 = 78$$
So $(g \circ f)(4) = 78$.
Notice: $27 \neq 78$. The order of composition matters!
Inverse Functions
An inverse function undoes what the original function does. If $f$ takes an input $a$ and produces output $b$, then $f^{-1}$ (the inverse of $f$) takes $b$ and produces $a$. They reverse each other’s work.
We write the inverse of $f$ as $f^{-1}$. Important: This is NOT $\frac{1}{f}$. The $-1$ here is not an exponent; it is notation indicating “inverse.”
The key relationship: $$f(f^{-1}(x)) = x \quad \text{and} \quad f^{-1}(f(x)) = x$$
If you apply a function and then its inverse (or vice versa), you get back to where you started.
Not every function has an inverse. For a function to have an inverse, it must be one-to-one, meaning each output comes from exactly one input. If two different inputs produce the same output, there is no way to reverse the process (which input should the inverse return?).
The Horizontal Line Test
The horizontal line test determines whether a function has an inverse. If any horizontal line crosses the graph more than once, the function is NOT one-to-one and does NOT have an inverse (at least, not without restricting its domain).
Why does this work? A horizontal line represents a single output value. If it crosses the graph twice, that means two different inputs produce the same output, so there is no unique way to reverse the function.
Finding Inverse Functions
To find the inverse of a function algebraically:
- Replace $f(x)$ with $y$.
- Swap $x$ and $y$ (switch their roles).
- Solve for $y$.
- Replace $y$ with $f^{-1}(x)$.
Find the inverse of $f(x) = \frac{2x + 3}{5}$.
Step 1: Replace $f(x)$ with $y$: $$y = \frac{2x + 3}{5}$$
Step 2: Swap $x$ and $y$: $$x = \frac{2y + 3}{5}$$
Step 3: Solve for $y$: $$5x = 2y + 3$$ $$5x - 3 = 2y$$ $$y = \frac{5x - 3}{2}$$
Step 4: Write the inverse: $$f^{-1}(x) = \frac{5x - 3}{2}$$
Answer: $f^{-1}(x) = \frac{5x - 3}{2}$
Verifying Inverses
To verify that two functions are inverses of each other, check that both of these equations are true:
$$f(f^{-1}(x)) = x \quad \text{and} \quad f^{-1}(f(x)) = x$$
Verify that $f(x) = \frac{2x + 3}{5}$ and $f^{-1}(x) = \frac{5x - 3}{2}$ are indeed inverses.
Check 1: $f(f^{-1}(x)) = x$
$$f(f^{-1}(x)) = f\left(\frac{5x - 3}{2}\right)$$ $$= \frac{2 \cdot \frac{5x - 3}{2} + 3}{5}$$ $$= \frac{(5x - 3) + 3}{5}$$ $$= \frac{5x}{5}$$ $$= x \quad \checkmark$$
Check 2: $f^{-1}(f(x)) = x$
$$f^{-1}(f(x)) = f^{-1}\left(\frac{2x + 3}{5}\right)$$ $$= \frac{5 \cdot \frac{2x + 3}{5} - 3}{2}$$ $$= \frac{(2x + 3) - 3}{2}$$ $$= \frac{2x}{2}$$ $$= x \quad \checkmark$$
Conclusion: Both conditions are satisfied, so $f$ and $f^{-1}$ are indeed inverses of each other.
Notation and Terminology
| Symbol/Term | How to Read It | What It Means |
|---|---|---|
| $f(x)$ | “f of x” | The output of function $f$ when the input is $x$ |
| Domain | “domain” | The set of all allowed inputs |
| Range | “range” | The set of all possible outputs |
| $\frac{f(x+h) - f(x)}{h}$ | “the difference quotient” | The average rate of change of $f$ over an interval of width $h$ |
| $(f \circ g)(x)$ | “f composed with g of x” | $f(g(x))$; apply $g$ first, then $f$ |
| $f^{-1}(x)$ | “f inverse of x” | The inverse function of $f$; NOT $\frac{1}{f(x)}$ |
| One-to-one | “one-to-one” | Each output comes from exactly one input |
Key Properties and Rules
Function Properties
- Definition: A function assigns exactly one output to each input.
- Vertical Line Test: A graph represents a function if and only if no vertical line crosses it more than once.
- Horizontal Line Test: A function has an inverse if and only if no horizontal line crosses its graph more than once.
Domain Rules
When finding the domain, exclude values that cause:
- Division by zero: If $f(x) = \frac{g(x)}{h(x)}$, exclude values where $h(x) = 0$.
- Even roots of negatives: If $f(x) = \sqrt[n]{g(x)}$ where $n$ is even, require $g(x) \geq 0$.
- Logarithms of non-positives: If $f(x) = \log(g(x))$, require $g(x) > 0$.
Composition Rules
- $(f \circ g)(x) = f(g(x))$: Evaluate $g$ first, then $f$.
- $(f \circ g)(x) \neq (g \circ f)(x)$ in general. Composition is not commutative.
- The domain of $(f \circ g)$ consists of all $x$ in the domain of $g$ such that $g(x)$ is in the domain of $f$.
Inverse Function Rules
- $f(f^{-1}(x)) = x$ for all $x$ in the domain of $f^{-1}$.
- $f^{-1}(f(x)) = x$ for all $x$ in the domain of $f$.
- The domain of $f^{-1}$ equals the range of $f$.
- The range of $f^{-1}$ equals the domain of $f$.
- The graph of $f^{-1}$ is the reflection of the graph of $f$ across the line $y = x$.
Real-World Applications
Temperature Conversion
The relationship between Fahrenheit and Celsius temperatures is a perfect example of functions and their inverses.
To convert Celsius to Fahrenheit: $F(C) = \frac{9}{5}C + 32$
To convert Fahrenheit to Celsius: $C(F) = \frac{5}{9}(F - 32)$
These are inverse functions. If you convert a temperature from Celsius to Fahrenheit and then back to Celsius, you get your original temperature.
Physics and Motion
When an object is thrown upward, its height as a function of time is:
$$h(t) = -16t^2 + v_0 t + h_0$$
where $v_0$ is the initial velocity (in feet per second) and $h_0$ is the initial height (in feet). The domain is restricted to times when the object is actually in the air. This is a function because at any given time, the object has exactly one height.
Economics and Business
A company’s profit function might be composed of revenue and cost functions:
$$P(x) = R(x) - C(x)$$
where $x$ is the number of units sold. This composition of functions allows analysts to understand how different factors contribute to overall profitability.
Computer Science
In programming, function composition is fundamental. Consider these functions:
- $f(x)$ converts a temperature from Celsius to Kelvin
- $g(x)$ rounds a number to two decimal places
Then $(g \circ f)(x)$ gives a rounded Kelvin temperature from a Celsius input. Programmers chain functions together constantly to build complex operations from simpler ones.
Medicine and Pharmacology
Drug concentration in the bloodstream is often modeled by functions. If $C(t)$ gives the concentration at time $t$, doctors need to understand:
- The domain (how long the drug remains measurable)
- The range (what concentrations are possible)
- The inverse (at what time will the concentration reach a certain level?)
Self-Test Problems
Problem 1: Find the domain of $f(x) = \sqrt{5 - x}$.
Show Answer
For the square root to be defined, we need $5 - x \geq 0$, which means $x \leq 5$.
Domain: $(-\infty, 5]$
Problem 2: If $f(x) = 2x^2 - x + 3$, find $f(-3)$.
Show Answer
$$f(-3) = 2(-3)^2 - (-3) + 3$$ $$= 2(9) + 3 + 3$$ $$= 18 + 6$$ $$= 24$$
Answer: $f(-3) = 24$
Problem 3: Let $f(x) = \begin{cases} 3x - 1 & \text{if } x < 2 \ x^2 + 1 & \text{if } x \geq 2 \end{cases}$. Evaluate $f(0)$ and $f(4)$.
Show Answer
For $f(0)$: Since $0 < 2$, use the first rule: $$f(0) = 3(0) - 1 = -1$$
For $f(4)$: Since $4 \geq 2$, use the second rule: $$f(4) = (4)^2 + 1 = 16 + 1 = 17$$
Answers: $f(0) = -1$ and $f(4) = 17$
Problem 4: Find and simplify the difference quotient $\frac{f(x+h) - f(x)}{h}$ for $f(x) = 3x - 7$.
Show Answer
Step 1: $f(x + h) = 3(x + h) - 7 = 3x + 3h - 7$
Step 2: $f(x + h) - f(x) = (3x + 3h - 7) - (3x - 7) = 3h$
Step 3: $\frac{f(x+h) - f(x)}{h} = \frac{3h}{h} = 3$
Answer: The difference quotient is $3$ (which makes sense, as $f(x) = 3x - 7$ is a linear function with slope 3).
Problem 5: Let $f(x) = x + 5$ and $g(x) = x^2$. Find $(f \circ g)(3)$ and $(g \circ f)(3)$.
Show Answer
For $(f \circ g)(3) = f(g(3))$:
- $g(3) = 3^2 = 9$
- $f(9) = 9 + 5 = 14$
So $(f \circ g)(3) = 14$.
For $(g \circ f)(3) = g(f(3))$:
- $f(3) = 3 + 5 = 8$
- $g(8) = 8^2 = 64$
So $(g \circ f)(3) = 64$.
Answers: $(f \circ g)(3) = 14$ and $(g \circ f)(3) = 64$
Problem 6: Find the inverse of $f(x) = 4x - 9$.
Show Answer
Step 1: Write $y = 4x - 9$
Step 2: Swap $x$ and $y$: $x = 4y - 9$
Step 3: Solve for $y$: $$x + 9 = 4y$$ $$y = \frac{x + 9}{4}$$
Answer: $f^{-1}(x) = \frac{x + 9}{4}$
Problem 7: Verify that $f(x) = x^3$ and $g(x) = \sqrt[3]{x}$ are inverses of each other.
Show Answer
Check 1: $f(g(x)) = f(\sqrt[3]{x}) = (\sqrt[3]{x})^3 = x$ ✓
Check 2: $g(f(x)) = g(x^3) = \sqrt[3]{x^3} = x$ ✓
Both compositions equal $x$, so $f$ and $g$ are inverses of each other.
Summary
- A function is a rule that assigns exactly one output to each input. The input goes in, the rule is applied, and exactly one output comes out.
- Function notation like $f(x)$ indicates that $f$ is a function and $x$ is its input. The letters can vary: $g(t)$, $h(n)$, $P(x)$ all work the same way.
- The domain is the set of all allowed inputs; the range is the set of all possible outputs.
- When finding domain, look for division by zero, even roots of negatives, or logarithms of non-positives.
- Evaluating functions means substituting a value or expression for the input and calculating the result.
- Piecewise functions use different rules for different parts of their domain. Check which condition your input satisfies, then use the corresponding rule.
- The difference quotient $\frac{f(x+h) - f(x)}{h}$ measures the average rate of change of a function and is foundational to calculus.
- Function composition $(f \circ g)(x) = f(g(x))$ means applying $g$ first, then $f$. Order matters.
- An inverse function $f^{-1}$ undoes what $f$ does: $f(f^{-1}(x)) = x$ and $f^{-1}(f(x)) = x$.
- The horizontal line test determines if a function has an inverse: no horizontal line should cross the graph more than once.
- To find an inverse algebraically: swap $x$ and $y$, then solve for $y$.
- To verify inverses: check that both $f(f^{-1}(x)) = x$ and $f^{-1}(f(x)) = x$.