Functions, Domain and Range
Learn what makes a relation a function, read and evaluate function notation, and find the domain and range of formulas and graphs.
Welcome back!
Step 1 of 14Learn
Why precalculus starts with functions
Calculus is the math of change: how fast a rocket climbs, how quickly a disease spreads, how a price responds to demand. Every one of those questions is about a function, a rule that links one quantity to another. Precalculus is where you get fluent with the main families of functions, so that calculus can focus on the new ideas instead of the algebra.
A function is a rule that assigns to each input exactly one output. A vending machine is a good picture: press B4 and you always get the same snack. If pressing B4 sometimes gave chips and sometimes gave a candy bar, the machine wouldn't be a function.
Examples:
- Each student → their birthday. A function: every student has one birthday (two students can share one, and that's allowed).
- Each birthday → the students born that day. Not a function: one input date can give several outputs.
- A temperature in °C → the same temperature in °F, using F = 1.8C + 32. A function: one input, one output.
The key test is one input, one output. Many inputs sharing an output is fine. One input with several outputs is not.
Step 2 of 14Diagram
A function is an input-output machine
Every function works the same way: one input goes in, the rule acts on it, and exactly one output comes out. Tap each stage.
Tap a shape with to see more.
- Input x
A number from the domain, such as x = 4.
- Rule f
The formula or instruction, for example f(x) = 3x2 − 2x + 1.
- Output f(x)
The single result, here f(4) = 41. One input can never give two outputs.
Step 3 of 14Practice · Sort into groups
Sort each relation: is it a function of the input listed first?
Tap an item, then tap its group (or drag it there).
Step 4 of 14Learn
Function notation
We name functions with letters and write f(x), read "f of x." It means "the output of f when the input is x." It does not mean f times x.
If f(x) = 3x2 − 2x + 1, then to evaluate f(4), replace every x with 4:
f(4) = 3(4)2 − 2(4) + 1 = 48 − 8 + 1 = 41
You can also plug in expressions. For f(x + 1), replace each x with (x + 1), in parentheses:
f(x + 1) = 3(x + 1)2 − 2(x + 1) + 1 = 3x2 + 6x + 3 − 2x − 2 + 1 = 3x2 + 4x + 2
Two habits prevent most mistakes:
- Always use parentheses when substituting, especially negative numbers. f(−2) = 3(−2)2 − 2(−2) + 1 = 12 + 4 + 1 = 17. Without parentheses, people write −22 = −4 and get the wrong answer.
- f(x + 1) is not f(x) + 1. The first changes the input; the second changes the output. For the function above, f(x) + 1 = 3x2 − 2x + 2, which is different from 3x2 + 4x + 2.
Function notation shows up on graphs too: the point (4, 41) is on the graph of f exactly because f(4) = 41.
Step 5 of 14Practice · Work it out
If g(x) = 2x2 − 5x + 3, what is g(−1)?
Step 6 of 14Try the calculator
Evaluate a quadratic at any input
This evaluates f(x) = a·x2 + b·x + c. Keep a = 2, b = −5, c = 3 to check your answer to g(−1), then try other inputs and notice that negative inputs make the x2 term positive.
- a·x2
- 2
- b·x
- 5
- f(x)
- 10
Step 7 of 14Learn
Domain and range
The domain of a function is the set of inputs it accepts. The range is the set of outputs it actually produces.
For a formula with no context, the domain is all real numbers except values that break the math. In precalculus, two things break it:
- Division by zero. f(x) = 1/(x − 3) is undefined at x = 3. Domain: all real numbers except 3.
- Even roots of negative numbers. g(x) = √(x + 2) needs x + 2 ≥ 0, so x ≥ −2. Domain: [−2, ∞).
Later, logarithms add a third rule: you can only take the log of a positive number.
The range is often found from the graph or by reasoning. Since √ never gives a negative result, g(x) = √(x + 2) has range [0, ∞). Since x2 is never negative, h(x) = x2 + 5 has range [5, ∞).
Interval notation is the standard shorthand. Square brackets include an endpoint, parentheses exclude it, and ∞ always gets a parenthesis because it isn't a number you can reach:
- x ≥ −2 → [−2, ∞)
- 1 < x ≤ 4 → (1, 4]
- all real numbers except 3 → (−∞, 3) ∪ (3, ∞)
In word problems, context limits the domain too: a number of tickets can't be negative or fractional.
Step 8 of 14Diagram
Two things that shrink a domain
When no context is given, start with all real numbers and remove only what breaks the math.
Tap a shape with to see more.
- Start: all real numbers
- Division by zero
A fraction is undefined when its denominator is 0.
- Remove x where denominator = 0
Solve denominator = 0 and exclude those values.
- Even root of a negative
√ of a negative number is not a real number.
- Keep x where inside ≥ 0
Solve the inequality (expression under the root) ≥ 0.
Step 9 of 14Practice · Match the pairs
Match each function to its domain.
Tap an answer, then tap the place where it belongs (or drag it there).
- f(x) = √(x − 4)
- f(x) = 1/(x + 2)
- f(x) = x3 − 7x
- f(x) = √(6 − x)
- f(x) = 5/(x2 − 9)
Step 10 of 14Note
Step 11 of 14Compare
Vertical line test in action
| Aspect | Graph | Passes the test? |
|---|---|---|
| Line y = 2x + 1 | Every vertical line hits it once | Yes: a function |
| Parabola y = x2 | One crossing per vertical line | Yes: a function |
| Circle x2 + y2 = 9 | x = 0 meets it at y = 3 and y = −3 | No |
| Sideways parabola x = y2 | x = 4 meets it at y = 2 and y = −2 | No |
Step 12 of 14Practice · True or false
The function h(x) = x2 − 6 has range [−6, ∞).
Step 13 of 14Practice · Choose one
If f(x) = x2 + 1, which expression equals f(x + 2)?
Step 14 of 14Practice · Choose one
What is the domain of f(x) = √(2x − 8)?
Lesson complete!