What's a function?

2 Answers
Feb 13, 2017

Please see below.


A function is a rule which maps values of a variable into another variable. The first variable is the input, which when put in the rule, (in mathematics, this rule is defined by a mathematical formula ) results in another variable, which is the output.

These rules are generally described as say #color(blue)y=color(brown)(f(color(red)x))#,

where #color(red)x# is input, #color(blue)y# is output and #color(brown)(f())# is the rule or formula. What it literally means is that when we take an input value #color(red)x# and put it in the rule #color(brown)(f())#, we get the output #color(blue)y#.

For example let #color(brown)(f(color(red)x))=x^2-3x#,

if we have input #x=0# we get #y=0^2-3xx0=0-0=0# and

if #x=-5#, we get #y=(-5)^2-3xx(-5)=25-(-15)=25+15=40#

and if #x=5#, we get #y=5^2-3xx5=25-15=10#

Hence, for different values of input, we get different values of output, which is decided by the rule or the matemaical formula.

The input variable is called independent variable and the output variable is called the dependent variable.

The values that input variable or independent variable can take is called domain and values that output variable or dependent variable can take is called range.

Generally names of variables are represented by alphabets such as #x,y,u,v,w# etc. and rules or formulas are represented by #f,g,h# etc.

The rules or formulas could be simple linear or quadratic functions, polynomials, algebraic functions (more like fractions with polynomials as numerators and denominators), trigonometric functions, exponential functions etc.

A function is a rule we apply to an input and which produces a single result.


A function is simply a rule that we apply to an input (could be a number, could be a variable, could even be another function).

Let's look at how functions are written: #f(x)="the rule"#. The letter #x# within the #f(x)# tells us that this is the input, and #f(x)# simply means "perform this operation for each value of #x#".

So let's say that the rule is #x+2#. We'd write the function notation as #f(x)=x+2# - and all this means is that each time I input a value for #x#, the rule is going to increase that value by 2. And so, as an example, let's just input a few values into our function:


Functions can get more and more complicated, as can the values that are inputted. But the basic rule still applies - input a value, get a value out.

There is one thing to note about the value in/value out thing - we want a single value to come out from any value we put in. If we get more than one value, the rule suddenly isn't a rule - it's more of a list of possibilities. And so if we get more than one value, it isn't a function.

This is where the vertical line test comes in - if we graph our function (which we can do - the #x# values correspond to the x-axis and the #f(x)# values correspond to the y-axis), we can draw vertical lines on the graph. If we run into one line - good. More than one? Bad.

Here's our original example#f(x)=x+2# in graphical form:

graph{x+2 [-10.04, 9.96, -3.16, 6.84]}

I can draw vertical lines and encounter only one value:

graph{(y-(x+2))(y-1000x+1000)=0 [-10.04, 9.96, -3.16, 6.84]}

But if I have a graph that looks like this:

graph{(y-sqrtx)(y+sqrtx)=0 [-5, 9.96, -5, 6.84]}

The vertical line test will fail - and therefore the graph isn't a function:

graph{(y-sqrtx)(y+sqrtx)(y-1000x+1000)=0 [-5, 9.96, -5, 6.84]}