# Functions

In each function there are two variables like $x$ and $y$. One of them can be selected as independent variable arbitrary (in this book $x$), then the other one is function variable or dependent variable. While independent variable changes, dependent variable changes according to the function rule, too.

Definition:
Let $A$ and $B$ are two sets and $f$ be a subset of Cartesian product of $A \times B$. $f$ is a function if and only if
$(x,y_1) \in f \,\,,\,\, (x,y_2) \in f \longrightarrow y_1=y_2$
In other words $f$ is a subset of pairs of $A \times B$ such that there aren't two different pairs with same first components.

Example:
Let $A= \lbrace 1,3,7 \rbrace$ and $B=\lbrace -2,0 \rbrace$. Cartesian product of $A\times B$ is equal to
$A \times B = \lbrace (1,-2),(1,0),(3,-2),(3,0),(7,-2),(7,0) \rbrace$
Also let $f=\lbrace (1,0),(3,-2),(7,-2) \rbrace$.
$f$ is a subset of $A \times B$ and also it is a function, because there aren't two different pairs with same first components.

Example:
In the below figure $f$ is a function from $A$ to $B$. Notice that $f=\lbrace (1,11),(-2,\pi),(5,\pi) \rbrace$

Example:
In the below figure $g$ is NOT a function from $A$ to $B$. Notice that $g=\lbrace (-1,\dfrac{1}{7}),(-1,\sqrt{2}),(0,\dfrac{1}{7}),(4,\sqrt{2}) \rbrace$

Example:
Is $R=\lbrace (\sqrt{2}-1,4),(\dfrac{1}{\sqrt{2}+1},5),(3,6),(\dfrac{1}{2-\sqrt{3}},1),(2+\sqrt{3},1)\rbrace$ a function? If no find subsets of $R$ which are functions and each one consists of three pairs.
Solution:
First of all notice that
$\dfrac{1}{\sqrt{2}+1}=\dfrac{1}{\sqrt{2}+1} \times \dfrac{\sqrt{2}-1}{\sqrt{2}-1}=\dfrac{\sqrt{2}-1}{2-1}=\sqrt{2}-1$

$\dfrac{1}{2-\sqrt{3}}=\dfrac{1}{2-\sqrt{3}} \times \dfrac{2+\sqrt{3}}{2+\sqrt{3}}=\dfrac{2+\sqrt{3}}{4-3}=2+\sqrt{3}$
So $R$ can be rewritten as below
$R=\lbrace(\sqrt{2}-1,4),(\sqrt{2}-1,5),(3,6),(2+\sqrt{3},1) \rbrace$
which is not a function.
Now put
$f_1=\lbrace (\sqrt{2}-1,4),(3,6),(2+\sqrt{3},1) \rbrace$

$f_2= \lbrace (\sqrt{2}-1,5),(3,6),(2+\sqrt{3},1) \rbrace$
$f_1$ and $f_2$ are obviously two subsets of $R$ which are functions.

Example:
If $R=\lbrace (3,m-5),(-1,m),(2,m^2),(3,8) \rbrace$ is a function, then what's the value of $m$?
Solution:

$(3,m-5)=(3,8) \rightarrow m-5=8 \rightarrow m=13$
It is clear that
$R=\lbrace (3,8),(-1,13),(2,169) \rbrace$

Example:
If $f=\lbrace(a^2-2a,3),(3,3),(-1,4),(a,3) \rbrace$ is a function, then what's the value of $a$?
Solution:
$(a^2-2a,3)=(3,3) \rightarrow a^2-2a=3 \rightarrow a^2-2a-3=0 \rightarrow a=-1 \,\,,\,\, a=3$
Notice if $a=-1$ then $f=\lbrace(3,3),(-1,4),(-1,3) \rbrace$, which is not a function.
Therefore $a=-1$ is not acceptable. So $a=3$ and $f=\lbrace (3,3),(-1,4) \rbrace$

Example:
Prove that $f(x)=x^3-2$ is a function.
Solution:
According to the definition of a function, one should prove that if $x_1=x_2$, then $y_1=y_2$. So
$x_1=x_2 \rightarrow x_1 ^3=x_2 ^3 \rightarrow x_1 ^3 -2 =x_2 ^3 -2 \rightarrow y_1=y_2$
Therefore $f$ is a function.

Example:
Prove that $x^2+y^2=4$ is NOT a function.
Solution:
$x^2+y^2=4 \rightarrow y^2=4-x^2$
Now
$x_1=x_2 \rightarrow x_1 ^2= x_2 ^2 \rightarrow -x_1 ^2=-x_2 ^2 \rightarrow 4-x_1 ^2=4-x_2 ^2 \rightarrow y_1 ^2= y_2 ^2 \rightarrow y_1 = \pm y_2$
Therefore it isn't a function.

Tip:
$(x - \alpha)^2 + (y - \beta)^2 = R^2$
is standard form for the equation of a circle. Notice that $(\alpha,\beta)$ is the center of the circle and $R$ is its radius.

#### Exercises

1.Which figure is a function?    2. If $f=\lbrace (a,3),(1,-3),(2a+4,3) \rbrace$ is a function, then what's the value of $a$?

3. If $f=\lbrace (a+b,2),(a^2-2,3),(a^2-2a,3),(3,2) \rbrace$ is a function, then what's the value of $a+b$?

4. If $f=\lbrace (7,11),(a^-6a,11),(a,4) \rbrace$ is a function, then what's the value of $a$?

5. If $f=\lbrace (3,2),(a-b,2),(2a+b,4),(2b,4),(1,\sqrt{2}),(-2,3) \rbrace$ is a function, then what's the value of $(f(a))^2+f(b)$?

6. Prove that $y=2|x|+3x-4$ is a function.

7. Prove that $|y|+|x|=1$ is NOT a function.

8. By adding an extra constraint to $(x-3)^2+(y-4)^2=11$, this would be a function. Try to find the constraint.

Domain and range of functions

Contact email: 