Functions (Basic to Advanced)


Basics:

A function is simply a factory which takes an input and gives an output.  f(x) = 2x + 3 means, If we give 5 as input to this factory, it gives an output 2 x 5 + 3 = 13
Every function performs like this whatever type of the function we take.

What are functions? What are not?
For example in a class there are 30 students. If the teacher calls a persons roll number only one student raises his hand. Then f(roll number) is a function.
If the teacher calls a person's height then there are several students which the same height. So f(students's height) is not a function
Now take a function. $y = {x^2}$
For two different values of x like 2, -2 we get same value 4. So It is a function

Now what about $y = \sqrt x $
Do we get two values for x = 4? 2, -2
No.  $\sqrt x $ is called a principal square root fuction and takes only positive values. So it is a function.

Now what about ${y^2} = x$
${y^2} = x$ is a combination of two functions. $y =  \pm \sqrt x $
So It is not a function as for x = 4, we get two values 2, -2

Check here for the graph of the function

How many of the below graphs are functions?
Types of functions
a. Is not a function as you draw a vertical line parrallel to y axis, it cut the curve at more than 2 points.
b. Is a function. As for each value of x, there exists only one value
c. Is not a function as for x = 0 there exists 3 values for y
d. Is not a function as discussed above
e. Is a function

Let A and B be two sets. A relation f from A to B is called a function (or a mapping or a map) from A to B if for each a$ \in $A there exists one and only one b$ \in $B such that the ordered pair (a, b)$ \in $f. If (a, b)$ \in $ f, then b is called the image of a under f. Note that two elements of A can have same image in B, but no element of A can have two images in B, and all must have some image in B. Set A is called Domain of f and set B is called co domain of f.

Total functions from A to B: 
Result: If O(A) = m and O(B) = n, then the number of possible functions from A to B is ${n^m}$ , i.e. $O{(B)^{O(A)}}$
Proof: Let A and B be two finite sets having m and n elements respectively.  m elements in A can be  mapped in n × n × .... × n (m times) = ${n^m}$ ways. Thus, the total number  of functions from A to B is ${n^m}$.

Domain and Range:
For a function y = f(x), the set of values of x are called domain, and set of y values are called Range.

Types of functions: 

Even Function:
If f(x) = f(-x) then we call that function as Even fucntion.  Even functions are symmetric around Y axis
Eg: $f(x) = {x^2} - 1$ is an even function.

Odd Function:

If f(-x) = -f(x) then we call that function as Odd function.  In the graph of odd function, the first and third quadrants will be reflections of each other and so will the second and fourth quadrant.
Eg: $f(x) = {x^3} - x$

Modulus function: 
The function defined by f(x) = |x|  =$\left\{ {\begin{array}{*{20}{c}}
x\\
{ - x}
\end{array}{\rm{  }}} \right.\begin{array}{*{20}{c}}
{x \ge 0}\\
{x < 0}
\end{array}$  is called the modulus function. The Domain of |x| = R and Range = R+ U {0}, i.e. set of all non-negative real numbers. 

Greatest integer function: 
For any real number x, we denote [x], the greatest  integer less than or equal to x. For example,
[2.45] = 2 and [– 2.1] = – 3. The function defined by f(x) = [x] for all x $ \in $ R is called the greatest integer function. Obviously, the Domain of [x] = R and the Range = Z, i.e. set of integers.

Square root function:
A function f(x) defined by f(x) = $\sqrt x $,  $x \in {R^ + }$ is called the square root function. The Domain and Range of the square root function is [0, $\infty $) which is set of all non-negative real numbers.

Signum function:
The function defined by  f (x) = $\left\{ {\begin{array}{*{20}{c}}
{\frac{{|x|}}{x}}\\
0
\end{array}{\rm{  }}} \right.\begin{array}{*{20}{c}}
{x \ne 0}\\
{x = 0}
\end{array}\left\{ {\begin{array}{*{20}{c}}
1\\
{ - 1}\\
0
\end{array}{\rm{     }}} \right.\begin{array}{*{20}{c}}
{x > 0}\\
{x < 0}\\
{x = 0}
\end{array}$ is called the signum function also given by sgn(x). The Domain = R and Range = {– 1, 0, 1}.

Polynomial function:
A function of the form f(x) = ${a_0}{x^n} + {a_1}{x^{n - 1}} + ...... + {a_{n - 1}}{x^{n - 1}} + {a_n}$,  where  ${a_0},{a_1}...{a_n}$ an are real numbers,  ${a_0} \ne 0$ and $n \in N$, is called a polynomial function of degree n.   The Domain of a polynomial function is R. Range can be any subset of real numbers.

Reciprocal function:
The function that associates each non-zero real number x to its reciprocal, i.e. f(x) = $\frac{1}{x}$  is called the reciprocal function. Domain = Range = R – {0}.

Exponential function:
The function that associates every real number x to ${e^x}$ , i.e. f(x) = ${e^x}$ for all x  R, is called the exponential function. Domain = R and Range = ${R^ + }$ , i.e. set of positive real numbers.

Logarithmic function: 
The function that associates every positive real number x to log x, i.e. f(x) = log x for all x > 0 is called the logarithmic function . Domain = ${R^ + }$ and Range = R. 

Composite functions:
Consider two functions f(x) = ${x^2} - 1$ and g(x) = 5 - 2x
The expressions of the type  f(g(x)) are called composite function.
f(g(x)) = f(5-2x) = ${(5 - 2x)^2} - 1$
f(g(x)) need not be equal to g(f(x))

Iterative Function:
In the previous example we performed function g on f. Similarly performing f on f is called iteration.
Thus f(f(x) = f(${x^2} - 1$) = ${({x^2} - 1)^2} - 1$
Extending this idea further, one could also have computed ${f^n}(x)$ = f(f(f(.........f(x)....)
This is called a nested function or iterative function.
Thus ${f^4}(x) = f(f(f(f(x))))$
If f(x) = 2x - 1
f(f(x)) = 2 (2x-1) - 1 = 4x - 3

Periodic function:
If a function f(x), repeats its value after a definite increment (or decrement) in the value of x, then we say that the function f(x) is a periodic function.
F is periodic then
f(x+p) = f(x) for p is a real number.

Example: Given that f(x-a) + f(x) = 0.  Find that least possible number P such that f(x+P) = f(x)
Sol: f(x-a) = -f(x)
replacing x by (x-a)
f(x-2a) = -f(x-a) = f(x) [as f(x-a) = -f(x)]
replacing x by x+2a
f(x) = f(x+2a)
So the minimum possible value is 2a and it is the period of the function f(x)

Solved Examples:

1. Given that f(x) = x$ \times $f(x - 1) for any natural number x. If f(x + 2) = 20*f(x), then what is the value of x?
a. 2           b. 4            c. 5            d. 1          e. None of these
Given:f(x) = x$ \times $f(x - 1) ....(a)
and f(x + 2) = 20$ \times $f(x) ....(b)
Substitute x = x + 1 in (a)
Then, f(x + 1) = (x + 1)$ \times $f(x) .........(c)
Substitute x = x + 2 in (a)
Then,  f(x + 2) = (x + 2)$ \times $f(x + 1) ......(d)

From (b), 20$ \times $f(x) = f(x + 2) = (x + 2)$ \times $f(x + 1)= (x + 2)(x + 1)$ \times $f(x)
$ \Rightarrow $ 20$ \times $f(x) = (x + 2) (x + 1)$ \times $(f(x)

Cancelling f(x) on both sides and upon simplification we get
or ${x^2}$+ 3x - 18 = 0
or (x + 6)(x - 3) = 0
or x = -6 or 3. Hence the answer is option (e).

2. If 2*f(x) - f(1/x) = ${x^2}$ , then f(x) is?
a. f(x) = 3{2*${x^2}$ + ${\left( {\displaystyle\frac{1}{x}} \right)^2}$ }
b. 2 f(x) = {2*${x^2}$+${\left( {\displaystyle\frac{1}{x}} \right)^2}$ }
c. f(x) = {2*${x^2}$ +${\left( {\displaystyle\frac{1}{x}} \right)^2}$ }
d. 3 f(x) = {2*${x^2}$ +${\left( {\displaystyle\frac{1}{x}} \right)^2}$ }
e. None of these
Sol: 2*f(x) - f(1/x) = ${x^2}$ ..............(1)
Take x = (1/x),
2*(1/x) - f(x) = ${\left( {\displaystyle\frac{1}{x}} \right)^2}$ ...............(2)
Add: 2 (equation 1) + equation 2
3*f(x) = 2*${x^2}$+ ${\left( {\displaystyle\frac{1}{x}} \right)^2}$
f(x) = {2*${x^2}$ + ${\left( {\displaystyle\frac{1}{x}} \right)^2}$}/3

3. A function f(x) is said to reflect onitself if, y = f(x) and x = f(y). Which of the following function reflects on itself?
a. f(x) = x
b. f(x) = (2x + 1) / (x - 2)
c. f(x) = (3x + 2) / (2x - 3)
d. f(x) = (4x + 3) / (3x - 4)
e. All of these
(a) f(x) = x = f(y)
y = x = f(y) Hence (a) is true.
(b) f(x) = $\displaystyle\frac{{2x + 1}}{{x - 2}}$ = y
xy - 2y = 2x + 1
xy - 2x = 1 + 2y
x(y - 2) = 1 + 2y
x = $\displaystyle\frac{{1 + 2y}}{{y - 2}}$ Hence (b) is also true.
Similarly if we check for options (c) & (d), they will also hold true, hence t he answer is option (e).

4. If f(x) = 1 - x            if x > 0
         = 1/(1 - x)      if x$ \le $0.
Also ${f^n}(x) = f\left( {{f^{n - 1}}\left( x \right)} \right)$ for n > 1. What is the value of  ${f^{101}}( - 101)$ ?
a. 102
b. 1/102
c. 101/102
d. 1/101
e. None of these
Let x$ \le $0

f(x) = $\displaystyle\frac{1}{{1 - x}}$

f(f(x)) = 1 - $\displaystyle\frac{1}{{1 - x}}$   (As $\displaystyle\frac{1}{{1 - x}}$ $x \ge 0$

= $\displaystyle\frac{{ - x}}{{1 - x}}$   (Observe $\displaystyle\frac{{ - x}}{{1 - x}}$ is Positive for x is negitive)

${f^3}(x)$ = $1 - \displaystyle\frac{{ - x}}{{1 - x}} = \displaystyle\frac{{1 - x - ( - x)}}{{1 - x}} = \displaystyle\frac{1}{{1 - x}}$

So ${f^1}(x) = {f^3}(x) = {f^5}(x) = .....{f^{101}}(x)$

${f^{101}}(x) = {f^1}(x) = \displaystyle\frac{1}{{1 - x}} = \displaystyle\frac{1}{{1 - ( - 101)}} = \displaystyle\frac{1}{{102}}$

5.  If f(x) = 2x + 3, & g(x) = (x - 3)/2, then what is the value of, fo(fo(go(go(fo(fo(go(go................(fo(fo(go(gof(x) )))).....)))))) ?
a. (x - 3) / 2
b. x
c. 2x - 3
d. 2x + 3
e. None of these
f(x) = 2x + 3
g(x) = (x - 3)/2
gof(x) = $\displaystyle\frac{{2x + 3 - 3}}{2} = x$
gogof(x) = $\displaystyle\displaystyle\frac{{x - 3}}{2}$
fogogof(x) = $2\left( {\displaystyle\frac{{x - 3}}{2}} \right) + 3$ = $\displaystyle\frac{{2x - 6 + 6}}{2}$ = x
fofogogof(x) = 2x + 3
This means, when we apply two times g(x) and two time f(x) on f(x) we get f(x).  This pattern continues, Hence the answer is option (d).

6. For any function ${F^n}(x) = {F^{n - 1}}\left( {F\left( x \right)} \right)$ if for n > 1 also g(x) = 1/x,  h(x) = $\sqrt x $   and k(x) = ${x^2}$  then what is the value of $g\left( {{h^3}\left( {{k^2}\left( x \right)} \right)} \right)?$
a. $\sqrt x $ 

b. 1/x 
c. ${x^2}$  
d. $\displaystyle\frac{1}{{\sqrt x }}$ 
e. None of these
Given ${F^n}\left( x \right) = {F^{n - 1}}\left( {F\left( x \right)} \right);$ g(x) = 1/x; h(x) = $\sqrt x $; k(x) = $\sqrt x $
Then, k(k(x)) = ${\left( {{x^2}} \right)^2} = {x^4}$
And, ${h^3}\left( {{k^2}\left( x \right)} \right) = h\left( {h\left( {h\left( {{k^2}\left( x \right)} \right)} \right)} \right) = h\left( {h\left( {{x^2}} \right)} \right) = h\left( x \right) = \sqrt x .$
And, $g\left( {{h^3}\left( {{k^2}\left( x \right)} \right)} \right) = g\left( {\sqrt x } \right) = 1/\sqrt x .$
Hence answer is option (d).



7. If ${f^1}(x) = f(x) = \displaystyle\frac{1}{{2x}}$ and ${{\rm{f}}^{\rm{n}}}(x) = f({f^{n - 1}}(x)$, then find ${{\rm{f}}^{\rm{5}}}(x) + {f^{10}}(x)$ where x = 1
Sol: f(x) = $\displaystyle\frac{1}{{2x}}$ and f(f(x)) = $f\left( {\displaystyle\frac{1}{{2x}}} \right)$ = $\displaystyle\frac{1}{{2\left( {\displaystyle\frac{1}{{2x}}} \right)}}$ = x
Similarly  ${f^3}(x) = f({f^2}(x)) = f(x) = \displaystyle\frac{1}{{2x}}$ and ${f^4}(x) = f({f^3}(x)) = f(\displaystyle\frac{1}{{2x}}) = \displaystyle\frac{1}{{2 \times \displaystyle\frac{1}{{2x}}}} = x$
Hence ${f^n}(x) = \displaystyle\frac{1}{{2x}}$ for n = odd and ${f^n}(x) = x$ for n = even
${f^5}(x) + {f^{10}}(x) = \displaystyle\frac{1}{{2x}} + x$
If x = 1,  $ \Rightarrow \displaystyle\frac{1}{{2 \times 1}} + 1 = \displaystyle\frac{3}{2}$

8. ${f^1}\left( x \right)$ = 2x - 1 and ${f^n}\left( x \right) = {f^1}\left( {{f^{n - 1}}\left( x \right)} \right)$  for n $ \ge $ 2. Find ${f^{5}}\left( 2 \right)$
a. 30 b. 33 c. 31  d. None of these
${f^1}\left( 2 \right)$ = 2 x 2 - 1 = 3
${f^2}\left( 2 \right) = {f^1}\left( {{f^1}\left( 2 \right)} \right) = {f^1}(3)$ = 2 x 3 - 1 = 5
${f^3}\left( 2 \right) = {f^1}\left( {{f^2}\left( 2 \right)} \right) = {f^1}\left( 5 \right)$= 2  x 5 - 1 = 9
${f^4}\left( 2 \right) = {f^1}\left( {{f^3}\left( 2 \right)} \right) = {f^1}\left( 9 \right)$= 2 x 9 - 1 = 17
${f^5}\left( 2 \right) = {f^1}\left( {{f^4}\left( 2 \right)} \right) = {f^1}\left( {17} \right)$= 2 x 17 - 1 = 33
In fact, The general term of the above function is ${2^n}$+1

9. Let g(x) be a function such that g(x + 1) + g(x - 1) = g(x) for every real x. Then for what value of p is the relation g(x + p) = g(x) necessarily true for every real x?
a. 5 b. 3    c. 2  d. 6
Sol: g(x + 1) + g(x - 1) = g(x)
g(x + 2) + g(x) = g(x + 1)
Adding these two equations we get
$ \Rightarrow $ g(x + 2) + g(x  - 1) = 0
$ \Rightarrow $ g(x + 3) + g(x) = 0    (By substituting x = x+1)
$ \Rightarrow $ g(x + 4) + g(x + 1) = 0  (By substituting x = x+1)
$ \Rightarrow $ g(x + 5) + g(x + 2) = 0  (By substituting x = x+1)
$ \Rightarrow $ g(x + 6) + g(x + 3) = 0  (By substituting x = x+1)
$ \Rightarrow $ g(x + 6) - g(x) = 0    ( g(x+3) + g(x) = 0  $ \Rightarrow $ g(x+3) = - g(x))
$ \Rightarrow $ g(x + 6) = g(x)
So for p = 6 the function is periodic.

10. Find the area of region enclosed by | x | + | y | = 3 
a. 9 units   b. 18 units  c. 12 units           d. 6 units
We have to consider separately the form of the function w.r.t to where x, y lies.
x >0, y >0, x + y = 3
x > 0, y < 0, x - y = 3
x < 0, y >0, x - y =  - 3
x < 0, y < 0, x + y = - 3


After having drawn the above 4 lines on the graph, the graph looks like aboe
Now the area of the graph = 4 right angle triangles.
Area of the right angle triangle = $\displaystyle\frac{1}{2} \times 3 \times 3 = \frac{9}{2}$
Area of the entire region = $\displaystyle\frac{9}{2} \times 4$ = 18 units.

11. For any natural number n, F(n) is the least common multiple of all natural numbers upto.  For how many values of n less than 100, F(n+1) - F(n) = 0?
1.  16 2.  25 3.  49 4.  64
Sol: F(n) is the LCM of al natural numbers upto n.
For example,
F(3) = 6
F(5) = 60
F(6) = 60 etc.
F(n + 1) - F(n) = 0
$ \Rightarrow $ F(n + 1) = F(n)
It would hapen only when factors of (n + 1) are already present in the LCM of first n natural numbers.  In other words, Whenever (n + 1) is Prime number or is any Integral power of any prime number, F(n + 1) $ \ne $ F(n)

for example, F(31) $ \ne $ F(32) as 32 = ${2^5}$ which is, 2 raised to power 5. or F(4) $ \ne $ F(5) as 5 is prime so the power of 5 does not contain in F(4).
Between 1 and 100, there are 25 prime numbers. So if (n+1) is one of these number then F(n + 1) $ \ne $ F(n).
Also {4, 8, 16, 32, 64, 9, 27, 81, 25, 49} are prime numbers raised to some exponent.  

Hence, none of these 35 numbers from 1 to 99 cannot be the possible values of n. So for 99 - 35 = 64 numbers F(n) = F(n+1)

12. Given that f(1) = 1 and f(2) = 1.  If f(n) = f(n+1) - f(n - 1), then find the value of $\displaystyle\frac{{f(8) - f(7) + f(5)}}{{f(7) - f(6) - f(4)}}$
f(n) = f(n+1) - f(n - 1)
$ \Rightarrow $ f(n - 1) = f(n + 1) = f(1)
 f(8) - f(7) = f(6) and f(7) - f(6) = f(5)
$ \Rightarrow $f(n + 1) = f(n) + f(n - 1)
$ \Rightarrow $f(3) = f(2) + f(1) = 1 + 1 = 2
$ \Rightarrow $f(4) = f(3) + f(2) = 2 + 1 = 3
$ \Rightarrow $f(5) = f(4) + f(3) = 3 + 2 = 5
$ \Rightarrow $ f(6) = f(5) + f(4) = 5 + 3 = 8
$\displaystyle\frac{{f(8) - f(7) + f(5)}}{{f(7) - f(6) - f(4)}} = \frac{{f(6) + f(5)}}{{f(5) - f(4)}} = \frac{{8 + 5}}{{5 - 3}} = \frac{{13}}{2}$

13. If f(x) + f(1 - x) + f(1 + x) + f(2 + x) = 2x for all real value of x.  If f(0) = 1, then find the value of f(4)
1.  4 2.  5 3.  6 4.  3 5.  1
For x = 0, f(0) + f(1) + f(2) = 0 ............. (i)
For x = 1, f(1) + f(0) + f(3) = 2 ............. (ii)
subtracting (i) from (ii), we get f(3) - f(1) = 2 .......... (a)
For x = 2, f(2) + f(-1) + f(3) + f(4) = 4      ........  (iii)
For x = -1, f(-1) + f(2) + f(0) + f(1) = -2   .........  (iv)
subtracting from (iii) from (iv), we get
$ \Rightarrow f(0) - f(4) - 2 =  - 6$ [ from (a) we know that f(3) - f(1) = 2]


Functional Equations:


Note: While solving fuctional equations, Remember the following:

f(xy) = f(x).f(y) $ \Rightarrow $ f(x) = ${x^n}$

f(x+y) = f(x) . f(y) $ \Rightarrow $ f(x) = ${a^{Kx}}$
f(xy) = f(x) + f(y) $ \Rightarrow $ f(x) = K log x or f(x) = 0
f(x+y) = f(x) = f(y) $ \Rightarrow $ f(x) = k
f(x).$f\left( {\displaystyle\frac{1}{x}} \right)$ = f(x) + $f\left( {\displaystyle\frac{1}{x}} \right)$ $ \Rightarrow $ f(x) = $ \pm {x^n} + 1$

1.  Given f(x) is a function satisfying f(x+y) = f(x).f(y) for all real values of x and y.  If f(1) = 3 and f(1) + f(2) + f(3) + ...f(n) = 1092. Then find the vallue of n.
a.  5             b. 6          c. 7            d. 18
Sol: f(1) = 3
f(2) = f(1 + 1) = f(1) x f(1) = ${3^2}$
f(3) = f(1 + 2) = f(1) x f(2) = ${3^3}$
...
...
f(1) + f(2) +....f(n) = 1092
$3 + {3^2} + {3^3}{....3^n}$ =1092
ie., $3.\displaystyle\frac{{{3^n} - 1}}{{3 - 1}} = 1092$
Solving n = 6

2. Given g(x) is a function such that g(x+1) + g(x-1) = g(x).  For what minimum value of P does the relation g(x+p) = -g(x) necessarily hold true? 
a.  2         b. 3                c.  5           d. 6
Sol: given g(x+1) + g(x-1) = g(x) ......(1)
g(x + 2) + g(x) = g(x+1) .........(2)
adding
g(x+2) + g(x-1) = 0
g(x+3) + g(x) = 0
So g(x+3) = - g(x)
P =3

3. The odd function f(x) has period 6.  If f(5) = 4 then what is the value of f(1)-f(3)
a. -6   b. -4      c. 0   d. 4
Sol: f(-x) = -f(x)
f(x+6) = f(x)
f(-5) = -f(5) = -4
f(-5) = f(-5+6) = f(1) = -4
f(-3) = f(-3 +6) = f(3)
Also f(-3) = -f(3) So f(3) = 0

4.F(x) = $\displaystyle\displaystyle\frac{{{4^x}}}{{{4^x} + 2}}$ Then $F\left( {\displaystyle\displaystyle\frac{1}{{1997}}} \right) + F\left( {\displaystyle\frac{2}{{1997}}} \right) + ......F\left( {\displaystyle\frac{{1996}}{{1997}}} \right)$ is equal to
$F(x) = \displaystyle\frac{{{4^x}}}{{{4^x} + 2}}$
F(x) + F(1-x) = $\displaystyle\frac{{{4^x}}}{{{4^x} + 2}} + \displaystyle\frac{{{4^{1 - x}}}}{{{4^{1 - x}} + 2}} = \displaystyle\frac{{{4^x}}}{{{4^x} + 2}} + \displaystyle\frac{2}{{2 + {4^x}}} = 1$
$ \Rightarrow F\left( {\displaystyle\frac{1}{{1997}}} \right) + F\left( {\displaystyle\frac{2}{{1997}}} \right) + ......F\left( {\displaystyle\frac{{1996}}{{1997}}} \right)$ = $F\left( {\displaystyle\frac{1}{{1997}}} \right) + F\left( {\displaystyle\frac{{1996}}{{1997}}} \right) + F\left( {\displaystyle\frac{2}{{1997}}} \right) + F\left( {\displaystyle\frac{{1995}}{{1997}}} \right) + ...... = \displaystyle\frac{{1996}}{2}$ = 998

5. If f(x/y) = f(x) - f(y) (for y0) then which of these is equal in value to f(150/6)
a.  f(5) b.  2.f(5) c.  f(6) d.  f(20)
Sol: f(x/y) = f(x).f(y)
Put x = y$ \Rightarrow $ f(1) = 0
Put x = 1 $ \Rightarrow $ y = 1/x
f(x) = f(1) - f(1/x) = 0 - f(1/x)
f(1/x) = -f(x)
Put x = x and y = 1/x
$ \Rightarrow $ $f({x^2})$ =f(x) - f(1/x)
$ \Rightarrow $ f(x) - (-f(x) = 2f(x)
$f({x^2})$ =2.f(x)
$ \Rightarrow $ f(25) = 2.f(5)

Alternatively:
When you see f(x/y) = f(x) - f(y) you should recall that it is of the form Log (a/b) = log a - log b
So the given function is a logarithmic function.
So log (150/6) = log (25) = log (${5^2}$) = 2log5