Basics of Functions in Algebra

05 min read

Functions versus relations
A “relation” is just a relationship between sets of information. Think of all the people in one of your classes, and think of their weights. The pairing of names and weights is a relation. In relations, the pairs of names and weights are “ordered”, which means one comes first and the other comes second. To put it another way, we could set up this pairing so that either you give me a name, and then I give you that person’s weight, or else you give me a weight, and I give you the names of all the people with that weight.

A relation can be defined as a set of ordered pairs. The sets of ordered pairs A = {(3, 2), (5, 7), (1, 0), (10, 3)} and B = {(3, 5), (3, -1), (2, 9)} are examples of a relation.

The set of all the starting points is called the domain and the set of all the ending points is called the range. The domain is what you start with – the input. The range is what you end up with – the output. In terms of ordered pairs, domain is the first component of each pair, and range is the second component of each pair. In the above example, the domain and range of set A is {3, 5, 1, 10} and {2, 7, 0, 3} respectively.

A function is a “well-behaved” relation i.e. for a given input, there can be exactly one and only one output. Let’s look at our relation of your classmates and their weights, and let’s suppose that the 0domain is the set of everybody’s weights. In this case, there is a possibility that more than one person can be of a given weight. The relation “weight indicates name” is not well-behaved. Hence, it is not a function. If the domain is the set of everybody’s name, then the relation “name indicates weight” is well-behaved because a person cannot have two different weights at the same time. Hence, this relation is a function. This means that, while all functions are relations, not all relations are functions.

In other words, a function is a special type of relation where no two ordered pairs have the same first element and a different second element i.e. for a function, corresponding to each first element of the ordered pairs, there must be a different second element. In the above example, set B is not a function because the ordered pairs (3, 5) and (3, -1) have the same first element, but different second element. Set A is a function because no two ordered pairs have the same first element and different second element.

Independent and dependent variables
A rule that defines the function specifies one variable (quantity) in terms of the other variable (quantity). The one with which the rule starts – its input – is called the independent variable; and the other, the one that the rule produces – its output – is called the dependent variable.

Let’s consider the formula A = πr2, which is used to find the area of the circle with radius ‘r’. The area of the circle will change based on its radius. Here, the variable ‘r’ is the independent variable and the variable ‘A’ is the dependent variable.

Odd and even functions
If f(x) = f(-x) for all x in the domain, then the function is called an even function. For example, f(x) = x2.
If f(x) = - f(-x) for all x in the domain, then the function is called an odd function. For example, f(x) = x3.

Composition of functions
If f and g are any two functions, then the function fog or gof is called the composition of two functions. The small circle o in gof denotes the composition of g and f.
(gof) (x) = g(f(x)) and (fog) (x) = f(g(x))
For example, if f(x) = x2 + 1 and g(x) = x – 1, then the composition of two functions gof and fog are:
(gof) (x) = g(f(x)) = g(x2 + 1) = (x2 + 1) – 1 = x2
(fog) (x) = f(g(x)) = f(x – 1) = (x - 1)2 + 1 = x2 – 2x + 2

Inverse of a function
If fog = gof = I, then g is called the inverse of f i.e. f -1. Inverse of a function exists only if the range of a function is equal to the co-domain of the function. I is the identity function i.e. f(x) = x for all domain values.

For example, inverse of the function f(x) = 2x + 1 can be determined as detailed below.
Let y = f(x)
⇒ y = 2x + 1
Write x in terms of y
⇒ x = (y - 1)/2
Interchange the variables x and y
⇒ y = (x – 1) / 2
Therefore, f-1(x) = (x – 1)/2

Vertical line test
If no vertical line can be drawn so that it intersects a graph more than once, then it is a graph of a function. Consider the following graphs y = x2 and y2 = x.

In the graph of y2 = x, the vertical line passes through two points, whereas in the graph of y = x2, the vertical line passes through only one point. Hence, the graph of y = x2 is a graph of a function.

Domain and Range of certain functions