Put in x, out comes y
Today one of the biggest topics of ninth grade begins: functions. It sounds fancy, but it’s an ordinary number machine. You put a number x in, the machine processes it by its rule, and a number y comes out.
A ticket machine is a function: you put in the number of zones, out comes the price. A taxi meter is a function: you put in kilometers, out comes the fare. A charger is a function: you put in minutes of charging, out come the battery percentages.
The machine’s rule is written as an equation. For example y = 3x + 5. You read it: “take x, multiply by three, add five, and that’s y.”
An important property: for one x, only one y ever comes out. The machine doesn’t roll dice. The same input, the same output, every time.
Today you’ll learn to read a function, calculate its values, and build a table. Graphs come in the next lesson.
Jonah is ordering a taxi through an app. “$4 to get in and then $3 per kilometer,” Sophie reads over his shoulder. “That’s a function: y = 3x + 4. You put in kilometers, out comes the price.” Jonah tries it: “So 5 kilometers… 3 times 5 is 15, plus 4 is $19.” Sophie nods: “And the app calculates it exactly the same way. No magic: it just substitutes into the formula. Anyone who knows functions can see how prices are made.”
Always translate the word “function” into “number machine”, and the equation into instructions: what happens to x before it becomes y.
Notation, substituting and a table of values
Writing a function: y = 2x + 1. The letter x is the input (what you put in), y is the output (what comes out). Sometimes it’s written f(x) = 2x + 1: read it “f of x”, and it means the same thing.
Calculating a value = substituting. I want to know what the machine does with a three. I write three in place of x: y = 2 · 3 + 1 = 7. Done: for x = 3, y = 7.
A table of values: several inputs and outputs neatly side by side. For y = 2x + 1:
x: 0, 1, 2, 3 y: 1, 3, 5, 7
Notice the pattern: when x goes up by 1, y goes up by 2. That’s the two next to the x doing that: in the next lesson, it’ll become the slope of the graph.
What a function isn’t: a rule that gives several outputs for one input. “Put in 3 and out comes 7, or maybe 10”: that’s not a function, that’s a broken vending machine.
The process for today: take a rule, substitute four different x’s (including zero and a negative number), write a table. Anyone who can make a table gets the graph for free next week.
Example 1: values of the function y = 3x + 5
The problem: Calculate y for x = 0, x = 2 and x = 10.
The process: I substitute in place of x:
For x = 0: y = 3 · 0 + 5 = 5. For x = 2: y = 3 · 2 + 5 = 11. For x = 10: y = 3 · 10 + 5 = 35.
The table: x: 0, 2, 10 → y: 5, 11, 35.
Notice: zero is the fastest substitution in the world: everything with x disappears and only +5 is left. Always substitute zero first: it’s a free check.
Example 2: a taxi as a function
The problem: A taxi charges $4 to get in and $3 per kilometer. Write the rule and work out the price for 3 km and for 8 km.
The process: The input x = the number of kilometers, the output y = the price in dollars.
The rule: y = 3x + 4.
For x = 3: y = 3 · 3 + 4 = 9 + 4 = $13. For x = 8: y = 3 · 8 + 4 = 24 + 4 = $28.
A check by thinking: 5 extra km should cost 5 · 3 = $15 more. And sure enough: 28 − 13 = 15. It fits.
Example 3: find x when you know y
The problem: The function y = 2x + 1. For what x is y = 15?
The process: Now I go the opposite way: I know the output and I’m looking for the input. I substitute y and solve the equation:
15 = 2x + 1.
I subtract 1: 14 = 2x. I divide by two: x = 7.
The check: y = 2 · 7 + 1 = 15. It fits.
The answer: x = 7. This turnaround (from y back to x) is a favorite test question: and it’s just an ordinary equation.
Don’t mix up input and output. The question “what is the value of the function for x = 4” means substitute 4 for x. The question “for what x is the value 4” means set y = 4 and solve the equation. Read the question twice: they sound similar, and each wants the opposite process.
Practice: your turn to count 🎲
Now try it for real. You’ll see all the questions at once, like on paper. Mulai with ten. If it’s going well, add more.
The number machine for real: substitute x into the rule and write what comes out. Write a whole number.
On paper
Tables of values and one number machine of your own.
-
The function y = 2x + 3. Build a table for x = 0, 1, 2, 3, 4. How much does y grow when x goes up by 1?
-
The function y = 5x − 2. Calculate y for x = 0, x = 2, x = 6.
-
Make up a function from real life (charging a phone, the price of photocopies…), write the rule, and calculate two values.
-
The function y = 4x + 1: for what x is y = 21? Solve it as an equation and do the check.
Giliranmu 💪
- I can read y = 3x + 5 as instructions: multiply by three, add five.
- I built a table of values and I can see the regular growth in it.
- I can handle the reverse direction too: find x from a value of y with an equation.
Done when: you have two tables of values, one function of your own from life, and one solved reverse problem (from y to x).
What to take away from this lesson
- A function is a number machine: you put in x, and by the rule, y comes out.
- For one input, there’s always only one output.
- You calculate a value of a function by substituting x into the rule.
- A table of values is the fastest way to get to know a function.
- You get from y back to x with an equation.
© 2026 Ing. Martin Polak / AlgoRhino · Ketentuan penggunaan konten