Sub topic 3
Finding the Domain from an equation
This chapter assumes you can solve linear inequalities, factor simple expressions, and read a coordinate graph. You should also know that a square root of a negative number is not a real number.
Finding the domain from an equation
The domain is the set of inputs that produce a real output. For an equation, exclude any input that makes a denominator zero or puts a negative number under an even root.
For g(x) = sqrt(x - 2) / (x - 5), the root requires x - 2 >= 0, so x >= 2. The denominator requires x != 5. The domain is [2, 5) together with (5, infinity).
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(6)) # 2.0
print(g(3)) # -0.5Finding the range from a graph or an equation
The range is the set of outputs that actually occur. For f(x) = x^2, every output is 0 or greater, so the range is [0, infinity). On a graph, look at the lowest and highest y-values the curve reaches.
When the context limits the domain
A real-world model can exclude inputs that the equation allows. If C(n) = 12n gives the cost of n tickets, n must be a whole number from 0 up to the number of tickets sold.
Piecewise functions and their domains
A piecewise function uses different rules on different intervals. Its domain is the union of the intervals where each rule applies. For p(x) = x + 1 when x < 0, and p(x) = x^2 when x >= 0, the domain is all real numbers.
The domain of a composite function
For f(g(x)), the domain includes x values in the domain of g, and g(x) must lie in the domain of f. For f(x) = 1 / (x - 1) and g(x) = sqrt(x), f(g(x)) = 1 / (sqrt(x) - 1). The root requires x >= 0. The denominator requires sqrt(x) != 1, so x != 1. The domain is [0, 1) together with (1, infinity).
Exercise
What is the domain of k(x) = 1 / (x + 4), written in interval notation?
Show answer
The denominator cannot be zero, so x != -4. The domain is (-infinity, -4) together with (-4, infinity).