Introduction to Functions

Discover the fundamental concept connecting inputs to outputs

You have been working with functions longer than you might realize. Every time you look up a price based on quantity, convert between units, or calculate how much you will earn based on hours worked, you are thinking in functions. In Algebra 1, we formalize this intuition and give you the tools to work with functions precisely. By the end of this lesson, you will see that functions are not some abstract mathematical invention but a natural way to describe how one quantity depends on another. They are everywhere, and once you learn to recognize them, you will never unsee them.

Core Concepts

What is a Function?

A function is a rule that takes an input and produces exactly one output. Think of it as a machine: you feed something in, the machine processes it according to its rule, and exactly one result comes out.

Here is the key idea: each input gives you exactly one output. The machine cannot be indecisive. If you put in 3, you get one specific answer, not two or three possibilities. This consistency is what makes functions so powerful and predictable.

Consider a simple example. Suppose your function rule is “multiply by 2 and add 1.” If you input 5, the machine multiplies by 2 (giving 10) and adds 1 (giving 11). Every single time you input 5, you will get 11. That is what makes it a function.

You already use functions constantly:

  • A vending machine: You put in a code (input), and exactly one item drops out (output). Code B4 always gives you the same snack.
  • A calculator’s square root button: You type in a positive number, and you get exactly one result.
  • A recipe: Put in 2 cups of flour, and the recipe specifies exactly how much water to add.

Relations vs. Functions

Not every relationship between inputs and outputs qualifies as a function. A relation is any pairing of inputs and outputs, but a function is a special kind of relation where each input corresponds to exactly one output.

Consider these two scenarios:

Scenario A: A student ID lookup system. You enter a student ID, and the system returns that student’s name. Each ID maps to exactly one name. This is a function.

Scenario B: A “siblings” relationship. If you input “Alex,” you might get multiple outputs: “Jordan,” “Taylor,” and “Sam” (Alex’s three siblings). One input produces multiple outputs. This is a relation but NOT a function.

The difference matters because functions give us predictability. When you know something is a function, you know that for any valid input, there is one and only one answer.

The Vertical Line Test

When you have a graph, how can you tell if it represents a function? Use the vertical line test.

Imagine drawing vertical lines (straight up and down) across the entire graph. If every vertical line you draw crosses the graph at most once, the graph represents a function. If any vertical line crosses the graph more than once, it is NOT a function.

Why does this work? A vertical line represents all points with the same $x$-value (same input). If the line crosses the graph twice, that means one $x$-value has two different $y$-values. That violates the “one input, one output” rule.

Passes the test (is a function):

  • A straight line (unless it is vertical)
  • A parabola opening upward or downward
  • A wavy line that never doubles back on itself horizontally

Fails the test (not a function):

  • A circle (vertical lines through the middle hit it twice)
  • A horizontal parabola (opens left or right)
  • Any curve that loops back on itself

Domain and Range

Every function has two important sets associated with it:

Domain: The set of all possible inputs, meaning all values you are allowed to put into the function.

Range: The set of all possible outputs, meaning all values that can come out of the function.

Think of domain as “what can go in” and range as “what can come out.”

For example, consider a function that calculates the area of a square given its side length: $A(s) = s^2$.

  • Domain: All non-negative numbers. A square cannot have a negative side length, so you cannot input negative numbers. The domain is $s \geq 0$.
  • Range: All non-negative numbers. Squaring any real number gives a non-negative result, and since we start with $s \geq 0$, the outputs are also non-negative. The range is $A \geq 0$.

Sometimes the domain is restricted by the mathematics (you cannot divide by zero or take the square root of a negative number in real numbers), and sometimes it is restricted by context (you cannot work negative hours or buy negative items).

Function Notation: $f(x)$

Function notation is a compact way to write and communicate about functions. When you see $f(x) = 2x + 1$, here is what each part means:

  • $f$ is the name of the function. We often use $f$, $g$, or $h$, but you can use any letter or even a word that makes sense in context (like $C$ for cost or $T$ for temperature).
  • $x$ inside the parentheses is the input variable, also called the independent variable.
  • $f(x)$ represents the output when you input $x$. This is also called the dependent variable because its value depends on what you input.
  • $2x + 1$ is the rule that tells you what to do with the input.

Important: The parentheses in $f(x)$ do NOT mean multiplication. When you see $f(3)$, you are not multiplying $f$ times 3. You are finding the output of the function $f$ when the input is 3.

Reading function notation aloud:

  • $f(x)$ is read as “f of x”
  • $f(3)$ is read as “f of 3”
  • $g(a + 2)$ is read as “g of a plus 2”

Evaluating Functions

To evaluate a function means to find the output for a specific input. The process is straightforward:

  1. Take the input value
  2. Substitute it for every instance of the variable in the function rule
  3. Simplify using order of operations

For example, if $f(x) = x^2 - 4x + 7$, to find $f(3)$:

$$f(3) = (3)^2 - 4(3) + 7 = 9 - 12 + 7 = 4$$

The input was 3, and the output is 4.

Finding Domain from Equations and Context

When you are given a function as an equation, ask yourself: “What values can I legally put in?”

Mathematical restrictions:

  • Cannot divide by zero: If your function has $\frac{1}{x}$, then $x = 0$ is excluded from the domain.
  • Cannot take the square root of a negative (in real numbers): If your function has $\sqrt{x}$, then $x$ must be non-negative.

Contextual restrictions:

  • Time cannot be negative: If $t$ represents time, typically $t \geq 0$.
  • Counting numbers must be whole: If $n$ represents the number of people, $n$ must be a positive integer.
  • Physical limits: The number of items might be capped by inventory.

Representing Functions

Functions can be expressed in four main ways, and being able to translate between them is a key skill:

1. Words (verbal description): “Triple the input and subtract five.”

2. Equation (algebraic formula): $f(x) = 3x - 5$

3. Table (list of input-output pairs):

$x$ $f(x)$
0 -5
1 -2
2 1
3 4

4. Graph (visual representation): A coordinate plane showing the points and the line connecting them.

Each representation has its strengths. Equations are precise and general. Tables show specific values clearly. Graphs reveal overall patterns and behavior. Verbal descriptions connect math to meaning.

Notation and Terminology

Term Meaning Example
Function Rule assigning each input exactly one output $f(x) = 2x + 1$
Domain Set of all possible inputs $x \geq 0$
Range Set of all possible outputs $y > -3$
$f(x)$ “f of x” - the output when input is $x$ If $f(x) = x^2$, then $f(3) = 9$
Independent variable The input (usually $x$) In $f(x) = 2x$, the variable $x$ is independent
Dependent variable The output (usually $y$ or $f(x)$) The output depends on what $x$ you choose

Examples

Example 1: Determining if a Relation is a Function

Is the relation ${(1, 2), (3, 4), (1, 5)}$ a function?

Solution:

Look at the inputs (first numbers in each pair): 1, 3, and 1.

The input 1 appears twice: once paired with output 2, and once paired with output 5.

This means the input 1 produces two different outputs (2 and 5). A function requires each input to produce exactly one output.

Answer: No, this is NOT a function because the input 1 has two different outputs.

Contrast: The relation ${(1, 2), (3, 4), (5, 2)}$ IS a function. Even though the output 2 appears twice, each input (1, 3, and 5) appears only once. Different inputs can share the same output; we just cannot have one input giving multiple outputs.

Example 2: Evaluating a Function

If $f(x) = 2x - 1$, find $f(3)$.

Solution:

The notation $f(3)$ asks: “What is the output when the input is 3?”

Substitute 3 for $x$ in the function rule:

$$f(3) = 2(3) - 1$$ $$f(3) = 6 - 1$$ $$f(3) = 5$$

Answer: $f(3) = 5$

In context: Think of this as a machine that doubles whatever you give it, then subtracts 1. You gave it 3, so it doubled to 6, then subtracted 1 to get 5.

Example 3: Finding Domain and Range from a Graph

A graph shows a line segment starting at the point $(-2, 1)$ and ending at the point $(4, 7)$, including both endpoints.

Find the domain and range.

Solution:

Domain (all $x$-values covered): The line segment starts at $x = -2$ and ends at $x = 4$. Since both endpoints are included, the domain is: $$-2 \leq x \leq 4$$

Range (all $y$-values covered): The line segment starts at $y = 1$ and ends at $y = 7$. The line is going upward from left to right, so all $y$-values between 1 and 7 are covered: $$1 \leq y \leq 7$$

Answer: Domain: $[-2, 4]$ or $-2 \leq x \leq 4$. Range: $[1, 7]$ or $1 \leq y \leq 7$.

Key insight: For domain, look at how far left and right the graph extends (the $x$-values). For range, look at how far up and down the graph extends (the $y$-values).

Example 4: Evaluating a Function with a Negative Input

If $g(x) = x^2 - 4$, find $g(-2)$.

Solution:

Substitute $-2$ for $x$:

$$g(-2) = (-2)^2 - 4$$

Remember: $(-2)^2$ means $(-2) \times (-2) = 4$ (negative times negative is positive).

$$g(-2) = 4 - 4$$ $$g(-2) = 0$$

Answer: $g(-2) = 0$

Common mistake to avoid: Do not confuse $(-2)^2$ with $-2^2$. The first is $(-2)(-2) = 4$. The second is $-(2^2) = -4$. When the negative is inside the parentheses, it gets squared too.

Example 5: Writing a Function from Context and Stating the Domain

A parking garage charges $5 for the first hour and $2 for each additional hour (or any part of an hour). Write a function $P(h)$ for the parking cost based on $h$ hours, and state the domain in this context.

Solution:

Understanding the pricing:

  • First hour: $5 (this is the base charge)
  • Additional hours: $2 each

If you park for $h$ hours where $h \geq 1$:

  • You pay $5 for the first hour
  • You pay $2 for each of the remaining $(h - 1)$ hours

Building the function:

$$P(h) = 5 + 2(h - 1)$$

Simplifying: $$P(h) = 5 + 2h - 2$$ $$P(h) = 2h + 3$$

Verifying:

  • $P(1) = 2(1) + 3 = 5$ (just the first hour)
  • $P(2) = 2(2) + 3 = 7$ (first hour at $5 plus one additional hour at $2)
  • $P(3) = 2(3) + 3 = 9$ (first hour at $5 plus two additional hours at $4)

These match our expectations.

Domain:

  • You must park for at least some time, so $h > 0$
  • The garage charges by the hour (or part of an hour), and typically has a maximum stay. Assuming no maximum, and since they charge for partial hours: $h > 0$
  • If the problem specifies whole hours only: $h = 1, 2, 3, …$

Answer: $P(h) = 2h + 3$ with domain $h \geq 1$ (assuming you must pay for at least the first hour).

Note: Real parking structures often have more complex pricing. The key skill here is translating a word description into a function and recognizing what inputs make sense.

Key Properties and Rules

The Function Rule

For a relation to be a function, every input must have exactly one output. Remember:

  • One input, multiple outputs: NOT a function
  • Multiple inputs, same output: Still a function
  • One input, one output: Function

Evaluating Functions Step by Step

Given $f(x) = \text{expression}$, to find $f(a)$:

  1. Write the expression
  2. Replace every $x$ with $a$ (use parentheses!)
  3. Simplify using order of operations

Example: If $f(x) = 3x^2 - x + 2$, find $f(-1)$: $$f(-1) = 3(-1)^2 - (-1) + 2 = 3(1) + 1 + 2 = 6$$

Domain Restrictions to Watch For

Expression Type Restriction Example
Division Denominator cannot be zero $\frac{1}{x-3}$: domain excludes $x = 3$
Square root Radicand must be non-negative $\sqrt{x+5}$: domain is $x \geq -5$
Context Must make physical sense Hours worked: $h \geq 0$

The Vertical Line Test

To check if a graph represents a function:

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

Real-World Applications

Vending Machines

A vending machine perfectly illustrates function behavior. Each button code (A1, A2, B1, etc.) corresponds to exactly one item. You press A3, you get pretzels. Always. If one button sometimes gave you chips and sometimes gave you soda, the machine would be broken. Functions work the same way: reliable, consistent, predictable.

Converting Units

The formula $K(m) = 1.609m$ converts miles to kilometers. Input 10 miles, output 16.09 kilometers. This function has:

  • Domain: All non-negative numbers (distance cannot be negative)
  • Range: All non-negative numbers

Calculating Area from Dimensions

The area of a circle given its radius is $A(r) = \pi r^2$. Every radius value corresponds to exactly one area. A circle with radius 5 has area $25\pi$. Always. This function has:

  • Domain: $r > 0$ (radius must be positive)
  • Range: $A > 0$ (area must be positive)

Cell Phone Plans

A phone plan charging $35 per month plus $0.10 per text gives the cost function $C(t) = 35 + 0.10t$ where $t$ is the number of texts.

  • $C(0) = 35$: No texts, just the base fee
  • $C(200) = 55$: 200 texts costs $55
  • Domain: $t \geq 0$, and $t$ is a whole number
  • Range: $C \geq 35$

This function helps you predict your bill and understand your spending patterns.

Self-Test Problems

Problem 1: If $f(x) = 4x + 3$, find $f(5)$.

Show Answer

Substitute 5 for $x$: $$f(5) = 4(5) + 3 = 20 + 3 = 23$$

Problem 2: Is the relation ${(2, 4), (3, 6), (4, 8), (5, 10)}$ a function? Explain.

Show Answer

Yes, this IS a function.

Each input (2, 3, 4, 5) appears exactly once and maps to exactly one output. No input is repeated with different outputs.

Bonus: This function follows the rule “multiply by 2” or $f(x) = 2x$.

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

Show Answer

Substitute $-4$ for $x$: $$g(-4) = (-4)^2 + 2(-4) - 3$$ $$g(-4) = 16 + (-8) - 3$$ $$g(-4) = 16 - 8 - 3$$ $$g(-4) = 5$$

Problem 4: A taxi charges $3.50 for pickup plus $2.25 per mile. Write a function $T(m)$ for the total fare after $m$ miles. What is the fare for a 7-mile trip?

Show Answer

The function is: $$T(m) = 3.50 + 2.25m$$

For a 7-mile trip: $$T(7) = 3.50 + 2.25(7) = 3.50 + 15.75 = 19.25$$

The fare is $19.25.

Domain: $m \geq 0$ (cannot travel negative miles)

Problem 5: For the function $f(x) = \frac{x+1}{x-2}$, what value(s) must be excluded from the domain?

Show Answer

We cannot divide by zero, so we need $x - 2 \neq 0$.

Solving: $x \neq 2$

The value $x = 2$ must be excluded from the domain.

Domain: All real numbers except $x = 2$.

Problem 6: Does a circle pass the vertical line test? Explain what this tells us.

Show Answer

No, a circle does NOT pass the vertical line test.

If you draw a vertical line through the center of a circle, it crosses the circle at two points (the top and the bottom).

This tells us that a circle is NOT a function. For the $x$-value at the center, there are two corresponding $y$-values. One input, two outputs, violates the function rule.

Summary

  • A function is a rule that assigns exactly one output to each input. Think of it as a consistent, predictable machine.
  • A relation is any pairing of inputs and outputs. A function is a special type of relation where no input has multiple outputs.
  • The vertical line test determines whether a graph represents a function: if any vertical line crosses the graph more than once, it is not a function.
  • The domain is the set of all possible inputs; the range is the set of all possible outputs.
  • Function notation $f(x)$ represents the output of function $f$ when the input is $x$. The parentheses do NOT mean multiplication.
  • To evaluate a function, substitute the input value for the variable and simplify.
  • Domain restrictions come from mathematics (no division by zero, no square roots of negatives) and from context (no negative time, no fractional people).
  • Functions can be represented as equations, tables, graphs, or verbal descriptions. Fluency means moving comfortably between all four.
  • Functions appear everywhere: pricing formulas, unit conversions, area calculations, scientific relationships, and countless everyday situations.
  • The concept of a function is foundational to all of algebra. Once you understand functions, you have a framework for understanding how quantities relate to each other throughout mathematics and beyond.