· Grade 9 lesson · 4 min read
Lesson: What Is a Function? Inputs, Outputs and f(x) (Grade 9)
A function is a rule that gives exactly one output for each input. Put a number in, and you always get the same one number out.
A number machine
Think of a function as a machine. You drop in a number (the input). The machine follows its rule. Out comes one number (the output).
A snack machine is a good picture. Press B4 and you get the same snack every time. If B4 sometimes gave chips and sometimes cookies, the machine would be broken. A function never does that.
Reading f(x)
f(x) = 2x + 1 is just a way to write the rule.
- f is the function's name. (It can be g, h or any letter.)
- x is the input.
- f(3) means "put 3 into f". It does not mean f times 3.
Evaluating: put a number in
Replace every x with the number. Use brackets so you don't lose signs.
- f(3) = 2(3) + 1 = 7
- f(0) = 2(0) + 1 = 1
- f(−2) = 2(−2) + 1 = −4 + 1 = −3
Working backwards
If f(x) = 11, what was the input? Set the rule equal to 11 and solve:
2x + 1 = 11, so 2x = 10 and x = 5.
Is it a function? Check a table
Look at the inputs. If the same input ever gives two different outputs, it's not a function.
| x | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| y | 5 | 5 | 6 | 7 |
✔ Function. Each x has one y. (Two inputs sharing the output 5 is fine.)
| x | 1 | 1 | 2 | 3 |
|---|---|---|---|---|
| y | 4 | 6 | 7 | 8 |
✘ Not a function. The input 1 gives both 4 and 6.
Easy way to remember: two kids can share a birthday (two inputs, same output: fine). But one kid can't have two birthdays (one input, two outputs: not a function).
Is it a function? Check a graph
Use the vertical line test. Imagine a vertical line sliding across the graph. If it ever hits the graph twice, it's not a function.
Domain and range
- Domain: all the inputs you're allowed to put in.
- Range: all the outputs that can come out.
| Function | Domain | Range |
|---|---|---|
| f(x) = 2x + 1 | all numbers | all numbers |
| g(x) = x² | all numbers | y ≥ 0 (a square is never negative) |
| h(x) = √x | x ≥ 0 (no square root of a negative) | y ≥ 0 |
In real life the story sets the domain. If C(n) is the cost of n tickets, n must be 0, 1, 2, 3… You can't buy 2.5 tickets.
A real-life function
A pizza costs $12, plus $3 for delivery. The cost of n pizzas is C(n) = 12n + 3.
C(4) = 12(4) + 3 = $51. Four pizzas cost $51.
Easy mistakes
- Reading f(3) as f × 3. It means "the output when the input is 3".
- Thinking a repeated output breaks a function. Only a repeated input with a different output does.
- Dropping brackets with negatives. If f(x) = x², then f(−2) = (−2)² = 4, not −4.
Try it
Use f(x) = 3x − 4.
- Find f(2).
- Find f(−1).
- If f(x) = 11, find x.
- Is {(1, 2), (2, 2), (3, 5)} a function?
- Is {(4, 1), (4, 3), (5, 6)} a function?
Show the answers
1. 3(2) − 4 = 2
2. 3(−1) − 4 = −7
3. 3x − 4 = 11, so 3x = 15 and x = 5.
4. Yes. Every input has one output.
5. No. The input 4 gives both 1 and 3.
Practice
- Function Evaluation
- Function Notation with Graphs & Tables
- Finding Domain & Range
- Straight-line functions: see slope.