Introduction to Functions

Understand the input-output machines of mathematics

The word “function” might sound intimidating, like something only mathematicians and programmers use. But here is the truth: you have been using functions your entire life without realizing it. Every time you calculate a tip at a restaurant, figure out how long a road trip will take based on your speed, or check how many calories are in multiple servings of your favorite snack, you are working with functions. A function is simply a rule that takes an input and gives you exactly one output. That is it. Once you see functions for what they really are, you will wonder why they ever seemed mysterious.

Core Concepts

What is a Function?

Think of a function as a machine. You put something in (the input), the machine does its thing, and something comes out (the output). The key rule is this: for each input, there is exactly one output. The machine always gives you a consistent, predictable result.

Let us look at a real example. Imagine a vending machine where you punch in a code. If you press “A3,” you always get the same item, say, a bag of chips. You would be pretty confused if pressing “A3” gave you chips sometimes, a soda other times, and a candy bar on Tuesdays. That would be a broken machine. A function works like a reliable vending machine: same input, same output, every single time.

Here are some everyday “functions” you already use:

  • Temperature conversion: Put in a Celsius temperature, get out the Fahrenheit equivalent.
  • Sales tax: Put in a price, get out the total with tax included.
  • Distance traveled: Put in how many hours you have been driving at 60 mph, get out how many miles you have covered.

The Golden Rule of Functions

Here is the one rule that makes a function a function:

Each input produces exactly one output.

Notice this does not say each output comes from exactly one input. It is perfectly fine for two different inputs to produce the same output. For example, both -3 and 3, when squared, give you 9. That is allowed. What is not allowed is for a single input to produce two different outputs.

Think about it with the vending machine: it is fine if codes A3 and B7 both give you chips (same output from different inputs). But A3 cannot give you chips AND a soda at the same time (multiple outputs from one input). That would be chaos.

Notation and Terminology

Function Notation: f(x)

Mathematicians have a shorthand way to write functions. Instead of saying “the output of the function when the input is 5,” we write $f(5)$.

The letter $f$ is just a name for the function (like naming your machine). The letter $x$ inside the parentheses represents the input. When we write $f(x) = 2x + 1$, we are saying: “This function, which we call $f$, takes any input $x$ and gives back two times that input, plus one.”

Symbol What it means Example
$f$ The name of the function $f$, $g$, $h$ are common names
$x$ The input variable Also called the “argument”
$f(x)$ The output when input is $x$ Read as “f of x”
$f(3)$ The output when input is 3 Read as “f of 3”

Important: The parentheses in $f(x)$ do NOT mean multiplication. When you see $f(3)$, you do not multiply $f$ by 3. You are finding the output of function $f$ when the input is 3. This trips up a lot of people, so keep it in mind.

Domain and Range

Two fancy words you will hear a lot with functions:

  • Domain: All the possible inputs (what you can put in)
  • Range: All the possible outputs (what can come out)

Think of it like a coffee machine:

  • Domain: The buttons you can press (espresso, latte, cappuccino)
  • Range: The drinks that can come out (the same: espresso, latte, cappuccino)

For mathematical functions, the domain might be “all real numbers” or “all positive numbers” or “all numbers except zero,” depending on what makes sense for that function. For example, if your function involves dividing by $x$, then $x = 0$ cannot be in the domain because division by zero is undefined.

Four Ways to Represent a Function

Functions can be shown in different ways, and part of becoming fluent with functions is being able to move between these representations:

  1. Words: “Double the input and add one.”

  2. Equation: $f(x) = 2x + 1$

  3. Table:

$x$ (input) $f(x)$ (output)
0 1
1 3
2 5
3 7
  1. Graph: A visual picture showing all input-output pairs as points on a coordinate plane.

All four representations describe the same function. Being able to switch between them is a powerful skill.

Examples

Example 1: Evaluating a Function at a Specific Input

Given $f(x) = 3x - 2$, find $f(4)$.

Solution:

The notation $f(4)$ means “find the output when the input is 4.” We substitute 4 for $x$:

$$f(4) = 3(4) - 2 = 12 - 2 = 10$$

So when you put 4 into this function machine, 10 comes out.

In everyday terms: Imagine a job that pays $3 per hour minus a $2 daily parking fee. If you work 4 hours, you earn $3(4) - $2 = $10.

Example 2: Understanding Function Notation with a Real Scenario

A streaming service charges $12 per month. The total cost after $m$ months is given by $C(m) = 12m$. Find $C(6)$ and explain what it means.

Solution:

$$C(6) = 12(6) = 72$$

This means that after 6 months, you will have paid $72 for the streaming service.

Notice how the function uses $C$ instead of $f$ and $m$ instead of $x$. We can use any letters that make sense for the situation. Here, $C$ reminds us we are calculating cost, and $m$ reminds us the input is months.

Example 3: Building a Function from a Word Problem

A pizza place charges $8 for a plain pizza plus $1.50 for each topping. Write a function for the total cost, then find the cost of a pizza with 5 toppings.

Solution:

Let $t$ represent the number of toppings. The total cost $P(t)$ is:

$$P(t) = 8 + 1.50t$$

The base price is $8, and each topping adds $1.50.

For 5 toppings: $$P(5) = 8 + 1.50(5) = 8 + 7.50 = 15.50$$

A pizza with 5 toppings costs $15.50.

What is the domain here? Since you cannot have negative toppings or a fraction of a topping, the domain is $t = 0, 1, 2, 3, …$ (non-negative whole numbers). In practice, the pizza place probably has a maximum number of toppings too!

Example 4: Reading a Function from a Table

The table below shows the function $g(x)$. Find $g(2)$ and find the value of $x$ when $g(x) = 11$.

$x$ $g(x)$
-1 -1
0 2
1 5
2 8
3 11
4 14

Solution:

Finding $g(2)$: Look at the row where $x = 2$. The output is 8, so $g(2) = 8$.

Finding $x$ when $g(x) = 11$: Look at the $g(x)$ column for 11. It appears in the row where $x = 3$, so $x = 3$.

Bonus insight: Can you spot the pattern? Each time $x$ increases by 1, the output increases by 3. This suggests the function might be $g(x) = 3x + 2$. Check: $g(2) = 3(2) + 2 = 8$. It works!

Example 5: The Vertical Line Test

Determine whether each graph represents a function.

Graph A: A straight diagonal line going from lower-left to upper-right.

Graph B: A circle centered at the origin.

Solution:

We use the vertical line test: If any vertical line crosses the graph more than once, it is NOT a function. Why? Because that would mean one input ($x$-value) produces multiple outputs ($y$-values).

Graph A (diagonal line): Draw vertical lines anywhere. Each one crosses the line exactly once. Every $x$-value has exactly one $y$-value. This IS a function.

Graph B (circle): Draw a vertical line through the middle of the circle. It crosses the circle twice, at the top and bottom. This means for that $x$-value, there are two $y$-values. This is NOT a function.

Think about it: The circle $x^2 + y^2 = 4$ includes both $(0, 2)$ and $(0, -2)$. The input $x = 0$ gives two outputs: $y = 2$ and $y = -2$. That breaks the golden rule of functions.

Key Properties and Rules

Evaluating Functions

To evaluate $f(a)$ for any function $f(x)$:

  1. Replace every $x$ in the function rule with $a$
  2. Simplify using order of operations

$$\text{If } f(x) = x^2 - 3x + 1, \text{ then } f(5) = (5)^2 - 3(5) + 1 = 25 - 15 + 1 = 11$$

The Vertical Line Test

To determine if a graph represents a function:

  • Imagine drawing vertical lines across the entire graph
  • If every vertical line touches the graph at most once, it IS a function
  • If any vertical line touches the graph more than once, it is NOT a function

Common Function Notation

Notation Meaning
$f(x) = \text{expression}$ Define a function
$f(3)$ Find output when input is 3
$f(a + 1)$ Find output when input is $a + 1$
$f(x) = 7$ Find input(s) that give output 7

Linear Functions (Preview)

A linear function is one whose graph is a straight line. It has the form:

$$f(x) = mx + b$$

where $m$ is the slope (how steep the line is) and $b$ is the $y$-intercept (where the line crosses the $y$-axis).

Linear functions are the simplest and most common type of function. You will study them in depth in Algebra 1, but you have already seen them in our examples:

  • $f(x) = 2x + 1$ is linear with slope 2 and $y$-intercept 1
  • $C(m) = 12m$ is linear with slope 12 and $y$-intercept 0
  • $P(t) = 8 + 1.50t$ is linear with slope 1.50 and $y$-intercept 8

Real-World Applications

Cell Phone Plans

Your phone plan charges $30 per month plus $0.05 per text message. The function $C(t) = 30 + 0.05t$ gives your monthly cost based on $t$ text messages.

  • $C(0) = 30$: No texts, just the base fee
  • $C(100) = 30 + 5 = 35$: 100 texts costs $35
  • Domain: $t \geq 0$ (can’t send negative texts)
  • Range: $C \geq 30$ (minimum cost is the base fee)

Converting Temperatures

The function $F(C) = \frac{9}{5}C + 32$ converts Celsius to Fahrenheit.

  • $F(0) = 32$: Water freezes at 0 degrees C = 32 degrees F
  • $F(100) = 180 + 32 = 212$: Water boils at 100 degrees C = 212 degrees F
  • Domain: All real numbers (any temperature is possible in theory)

Calculating Tips

If you tip 20% of your bill, the tip function is $T(b) = 0.20b$ where $b$ is the bill amount.

  • $T(50) = 10$: On a $50 bill, tip $10
  • $T(75) = 15$: On a $75 bill, tip $15

Distance, Rate, and Time

If you drive at a constant 65 mph, the distance function is $D(t) = 65t$ where $t$ is time in hours.

  • $D(2) = 130$: In 2 hours, you travel 130 miles
  • $D(3.5) = 227.5$: In 3.5 hours, you travel 227.5 miles

Earnings

Your hourly wage of $15 gives you the earnings function $E(h) = 15h$ where $h$ is hours worked.

  • $E(8) = 120$: An 8-hour day earns $120
  • $E(40) = 600$: A 40-hour week earns $600

Self-Test Problems

Problem 1: If $f(x) = 5x - 3$, find $f(7)$.

Show Answer

Substitute 7 for $x$: $$f(7) = 5(7) - 3 = 35 - 3 = 32$$

Problem 2: A gym membership costs $25 to join plus $40 per month. Write a function $C(m)$ for the total cost after $m$ months, then find the cost after 8 months.

Show Answer

The function is: $$C(m) = 25 + 40m$$

After 8 months: $$C(8) = 25 + 40(8) = 25 + 320 = 345$$

The total cost is $345.

Problem 3: The table shows function $h(x)$. Find $h(4)$ and find $x$ when $h(x) = 0$.

$x$ $h(x)$
1 -6
2 -4
3 -2
4 0
5 2
Show Answer

From the table:

  • $h(4) = 0$ (look at the row where $x = 4$)
  • When $h(x) = 0$, $x = 4$ (look at the row where the output is 0)

Bonus: The pattern shows this is $h(x) = 2x - 8$.

Problem 4: Does the set of points ${(1, 3), (2, 5), (3, 7), (1, 4)}$ represent a function? Explain.

Show Answer

No, this is NOT a function.

The input $x = 1$ appears twice with different outputs: $(1, 3)$ and $(1, 4)$.

This violates the rule that each input must produce exactly one output.

Problem 5: If $g(x) = x^2 - 2x$, find $g(-3)$.

Show Answer

Substitute -3 for $x$: $$g(-3) = (-3)^2 - 2(-3)$$ $$g(-3) = 9 - (-6)$$ $$g(-3) = 9 + 6 = 15$$

Remember: $(-3)^2 = 9$ (negative times negative is positive), and $-2(-3) = 6$ (subtracting a negative is adding).

Summary

  • A function is a rule that assigns exactly one output to each input, like a reliable machine.
  • Function notation $f(x)$ represents the output of function $f$ when the input is $x$. The parentheses do NOT mean multiplication.
  • Evaluating a function means finding the output for a specific input by substituting and simplifying.
  • The domain is all possible inputs; the range is all possible outputs.
  • Functions can be represented as words, equations, tables, or graphs.
  • The vertical line test determines if a graph is a function: if any vertical line crosses the graph more than once, it is not a function.
  • Linear functions have the form $f(x) = mx + b$ and produce straight-line graphs.
  • Functions appear everywhere in real life: pricing, conversion formulas, physics, earnings, and much more.
  • Once you understand that a function is just a consistent input-output relationship, the rest is just practice and details.