3.1 Function Definition, Domain, Range, and Piecewise Functions

Key Takeaways

  • A relation is a function if and only if each input x in the domain maps to exactly one output y in the range (passing the Vertical Line Test graphically).
  • The domain of an algebraic function is the set of all real numbers except those that cause division by zero, negative radicands under even roots, or non-positive arguments in logarithms.
  • The range of a function represents the complete set of output values y = f(x), determined algebraically through inequality analysis or graphically by observing vertical span.
  • Piecewise functions are evaluated by identifying which interval rule applies to the given input x, paying special attention to strict vs. non-strict inequalities at boundary points.
Last updated: August 2026

3.1 Function Definition, Domain, Range, and Piecewise Functions

1. Fundamentals of Relations and Functions

In precalculus and higher-level mathematics, a relation is any set of ordered pairs $(x, y)$ that associates elements from a domain set $X$ to a range set $Y$. A function $f$ is a special type of relation in which each input element $x$ in the domain is paired with exactly one output element $y$ in the range.

We express this relationship using function notation: y=f(x)y = f(x) where $x$ represents the independent variable (the input) and $y$ represents the dependent variable (the output).

Domain (Inputs x)  --->  [ Function f ]  --->  Range (Outputs y = f(x))

The Vertical Line Test (VLT)

Graphically, a curve in the Cartesian coordinate plane represents a function of $x$ if and only if no vertical line intersects the graph at more than one point. If a vertical line touches the graph at two or more points, then a single input $x$ corresponds to multiple outputs $y$, violating the definition of a function.

Relation TypeGraphical FeatureFunction?Example
FunctionEvery vertical line intersects at most onceYes$f(x) = x^2 - 4x + 3$, $f(x) =
Non-FunctionAt least one vertical line intersects twice or moreNoCircle $x^2 + y^2 = 25$, Sideways parabola $x = y^2$

2. Algebraic Determination of Domain

The domain of a real-valued function $f(x)$ is the set of all real numbers $x$ for which the expression $f(x)$ evaluates to a real number. Unless an explicit restricted domain is stated in a problem context, we assume the domain is the implied (natural) domain—the largest subset of $\mathbb{R}$ for which the formula is mathematically valid.

To find the domain algebraically, search for the three primary domain restrictions in algebra:

Three Core Domain Restriction Rules

  1. Rational Expressions (Division by Zero): If $f(x) = \frac{g(x)}{h(x)}$, set the denominator unequal to zero: $h(x) \neq 0$.
  2. Even Radicals (Negative Radicands): If $f(x) = \sqrt[n]{g(x)}$ where $n$ is an even integer ($2, 4, 6, \dots$), set the radicand non-negative: $g(x) \ge 0$. (Note: odd roots like $\sqrt[3]{x}$ accept all real numbers).
  3. Logarithmic Arguments (Non-positive Inputs): If $f(x) = \log_b(g(x))$, set the argument strictly positive: $g(x) > 0$.

Combining Multiple Restrictions

When a function contains combinations of fractions, roots, and logarithms, the domain is the intersection (overlap) of the intervals satisfying all individual constraints.

Worked Example 2.1A: Determining Domain of a Complex Function

Determine the domain of the function $f(x) = \frac{\sqrt{3x + 12}}{x^2 - 4x - 5}$.

Step 1: Set up the even root inequality. The radicand under the square root must be non-negative: 3x+120    3x12    x43x + 12 \ge 0 \implies 3x \ge -12 \implies x \ge -4 In interval form, this is $[-4, \infty)$.

Step 2: Set up the rational denominator restriction. The denominator cannot equal zero: x24x50    (x5)(x+1)0    x5 and x1x^2 - 4x - 5 \neq 0 \implies (x - 5)(x + 1) \neq 0 \implies x \neq 5 \text{ and } x \neq -1

Step 3: Intersect the restrictions. We begin with $x \ge -4$ and remove the excluded points $x = -1$ and $x = 5$. Domain: [4,1)(1,5)(5,)\text{Domain: } [-4, -1) \cup (-1, 5) \cup (5, \infty)


3. Determining the Range of a Function

The range of a function $y = f(x)$ is the set of all real values $y$ produced as $x$ varies over the entire domain. Determining range algebraically requires analyzing output bounds or solving for $x$ in terms of $y$.

Algebraic Range Techniques

  1. Solving for $x$ (Rational Functions): To find the range of a linear rational function $y = \frac{ax+b}{cx+d}$, solve the equation for $x$ and determine which $y$-values make $x$ a real number.
  2. Analysis of Non-Negative Terms: Square terms ($x^2 \ge 0$), absolute values ($|x| \ge 0$), and square roots ($\sqrt{x} \ge 0$) establish natural lower bounds on outputs.

Worked Example 2.1B: Range of a Rational Function

Find the range of $f(x) = \frac{5x + 2}{x - 3}$.

Step 1: Set $y = f(x)$ and clear fractions. y=5x+2x3    y(x3)=5x+2    yx3y=5x+2y = \frac{5x + 2}{x - 3} \implies y(x - 3) = 5x + 2 \implies yx - 3y = 5x + 2

Step 2: Isolate $x$ terms on one side. yx5x=3y+2    x(y5)=3y+2    x=3y+2y5yx - 5x = 3y + 2 \implies x(y - 5) = 3y + 2 \implies x = \frac{3y + 2}{y - 5}

Step 3: Identify restrictions on $y$. For $x$ to exist as a real number, the denominator $y - 5$ cannot be zero. Thus, $y \neq 5$. Range: (,5)(5,)\text{Range: } (-\infty, 5) \cup (5, \infty)


4. Piecewise-Defined Functions

A piecewise-defined function is a function defined by different sub-formulas applied to distinct sub-domains (intervals) of input values: f(x)={formula1if xinterval1formula2if xinterval2formula3if xinterval3f(x) = \begin{cases} \text{formula}_1 & \text{if } x \in \text{interval}_1 \\ \text{formula}_2 & \text{if } x \in \text{interval}_2 \\ \text{formula}_3 & \text{if } x \in \text{interval}_3 \end{cases}

Evaluating Piecewise Functions

To evaluate $f(c)$ for a constant $c$:

  1. Locate which interval contains $x = c$.
  2. Substitute $x = c$ only into the formula designated for that specific interval.

Worked Example 2.1C: Evaluating and Analyzing a Piecewise Function

Given $g(x) = \begin{cases} 4 - x^2 & \text{if } x < 1 \ 2x + 1 & \text{if } 1 \le x \le 4 \ \frac{18}{x} & \text{if } x > 4 \end{cases}$

Evaluate: (a) $g(-3)$, (b) $g(1)$, (c) $g(6)$.

  • For $g(-3)$: Since $-3 < 1$, use formula 1: $g(-3) = 4 - (-3)^2 = 4 - 9 = -5$.
  • For $g(1)$: Since $1$ satisfies $1 \le x \le 4$, use formula 2: $g(1) = 2(1) + 1 = 3$.
  • For $g(6)$: Since $6 > 4$, use formula 3: $g(6) = \frac{18}{6} = 3$.

5. CLEP Precalculus Exam Traps

Common TrapIncorrect AssumptionCorrect Mathematical Rule
Boundary Point MisinterpretationEvaluating a boundary point in the wrong inequalityCheck whether boundary signs are strict ($<$ or $>$) or non-strict ($\le$ or $\ge$).
Even Root DenominatorsSetting $g(x) \ge 0$ for $f(x) = \frac{1}{\sqrt{g(x)}}$If an even root is in the denominator, set $g(x) > 0$ strictly (excluding zero).
Canceling DiscontinuitiesClaiming $f(x) = \frac{x^2-9}{x-3}$ has domain $\mathbb{R}$ because it simplifies to $x+3$Domain must be determined before simplifying algebraic expressions ($x \neq 3$).
Test Your Knowledge

What is the domain of the function f(x) = \sqrt{2x + 8} / (x^2 - 9) in interval notation?

A
B
C
D
Test Your Knowledge

Given the piecewise function g(x) = 3 - x^2 if x < 2; 2x - 5 if 2 <= x <= 6; |x - 8| if x > 6. What is the value of g(2) + g(7)?

A
B
C
D
Test Your Knowledge

Which of the following sets of ordered pairs represents a function?

A
B
C
D
Test Your Knowledge

What is the range of the rational function f(x) = (4x - 1) / (x + 2)?

A
B
C
D