Functions, domain, and range
A function is a rule that assigns exactly one output to each input. Functions are the central idea of algebra and every course built on it.
What a function is
A function from a set of inputs to a set of outputs assigns each input exactly one output. A vending machine is a function if each button always gives the same snack. A relation where one input can give two outputs, such as the set of pairs (4, 2) and (4, -2), is not a function.
Function notation
We write \(f(x)\), read 'f of x', for the output when the input is x. If \(f(x) = x^2 - 3x\), then \(f(5) = 25 - 15 = 10\) and \(f(-2) = 4 + 6 = 10\). Note that \(f(x)\) does not mean f times x. Inputs can be expressions: \(f(a + 1) = (a + 1)^2 - 3(a + 1) = a^2 - a - 2\).
The vertical line test
A graph represents a function exactly when no vertical line crosses it more than once, because a vertical line marks one input. Parabolas opening up or down pass; a circle fails, since vertical lines through its interior hit it twice.
Domain
The domain is the set of allowed inputs. Unless stated otherwise, it is every real number for which the formula makes sense. Exclude inputs that cause division by zero or even roots of negatives: \(g(x) = \frac{1}{x - 4}\) has domain all reals except 4, and \(h(x) = \sqrt{x + 2}\) needs \(x \ge -2\).
Range
The range is the set of outputs actually produced. For \(f(x) = x^2\), the range is \(y \ge 0\), since squares are never negative. For \(h(x) = \sqrt{x + 2}\), the range is also \(y \ge 0\). Reading the lowest and highest points of a graph helps find the range.
Reading graphs
From a graph you can read values (f(3) is the height at x = 3), intervals where the function increases or decreases, maximum and minimum points, and zeros, where the graph meets the x-axis. These features describe a function's behaviour at a glance.
Difference quotient
The average rate of change of f from x = a to x = b is \(\frac{f(b) - f(a)}{b - a}\), the slope of the line joining those points. For \(f(x) = x^2\) from 1 to 3, it is \(\frac{9 - 1}{2} = 4\). Shrinking the interval leads to the derivative in calculus.
Worked example
A parking garage charges $3 for the first hour and $2 for each extra hour, up to a daily maximum of $15. The cost function C(h) has domain whole hours from 1 to 24. For h from 1 to 7, \(C(h) = 3 + 2(h - 1)\), giving C(7) = 15; after that the cost stays at $15. Its range is the odd amounts 3, 5, 7, ..., 15.
Key takeaways
A function gives exactly one output for each input, and graphs of functions pass the vertical line test. f(x) names the output for input x and is not multiplication. The domain excludes inputs that divide by zero or take even roots of negatives; the range is the set of outputs produced. Graphs show values, increasing and decreasing intervals, extremes, and zeros. The average rate of change, (f(b) - f(a))/(b - a), is the slope between two points and leads to calculus.
Flashcard
Exactly one output per input
Check your understanding
If \(f(x) = x^2 - 3x\), what is \(f(5)\)?
