# Are the functions are same?

## Answer

A *function* is a relation between a set of inputs and a set of permissible outputs with the property that each input is related to exactly one output.

Set of inputs is usually know as *domain of the function*. When we are saying set of input values, it means every element in the domain give us some output, there is no such element exists in domain which cannot taken as input. So to define a function, we must first have set of input values.

Alternatively, we say a relation $f:A \to B$ is called function if

- Domain of $f = A$.
- There is a unique element in $B$ for each element of $A$.

The important things to remember that there will always be three main parts:

- The input (the whole set $A$)
- The relationship
- The output (element from $B$)

## Example

Consider $A=\mathbb{N}$, $B=\mathbb{R}$ and $f(x)=x+1$.
Clearly we see $1 \mapsto 2$, $\quad 2 \mapsto 3$, $\quad 3 \mapsto 4$ and so on.

Here Domain of $f = \mathbb{N}$

Now if consider $A=\mathbb{R}$, $B=\mathbb{R}$ and $g(x)=x+1$,

then obviously Domain of $f=\mathbb{R}$.

What we have now? we can conclude $f \neq g$, even both are represented by a same algebraic expression. This is because domain is a basic ingredient of the function and both the functions have different domain. In other words in total of three parts of the function only one is same and remaining are different.

## More explanation

In mathematics, especially in Calculus and Complex Analysis, we don't mention domain of the functions but it doesn't means that domain is not there. It is conventional way to write a function with the assumption that the domain will be the set of possible inputs from the set under consideration. Like in Calculus, the set of inputs is subset of set of real numbers and in Complex Analysis it is subset of set of complex numbers.

If we write a real valued function $f(x)=x+3$, then the possible inputs (domain of $f$) is set of real number as we always get output for every real number.

Now if we write a real valued function $\displaystyle g(x)=\frac{x^2-9}{x-3}$, then it doesn't give any output for $x=3$. Hence the possible input (domain of $g$) is all real numbers except $3$.

We can write $$\begin{array}{ll} g(x)&=\frac{x^2-9}{x-3}\\ &=x+3 \hbox{ when } x\neq 3. \end{array}$$.

At last we can say that $f$ and $g$ are different function even both can be represented by same algebraic expression.

Remember, two function $f_1$ and $f_2$ are said to be equal iff $f_1(x)=f_2(x)$ for all $x$, that is, all three parts of the functions must be the same.

## References

- dyk/1
- Last modified: 15 months ago
- (external edit)