# What is a Function in Math

A function is a relation between input and output. The output and the input are interrelated. In other words function is like a machine where the input and output work hand in hand. Whenever the input changes the output also changes.

## Characteristics of Function

The set of input is called the domain and the set of output is called the range. The value of the domain and its corresponding value of the range can be graphed or written as a co ordinate pair, (x,f(x)). The function in maths is commonly denoted as "f".

For example f(x) = x2 where f is the function, x is the input and x2 is the output. In this example if we replace the input x as 5 then the output will be 25.

In short, basically a function should work for any and every value of X and it has one and only relation with each input value.

### Solved examples

1. Find the inverse of the function f(x) = 2x + 1
Solution:

f(x) = 2x + 1

y = 2x + 1

2x = y - 1

x = (y - 1)/2

Inverse function is f-1(x) = (x - 1)/2

2.      Is the given function subjective f(x) = 2x + 1 where, f is function from R to R

Solution:

y = f(x)

y = 2x + 1

For all real values of x, we get a real value of y. So, for every y, there is a x associated with it. So, the given function is onto or subjective.

3.      f(x) = x2 + 2.Show that it is one-one.

Solution:

f(x) = x2 + 2

f(a) = a2 + 2

f(b) = b2 + 2

f(a) = f(b)

a2 + 2 = b2 + 2

a2 = b(then take square root on both side)

a = b

Hence, it is one to one or injective.

## Transformation of Function

With a few changes in the given function or the formula of the given function, we can transform any function. A function can be transformed in many ways like horizontal, vertical, stretch etc. This can be shown through a graph of the function

If we have a function y = f(x) = x2, then the graph of this is as follows:

Then, we can transform it as:
(1) If we can add some quantity say a in it then the graph is moving up and moving down as per if a > 0 and a < 0 respectively.
Let f(x) = y = x2 + 2

(2) When added some constant in to the value of x as y = f(x) = (x + C)2 therefore, the graph is moving left and right as per C < 0 and C > 0 respectively.

(3) When the whole function is multiplied by some constant, then we are able to stretch or compress the graph of the function in the y direction.
f(x) = 2x2

If C > 1, so the stretch displayed  in the graph and if 0 < C < 1 compress in the graph.

When the x is multiplied by some constan, then we will be able to stretch or compress the graph of the function in the x direction.
f(x) = (0.5x)2

If C > 1, then compress displayed in the graph and if 0 < C < 1 stretch in the graph.

When we multiply the whole function by -1 then, we will be able to do upside down the whole function.
f(x) = -x2