A function is one of the most fundamental concepts in mathematics. Think of it as a special machine or rule that takes an input and produces exactly one output. The formal definition states that a function f from set A to set B assigns to each element in set A exactly one element in set B. This diagram shows how each input element has exactly one arrow pointing to an output element, which is the key characteristic that makes this relation a function.
Understanding the components of a function is crucial. The domain is the set of all possible input values, shown here in blue. The codomain is the set of all possible output values, shown in red. The range is the subset of the codomain that contains only the actual outputs produced by the function, highlighted in green. Notice that not every element in the codomain needs to be used. The notation f from R to R indicates a function from the real numbers to the real numbers, specifying both domain and codomain.
Mathematical notation provides different ways to express the same function. The most common is f of x equals 2x plus 1, which shows the function name and its rule. Arrow notation uses x maps to 2x plus 1, emphasizing the transformation. Set notation defines the function as a set of ordered pairs. To evaluate a function, we substitute the input value for x. For example, f of 3 equals 2 times 3 plus 1, which equals 6 plus 1, giving us 7. This process shows how the function machine transforms input 3 into output 7.
Functions come in many different forms. A linear function like f of x equals 2x plus 1 creates a straight line. When we evaluate f at 0, we get 1, and f at 2 gives us 5. A quadratic function such as g of x equals x squared minus 4 forms a parabola. Here g of 0 equals negative 4, and g of 3 equals 5. Piecewise functions have different rules for different input ranges. This function h of x equals x plus 1 when x is greater than or equal to 0, and negative x when x is less than 0. These examples show how functions can model various mathematical relationships and real-world situations.
Understanding the difference between functions and relations is crucial. A relation is any set of ordered pairs, but a function is a special type of relation where each input has exactly one output. The vertical line test helps us determine if a graph represents a function. If any vertical line intersects the graph more than once, it's not a function. The linear graph shown passes the test because each vertical line intersects it at most once, making it a valid function. However, the circle fails the test because a vertical line through the center intersects it at two points, meaning one input has two outputs, which violates the function definition.