Sub topic 2
Testing graphs with the vertical line test
This chapter assumes you can plot points on the coordinate plane, solve linear equations and inequalities, and simplify expressions with square roots. You will test whether a graph represents a function, then describe its domain and range in interval notation.
The vertical line test
A graph represents a function when each input x has exactly one output y. Geometrically, every vertical line must cross the graph at most once.
A circle fails this test because a vertical line through its middle meets it twice. A line such as y = 2x + 1 passes everywhere.
Writing sets in interval notation
Interval notation writes a set of real numbers as its endpoints. A square bracket includes an endpoint, and a parenthesis excludes it. Infinity always takes a parenthesis because no set can contain it. The set of x with 2 ≤ x < 5 is written [2, 5). Two sets joined by the union symbol ∪ combine into one expression. For example, (-∞, 2) ∪ (2, ∞) describes every real number except 2.
Domain: the allowed inputs
The domain is the set of inputs x that produce a real output. For an equation, exclude any x that makes a denominator zero or puts a negative number under an even root.
For g(x) = √(x − 2) / (x − 5), require x − 2 ≥ 0 and x − 5 ≠ 0. The domain is [2, 5) ∪ (5, ∞).
import math
def g(x):
if x < 2 or x == 5:
raise ValueError("x is outside the domain of g")
return math.sqrt(x - 2) / (x - 5)
print(g(3)) # -0.5
print(g(6)) # 2.0Range: the outputs that occur
The range is the set of outputs y that the function actually produces. On a graph, read the lowest and highest y-values the curve reaches. For y = x², every output is 0 or greater, so the range is [0, ∞). The domain of y = x² is all real numbers, written (-∞, ∞).
Exercise
State the domain of f(x) = 1 / (x − 4) in interval notation.
Show answer
The denominator cannot be zero, so x ≠ 4. The domain is (-∞, 4) ∪ (4, ∞).