Functions 1
Functions 1
A function f from a set A to a set B is a relation between elements of A and B with the property that each
input (element of A) is related to one and only one output element (element of B).
f b
;b=f (a )
1
a
2
b
c 3
4
Solution:
a. Domain of f = {a , b , c } and Codomain of f = {1 , 2, 3, 4 }
b. f (a )=2 , f (b )=4 and f (c )=2 .
c. Range of f = {2 , 4 }
d. Preimage of 1=φ and preimage of 4= { b }
Example 2:
2
Let f : Z → Z be defined by f ( x )=x . Find the domain, codomain and the range of
+¿ ¿
f .
Solution:
Domain is Z the set of all intergers.
+ ¿¿
Codomain is Z the set of all positive integers.
The Range={ 0,1,4 ,9,... } , the set of all integers that are perfect squares.
a 1
b 2
c 3
d 4
5
The function is one to one since f takes on different values at the four elements of its domain.
Example 3: Determine whether f ( x )=x +1 is one to one.
Solution: The function f ( x )=x +1 is a 1−1 function. To demonstrate this, note that x +1≠ y +1
whenever x≠ y .
Onto Function:
A function is said to be onto (Surjective) if every member of the codomain is an image of some element
of the domain.
Definition: Let f be a function from a set X to a set Y . f is onto if and only if given any element
y ∈Y , it is possible to find an element x ∈ X with the property that y=f ( x ) .
Example 1: Is the function f : Z → Z onto if f ( x )=x 2 ?
2
Solution: No, because there is no integer x with x =3 .
Example 2: Let f be the function from { a , b , c , d } to { 1,2,3 } defined by f (a )=3 , f (b )=2 ,
f (c )=1 and f (d )=3 . Is f onto?
Solution:
a 1
b 2
c 3
d
Since all the elements of the codomain are images of elements in the domain, f is onto.
Example 3: Is f ( x )=x +1 from Z → Z onto?
Solution: The function is onto since for every integer y there is an integer x such that f ( x )= y . Note
that f ( x )= y if x +1= y ⇒if x= y −1 .
Bijective Functions (1-1 and Onto):
A function f : X →Y is said to be a bijection if it is 1−1 and onto.
Example: Let the function f : X →Y be defined by the diagram below
a 1
b 2
c 3
d 4
y=3 x 2 + 4 ⇒3 x 2 = y−4 ⇒ x 2 =
y −4
3
⇒ x=
y−4
3 √
−1
and f ( x )=
x−4
3 √
f −1 (7 )=
√ √ 7−4
3
3
= =±1
3
Example 4: Let f be the function from { a , b , c } to { 1,2,3 } such that f ( x )=2 , f (b )=3 and
f (c )=1 . Is f invertible and if it is, what is its inverse?
Solution:
a 1
b 2
c 3
The function is a bijection since it is both 1-1 and onto and therefore invertible.
The inverse function f −1 reverses the correspondence given by f so f −1 (1 )=c , f −1 (2 )=a and
−1
f (3 )=b .
Composition of Functions.
Let f and g be functions from A to B . Then f +g and fg are also functions from A to B defined
by
( f +g ) ( x )=f ( x )+g( x )
( fg )( x )=f (x )g( x )
Let g be a function from set A to set B and f a function from set B to set C . The composition of the
functions f and g denoted by f ∘ g is defined by ( f ∘ g ) ( x )=f ( g( x ) ) .
Example: Let f ( x )=x 2 and g( x )=x−x 2 . Find;
i. f ( x )+g( x )
ii. ( fg )( x )
iii. ( f ∘ g) ( x )
iv. ( g ∘f ) ( x )
Solution:
i. f ( x )+ g( x )=x 2 + x −x 2=x
ii. ( fg )( x )=x 2 ( x−x 2 )=x 3 −x 4
iii.
( f ∘ g ) ( x )=f ( g( x ) ) =f (x −x2 )
¿( x−x 2 )2 =( x−x 2 )( x−x 2 )
¿ x 2−2 x 3 + x 4
iv. ( g ∘f ) ( x )=g ( f ( x ) ) =g( x 2 )=x 2.−( x 2 )2 =x 2−x 4
1
f ( x )= x +4
and g( x )=x−5 , show that ( f ∘ g ) ( x )=( g ∘ f ) ( x ) .
−1 −1 −1
Example: Given that 2
Solution:
1 1 5 1 3
( f ∘ g ) ( x )=f ( g ( x ))=f ( x−5 )= ( x−5 )+4= x− + 4= x+
2 2 2 2 2
1 3
y= x + ⇒2 y=x +3 ⇒ x=2 y−3
Let 2 2
−1
Thus ( f ∘ g ) ( x )=2 x−3
1
f ( x )= y = x + 4 ⇒2 y=x +8 ⇒ x=2 y−8 −1
Let 2 and f ( x )=2 x−8
Let g( x )= y=x−5 ⇒ x= y+5 and g−1 (x )=x +5
( g−1 ∘ f −1 ) (x )=g−1 ( f −1 (x ))=g−1 (2 x −8)=2 x−8+5=2 x−3=( f ∘ g )−1 (x )
Exercise:
1
g( x )= x
1. Given that f ( x )=2 x+3 and 3 . Find
i. ( f ∘ g )−1 ( x )
ii. ( g ∘f )−1 ( x )
1
h( x )= x
2. If f ( x )=3 x , g( x )=2 x +4 and 4 find,
i. ( f ∘ g ∘h ) ( x )
ii. ( g ∘f ∘h ) ( x )
iii. ( h ∘ g∘ f ) ( x ) (Note: ( f ∘ g ∘h ) ( x )=f ( g∘ h ) ( x )=f ( g ( h( x ) ) ) )
3. Show that ( f ∘ g ∘h )
−1
(x )=( h−1 ∘ g−1 ∘ f −1 ) ( x )