# Algebra: Functions Explained

In mathematics, a function relates to an output that resulted from an input. It is like in computer science when you learn about input and output devices and the relationship between both. For example, you put in an input into the computer in the form of instructions, and it resulted in an output in the form of a printed document. In the real world context, other ways in which the concept of functions occurs it in factories where you have large machineries. The machines work in the same context of input and output.

A function is usually denoted by “*f*(x) =…” , the *f*, is not unique and any letter can be used.

A function has three main parts:

**The input****The relationship****The output**

Example: “Multiply by 4” is a very simple function you can grasp.

Input = 5, Relationship = × 4, Output = 20.

Consider this: For an input at 40 what is the output?

Examples of functions

*f*(*x*) = *x*^{2} + 3

*g*(*x*) = 2*x* – 7

The above definition of a function is considered as the basic understandable definition. It goes deeper. A function may also be considered as a relation that uniquely maps one member of a domain unto another member of a range which is a subset of a codomain. This means, if you have a function which maps set A to B, it is an object *f* such that is mapped onto one or more members of the range such that. The range is part of a codomain. This means that a function can be a *many to one* or *one to one* relation. If you have a *one to many* relation that is not a function. Let us look at range, domain and codomain to get a better understanding of the aforementioned definition. But first let us look at *one to one* and *one to many* mapping.

Understanding the difference between the range and the codomain is very critical. It even becomes more critical when doing further math such as pre-calculus where a function is undefined.

**Example 1**

What is the domain and range of the function: *f*(*x*) = 2*x*^{2} + 6?

To answer this question, you need to think about all the possible values than can be inputted into the function and get an output. By looking at the function you realize than any real number can be placed into the function to produce an output. Also, you may also realize that the set of integers can also be used. If you use any random integer for example -3, you can check

Thus *f*(-3) = 2(-3)^{2} + 6

= 2(9) + 6

= 18 + 6

= 22

You may also notice that all the output for the set of real numbers will be the same for the set of integers because of the *x*^{2}. Therefore the domain is the set of integers. Since the set of real numbers is a subset of the set of integers, we can exclude it. Note that the domain does not have one set definition, because it could also be the set of counting number, whole numbers, etc. However for the range, you will never get a negative output, so the range could never be the set of integers, but it could possibly be the set of even numbers, however the range is the set {8, 14, 22…}. Though the question didn’t ask, but the codomain could be the set of counting numbers, since the output could be any possible counting number.

**Evaluating Functions**

Evaluating functions is quite simple, all you need to do, if plug in the value that is given, substitute the value for I, then solve the equation.

**Example 2**

Function *f* is defined by

*f*(x) = – 2*x*^{2} + 6*x* – 3, find f(- 2).

What you do in this instance, you substitute -2 for ‘*x*’ in the function then solve

= -2(-2)^{2} + 6(-2) – 3

= -2(4) – 12 – 3

= -4 – 12 – 3

= – 19

** **

**Example 3**

Two functions *f* and *g* is defined by

*f*(*x*) = 2*x* + 7 and *g*(*x*) = -5*x* – 3, find (*f* + *g*)(*x*).

When you look at the question it might seem hard, but it is quite simple. You may note that (*f* + *g*)(*x*) denotes is the product of two numbers ideally. It can be expanded as such

(*f + g*)(*x*) = *f(x)* + *g*(*x*). As such, this is in a form that we can understand therefore it is:

*f*(*x*) + *g*(*x*) = (2*x* + 7) + (-5*x *– 3). Note: the brackets are there to show the two distinct functions

2*x* + 7 – 5*x* – 3 by grouping like terms”

2*x* – 5*x *+ 7 – 3

= – 3*x* + 4

Therefore (*f + g*)(*x*) = – 3*x* + 4

**Example 4**

Two functions *f* and *g* is defined by

*f*(*x*) = 2*x*^{2} – 3*x* and *g*(*x*) = *x* + 1, find *f* (*g)*(-3).

What you see above is called a function of a function. It is quite easier than it looks. What is means that wherever you see *x* in function *f*, you are going to plug put the *g* function then plug in -3. Therefore:

*f* (*g)*(*x*) = 2(*x + 1*)^{2} – 3(*x + 1*). Thus, we first put the *g *function in the *f* function. Now we evaluate for:

*f* (*g)*(-3) = 2(-3* + 1*)^{2} – 3(-3* + 1*)

= 2(-2)^{2} – 3(-2)

= 2(4) + 6

= 8 + 6

= 14

Therefore *f* (*g)*(-3) = 14

If we were not asked to evaluate *f* (*g)*(-3), but just find *f* (*g)*(*x*)

The answer would just be: 2(*x + 1*)^{2} – 3(*x + 1*).

You may also note that a function can be graphed and in that context, the *x* is the domain and *y* is the range so sometimes you will see that *f*(x) = *y*. And as such you see functions such as:

y = 3*x*^{3} + 4*x*^{2} + *x* +3

**Range, Domain and Codomain**

The first diagram represents a *one to one* mapping, where each element of X maps exactly onto one Element of Y. The second diagram represents a *one to many* mapping where one element of X maps onto one of more element of Y.

A ** domain** is simply

**the possible values that can be inputted into a function to produce an output.**

*all*The ** range** is simply

**the output of a function.**

*all*The ** codomain** is

**the possible outcomes or output from a function.**

*all*