Understanding Math Functions


Back in elementary mathematics, you would start off with a function such as:

y = x + 2.

When you wanted to find the value of y when x  is 2, you replace or substitute x  with 2 and add 2 + 2 to get y  = 4. If the variable x  is -1 for example, then y  is equal to (-1 + 2) = 1.

Introducing the Function Notation

The function notation is a more convenient way of relating the independent variable x to the dependent variable y.

Instead of y = x + 2, we would have:

    \[f(x) = x + 2\]


The variable y is now replaced by f(x). My independent variable is x and the dependent variable y  depends on the value of x . So when using the x values 2 and -1 in the function f(x), we get:

f(2) = 2 + 2 = 4            &             f(-1) = -1 + 2 = 1  respectively.

Think of a function as a machine like this:

Input      \longrightarrow          Function / Machine         \longrightarrow          Output

The function takes an input x , does some computations, and outputs a corresponding value f(x) for that x  value. (A similar statement can be made when explaining a function to a beginning programming student.)

The variable x is a common independent variable. Other independent variables include t  (represents time), h  (height), or one of your choice.

Note that a function can have different inputs or x  values producing the same output. (E.g. -1 and +1 in f(x) = x^2 outputs 1).

Let’s say we have another function such as f(x) = \dfrac{1}{x + 3}. When substituting x = 1, we get f(1) = \dfrac{1}{1 + 3} = \dfrac{1}{4} so f(1) is 0.25. One could ask, couldn’t I have used the f(x) = x + 2 from before? The answer is yes.

To avoid confusion, one can name functions differently. We should use a different letter such as g and rename the f(x) = \dfrac{1}{x + 3} function as g(x) = \dfrac{1}{(x + 3)}. Then g(1) = 0.25 as done earlier.

Domain and Range

Notice that in g(x), we would have the dreaded division by zero if x  is equal to -3. The function is not defined at x = -3. We say that the the domain for x  is all real numbers except for x = -3 since we can use any x-value except -3. In notation, that is x \neq -3.

The range for g(x) is all values that g(x) can take on given the permissible values of x  or the domain of g(x) (in this example). For g(x), the range is all y  values except for 0. In notation, that is y \neq 0.

Instead of the input, machine, output diagram model, we can now have it as:

Domain (Input)             \longrightarrow          Function (Machine)         \longrightarrow        Range (Output)

Simple Example

Suppose we have h(x) = x^2.

Domain: There is no restriction on x  or x  can take on all real numbers or x \in \Re.

Range: Squaring any real number gives a non-negative number. The function h(x) will be 0 or positive. In notation we have h(x) \geq 0.

Other (Advanced) Functions

The functions above might have been too simple for some. I won’t cover more complex functions in great detail.

Other functions include: \sin(x), \arctan(x)\Gamma \left( x \right) (Gamma Function), and \exp(x) = e^{x}. The independent variable x can also be random and be denoted by X.

An example of such an advanced function would be the normal distribution’s probability density function (pdf). Its probability density function is:

f(x | \mu, \sigma ^2) = \dfrac{1}{\sqrt{2\pi\sigma^2}}e^{ \dfrac{-(x - \mu)^2}{2\sigma^2}}

where \mu is a constant and the mean of the normal distribution, \sigma^2 is the variance of the distribution and \pi \approx 3.14.


A function takes an input x, makes computations in the function (machine) and produces an output as a value or expression.

The domain of the function is all input values that the function can use and the range of a function is all possible output values.

Visual Summary: Domain (Input)    \longrightarrow    Function (Machine)     \longrightarrow        Range (Output)

Image taken from http://our3esforthefuture.org/Math/Functions/functions.aspx

Leave a Reply