M5.1.1 Chapter 1
Domain, range and inverses
Can I put any number into a function, and can every number come out?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
- Find the domain and range of a function
- Say when a function has an inverse
- Sketch a function and its inverse, mirrored in y = x
A function is a rule that gives exactly one output for each allowed input. The set of allowed inputs is the domain. The set of outputs that the rule really gives is the range.
Take f(x) = x². If we allow only the inputs −2, −1, 1 and 2, the domain is that list. The arrows show the range is 1 and 4.
Two inputs may share an output, as −2 and 2 do here. That is allowed. A rule like this is called many to one. What a function never does is give one input two outputs.
Some papers write f : x → 2x + 1, with a small bar at the back of the arrow, and read it "f maps x to 2x + 1". This means f(x) = 2x + 1.
Unless a question says otherwise, the domain is every real number for which the rule works. A real number is any number on the number line, including fractions and roots such as √2.
We write a domain or range in two ways. Set notation uses braces: {x : x ≥ 2} reads "the set of x such that x is at least 2". Interval notation uses brackets: [2, ∞).
A square bracket includes the end. A round bracket leaves it out. The sign ∞ means "goes on without end". It is not a number, so it always has a round bracket. So [−1, 3] means −1 ≤ x ≤ 3, and (−1, 3] means −1 < x ≤ 3.
Three things can stop an input. You cannot divide by zero. You cannot take the square root of a negative number and stay with real numbers. And a question may restrict the domain, for example "for 0 ≤ x ≤ 3".
To find the range, ask which outputs are possible. A sketch helps: read the lowest and highest heights the curve reaches. A restricted domain gives its own range.
Worked example
f(x) = 2x + 1 for 0 ≤ x ≤ 3. Write the domain and find the range.
- The domain is given: 0 ≤ x ≤ 3, which is [0, 3].
- The line y = 2x + 1 rises as x grows, so the lowest output comes from the smallest input.
- Smallest input: f(0) = 2 × 0 + 1 = 1.
- Largest input: f(3) = 2 × 3 + 1 = 7.
- A straight line has no gaps, so every height from 1 to 7 is reached.
- The range is 1 ≤ y ≤ 7, which is [1, 7].
Answer: The range is [1, 7].
Now a square root. Its inside must be 0 or more, and the root sign gives the positive root, so the output is never below 0.
Worked example
f(x) = √(x − 2) + 1. Find the largest possible domain, and the range.
- A real square root needs the inside to be 0 or more: x − 2 ≥ 0.
- Add 2 to both sides: x ≥ 2. The domain is [2, ∞).
- The root sign gives the positive root, so √(x − 2) ≥ 0, and it equals 0 when x = 2.
- Add 1 to the root: f(x) = √(x − 2) + 1 ≥ 1.
- At the start, f(2) = √0 + 1 = 1. As x grows the outputs grow without end, with no gaps.
- The range is y ≥ 1, which is [1, ∞).
Answer: The domain is [2, ∞) and the range is [1, ∞).
A fraction cannot have a bottom of zero. That removes one input, and often one output as well.
Worked example
g(x) = 1/(x − 3). Find the domain and the range.
- The bottom must not be zero. x − 3 = 0 when x = 3, so x ≠ 3.
- The domain is every real number except 3.
- For the range, write y = 1/(x − 3) and try to solve for x.
- Multiply by (x − 3): y(x − 3) = 1. If y ≠ 0, divide by y: x − 3 = 1/y.
- So x = 3 + 1/y. This gives an input for every y except y = 0, where 1/y has no meaning.
- Test it: g(4) = 1/(4 − 3) = 1, and g(2) = 1/(2 − 3) = −1.
- The outputs fall on both sides of 0, but 0 needs 1/(x − 3) = 0, and a fraction with top 1 is never 0. The range is every real number except 0.
Answer: The domain is x ≠ 3 and the range is y ≠ 0.
Now the inverse. A function is one to one if different inputs always give different outputs. Only a one to one function has an inverse function f⁻¹, because the inverse must take each output back to a single input.
The horizontal line test shows it. If every horizontal line cuts the graph at most once, the function is one to one.
We can mend this by restricting the domain. Keep only x ≥ 0. Now each output has one input, and the inverse is f⁻¹(x) = √x.
The inverse swaps inputs and outputs. So the domain of f⁻¹ is the range of f, and the range of f⁻¹ is the domain of f. If (a, b) is on the graph of f, then (b, a) is on the graph of f⁻¹. Swapping x and y reflects the graph in the line y = x.
To find an inverse: write y = f(x), solve for x, then write x for the input again. Check which root to take from the domain of f.
Worked example
f(x) = x² − 4x + 5 for x ≥ 2. Write f(x) as (x − p)² + q. Find the range of f. Find f⁻¹(x), and give its domain and range.
- Complete the square: x² − 4x + 5 = (x − 2)² − 4 + 5 = (x − 2)² + 1.
- For x ≥ 2 the bracket x − 2 is 0 or more, and (x − 2)² grows as x grows.
- The smallest output is f(2) = 0 + 1 = 1, and the outputs grow without end. The range is y ≥ 1.
- Each output now comes from only one input on x ≥ 2, so f is one to one and has an inverse.
- Write y = (x − 2)² + 1, so (x − 2)² = y − 1.
- Take the square root. On this domain x − 2 is not negative, so take the positive root: x − 2 = √(y − 1).
- So x = 2 + √(y − 1). Write x for the input: f⁻¹(x) = 2 + √(x − 1).
- The domain of f⁻¹ is the range of f, which is x ≥ 1. The range of f⁻¹ is the domain of f, which is y ≥ 2.
Answer: f⁻¹(x) = 2 + √(x − 1), with domain x ≥ 1 and range y ≥ 2.
Two more words help when a question asks for them. The codomain is the set the outputs are allowed to lie in, which a question may state. The range is the part of the codomain that is really reached. A function is onto if its range is the whole codomain.
Take f(x) = x² from the real numbers to the real numbers. It is not onto: the range is y ≥ 0, so no input gives −1. But f(x) = x² from the real numbers to [0, ∞) is onto, because every y ≥ 0 equals x² for x = √y. A function that is one to one and onto is a bijection, and every bijection has an inverse.
Now two functions in a row. In fg(x) = f(g(x)), the function g goes first. So fg exists only for inputs x where g(x) is in the domain of f. This can shrink the domain of fg.
Worked example
f(x) = √(x − 2) and g(x) = 3 − x. Find fg(x) and its domain.
- fg(x) = f(g(x)). Put g(x) = 3 − x into f: fg(x) = √((3 − x) − 2) = √(1 − x).
- The domain of g is all real numbers, so any x can go into g.
- But f needs its input to be 2 or more, because √(x − 2) needs x − 2 ≥ 0. So we need g(x) ≥ 2: 3 − x ≥ 2.
- Take 3 from both sides: −x ≥ −1. Multiply by −1 and turn the sign round: x ≤ 1.
- Check with x = 1: g(1) = 2, and f(2) = 0, so fg(1) = √0 = 0. And x = 2 fails: g(2) = 1, and f(1) = √(−1) does not exist.
- So fg(x) = √(1 − x), with domain x ≤ 1.
Answer: fg(x) = √(1 − x), with domain x ≤ 1.
Try it
Fold the graph along y = x
You need: squared paper, a pencil and a ruler.
- Draw axes from 0 to 6 on both sides. Draw the line y = 2x + 1 and mark the points (0, 1), (1, 3) and (2, 5).
- Swap the two numbers of each point and mark the new points (1, 0), (3, 1) and (5, 2).
- Draw the dashed line y = x. Draw a line through the new points. It is the graph of f⁻¹(x) = (x − 1)/2.
- Fold the paper along the dashed line. Hold it to the light.
What you will see: Each point of the first line lands on its swapped point. The two lines are mirror images in y = x.
A wrong idea many people have
f⁻¹(x) means 1/f(x).
Why it feels right: A raised −1 on a number gives a reciprocal: 2⁻¹ is 1/2. The same mark on f seems to say the same thing.
The test that breaks it: Take f(x) = x + 2. Then f(3) = 5, so the inverse takes 5 back to 3: f⁻¹(5) = 3. The reciprocal would give 1/f(5) = 1/7, which is a different number.
What is true: For a function, f⁻¹ is the inverse function, which undoes f. The reciprocal is written 1/f(x) or (f(x))⁻¹, and it is a different thing.
A wrong idea many people have
Every function has an inverse.
Why it feels right: For straight line functions such as 2x + 1 we can always undo the steps, so it seems any function can be undone.
The test that breaks it: Take f(x) = x² on all real numbers. f(3) = 9 and f(−3) = 9. An inverse would have to send 9 back to both 3 and −3, and a function may not give two outputs.
What is true: Only a one to one function has an inverse. Restrict the domain first, for example to x ≥ 0, and the inverse exists on that domain.
A wrong idea many people have
The range of x² − 4x + 5 is y ≥ 5, because 5 is the last number.
Why it feels right: For y = x² + c the lowest point is c, so the last number seems to give the lowest output.
The test that breaks it: The −4x term moves the lowest point. f(2) = 4 − 8 + 5 = 1, and 1 is below 5.
What is true: Complete the square. In (x − p)² + q the lowest value is q, so here it is 1. Check the domain too, because it may cut off the lowest point.
Key words
- function
- a rule that gives exactly one output for each allowed input.
- domain
- the set of inputs a function allows.
- range
- the set of outputs a function really gives.
- real number
- any number on the number line, including fractions and roots.
- one to one
- different inputs always give different outputs.
- inverse function
- the function f⁻¹ that takes each output back to its input. It exists only if f is one to one.
- restricting the domain
- allowing only some inputs, so that a function becomes one to one.
Back to your guess
The answer is B: No. A function has a set of inputs it accepts, and its outputs may fill only part of the number line.
Take f(x) = √x. You cannot put in −4, because a negative number has no real square root. And the output is never negative either. The inputs allowed are called the domain, and the outputs reached are called the range. Both can be only part of the number line.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
What is the largest domain of f(x) = √(x − 5)?
See the answer
x ≥ 5
A real square root needs x − 5 ≥ 0. Add 5 to both sides: x ≥ 5. The input 5 gives √0 = 0, so 5 is included.
- If you chose A: You changed the sign of 5. The inside x − 5 must be 0 or more, so x ≥ 5. Go to M5.1.1.
- If you chose B: You turned the sign the wrong way round. A square root needs the inside to be 0 or more, which gives x ≥ 5. Go to M5.1.1.
- If you chose D: The input 5 is allowed, because √0 = 0 is a real number. So the end is included. Go to M5.1.1.
What is the range of f(x) = (x + 1)² − 3, for all real x?
See the answer
y ≥ −3
The square (x + 1)² is 0 or more, and it is 0 when x = −1. Take away 3: f(x) ≥ −3, and f(−1) = −3 is reached.
- If you chose B: The −3 moves the lowest point down to −3, not up to 3. Go to M5.1.1.
- If you chose C: The number inside the bracket moves the graph sideways, so it fixes the x of the lowest point. The range comes from the number outside, which is −3. Go to M5.1.1.
- If you chose D: The squared bracket is 0 or more, but then 3 is taken away, so the lowest output is below 0. Go to M5.1.1.
The point (2, 9) is on the graph of a one to one function f. Which point must be on the graph of f⁻¹?
See the answer
(9, 2)
f takes the input 2 to the output 9. So f⁻¹ takes the input 9 back to the output 2. The point is (9, 2), the mirror image of (2, 9) in y = x.
Which of these functions has an inverse function?
See the answer
f(x) = x², for x ≥ 3
On x ≥ 3 the inputs are all positive, and x² grows as x grows. Each output comes from one input only, so f is one to one and has an inverse.
- If you chose A: f(2) = 4 and f(−2) = 4. Two inputs share one output, so f cannot be undone. Go to M5.1.1.
- If you chose B: Adding 1 does not help. f(2) = 5 and f(−2) = 5, so the function is not one to one. Go to M5.1.1.
- If you chose C: This domain holds both −2 and 2, which give the same output 4. It is not one to one. Go to M5.1.1.
Mei says: "g(x) = 2 + 1/(x − 3) has the input 3 missing, so its range is y ≠ 3." What is the range of g?
See the answer
y ≠ 2
The part 1/(x − 3) is never 0, so g(x) = 2 + 1/(x − 3) is never 2. Every other output is reached: for y ≠ 2, solving y = 2 + 1/(x − 3) gives x = 3 + 1/(y − 2). So the range is y ≠ 2.
f(x) = x² − 8x + 19. Find the smallest value of f(x).
See the answer
3
Complete the square: x² − 8x + 19 = (x − 4)² − 16 + 19 = (x − 4)² + 3. The square is never below 0, so the smallest value is 3, when x = 4.
f(x) = x² − 6x + 14 for x ≥ 3. Find f⁻¹(14).
See the answer
6
f⁻¹(14) is the input that f turns into 14. Solve x² − 6x + 14 = 14, so x² − 6x = 0 and x(x − 6) = 0. That gives x = 0 or x = 6. Only 6 is in the domain x ≥ 3.
g(x) = x² + 4x + 9 for x ≥ −2. Show that the range of g is y ≥ 5, and explain why g has an inverse.
See the answer
g(x) = (x + 2)² + 5. For x ≥ −2, x + 2 is 0 or more, so (x + 2)² ≥ 0 and g(x) ≥ 5. The value 5 is reached at x = −2. For any y ≥ 5, the input x = −2 + √(y − 5) is in the domain and gives g(x) = y, so every value from 5 up is reached. On this domain g rises as x grows, so each output has one input. So g is one to one and has an inverse.
Three marks. One: complete the square to get (x + 2)² + 5. Two: use x ≥ −2 to show g(x) ≥ 5, show that 5 is reached, and show that every larger value is reached. Three: g only rises on this domain, so it is one to one and has an inverse.
f(x) = √x and g(x) = x − 4. What is the domain of fg?
See the answer
x ≥ 4
fg(x) = f(g(x)) = √(x − 4). The square root needs x − 4 ≥ 0, so x ≥ 4. The input 4 is allowed, because √0 = 0.
- If you chose A: That is the domain of f alone. In fg the input goes into g first, and then g(x) must be allowed in f, so g(x) ≥ 0. Go to M5.1.1.
- If you chose B: You turned the sign round. We need g(x) = x − 4 to be 0 or more, which gives x ≥ 4. Go to M5.1.1.
- If you chose C: You changed the sign of 4. From x − 4 ≥ 0, add 4 to both sides to get x ≥ 4. Go to M5.1.1.
f(x) = x², with inputs and outputs both taken from the real numbers. Which statement is true?
See the answer
f is not onto, because its range is only y ≥ 0.
The range of x² is y ≥ 0, so negative numbers are never reached. The codomain is all real numbers, so f is not onto. (It is also not one to one, but that is a separate fault.)
- If you chose B: Take y = −1. No real x has x² = −1. A function is onto only if every number in the codomain is reached. Go to M5.1.1.
- If you chose C: Being one to one and being onto are different things. A function can fail one and pass the other. Onto asks whether the whole codomain is reached. Go to M5.1.1.
f(x) = √(x − 2) and g(x) = 7 − x. The function fg is defined for x ≤ c. Find c.
See the answer
5
fg(x) = f(g(x)) = √((7 − x) − 2) = √(5 − x). This needs 5 − x ≥ 0, so x ≤ 5. Check: g(5) = 2, and f(2) = 0, which is allowed.
Keep it
Copy this into your exercise book.
Domain: inputs allowed. Range: outputs reached. Only a one to one function has an inverse; restrict the domain to get one. f⁻¹ swaps x and y, so reflect the graph in y = x.
Draw: A curve and its inverse, with the dashed line y = x between them and a pair of mirror points.