A function is a mathematical relation that assigns a unique output to each input. It is often written as f(x), where x is the input, and f(x) is the corresponding output. In other words, for every value of x in the domain, there is exactly one corresponding value of f(x) in the range.
Domain of a Function:
The domain of a function is the set of all possible input values (x-values) for which the function is defined. In other words, it consists of all the values of x that can be substituted into the function without causing any undefined behavior (like division by zero or taking the square root of a negative number).
Range of a Function:
The range of a function is the set of all possible output values (f(x)-values) that the function can produce when all the values from the domain are applied. It consists of all the possible values that the function can take for the corresponding inputs in the domain.
Examples:
Example 1: Consider the function f(x) = 2x + 3.
Domain: The function is defined for all real numbers because there are no restrictions (like division by zero or negative square roots). So, the domain is all real numbers, written as (-∞, ∞).
Range: Since f(x) is a linear function with no restrictions, its range is also all real numbers, written as (-∞, ∞).
Example 2: Consider the function f(x) = 1/x.
Domain: This function is undefined when x = 0 because division by zero is not allowed. So, the domain is all real numbers except 0, written as (-∞, 0) ∪ (0, ∞).
Range: For the function f(x) = 1/x, as x approaches 0, f(x) becomes infinitely large or small, but it can never be 0. Therefore, the range is all real numbers except 0, written as (-∞, 0) ∪ (0, ∞).
Example 3: Consider the function f(x) = √(x).
Domain: Since the square root of a negative number is not defined in the real number system, the domain of this function is x ≥ 0. So, the domain is [0, ∞).
Range: The square root function produces non-negative values. Therefore, the range is also [0, ∞).