0% found this document useful (0 votes)
11 views

Relations and Functions

Uploaded by

habibaahmed3041
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Relations and Functions

Uploaded by

habibaahmed3041
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Lecture Title:

Relations and Functions


A relation is a set of ordered pairs.
The domain is the set of all x values in the relation

domain = {-1,0,2,4,9}
These are the x values written in a set from smallest to largest

This is a
{(2,3), (-1,5), (4,-2), (9,9), (0,-6)} relation

These are the y values written in a set from smallest to largest

range = {-6,-2,3,5,9}

The range is the set of all y values in the relation


A relation assigns the x’s with y’s

1
2
2
4
3
6
4 8
5 10

Domain (set of all x’s) Range (set of all y’s)

This relation can be written {(1,6), (2,2), (3,4), (4,8), (5,10)}


function fffrom
AAfunction fromset
setAAtotoset
setBBisisaarule
ruleof
ofcorrespondence
correspondence
that
thatassigns
assigns to toeach element xxin
eachelement in the
theset
setAAexactly
exactly one
element yyin
element inthe
theset
setB.
B.

1
2
2
4
3
6
4 8
5 10

Set A is the domain Set B is the range


This is a function
---it meets our Must use all the x’s
conditions
The x value can only be assigned to one
y
Let’s look at another relation and decide if it is a function.
The second condition says each x can have only one y, but it CAN
be the same y as another x gets assigned to.

1
2
2
4
3
6
4 8
5 10

Set A is the domain Set B is the range


This is a function
---it meets our Must use all the x’s
conditions
The x value can only be assigned to one
y
AAgood
goodexample
examplethat thatyou
youcan “relate”totoisisstudents
can“relate” studentsininour
our
mathsclass
maths classthis
thissemester
semesterare
areset
setA.A. The
Thegrade
gradethey
theyearn
earnout
out
ofofthe
theclass
classisisset
setB.B. Each
Eachstudent
studentmust
mustbe beassigned
assignedaagrade
grade
andcan
and canonly
only be
be assigned
assigned ONE
ONE grade,
grade,but butmore
morethan
thanone
one
studentcan
student cangetgetthe
thesame
samegrade
grade(we
(wehope
hopeso---we
so---wewant
wantlots
lotsof
of A’s).
A’s). TheThe example
example show
shown onon
thethe previous
previous screen
screen had
had each
each
studentgetting
student gettingthethesame
samegrade.
grade. That’s
That’sokay.
okay.

1
2
2
4
3
6
4 8
5 10

2 was assigned both 4 and 10


Is the relation shown above a function? NO Why not???
Check this relation out to determine if it is a function.
It is not---3 didn’t get assigned to anything
Comparing to our example, a student in maths must receive a grade

1
2
2
4
3
6
4 8
5 10

Set A is the domain Set B is the range


This is not a
function---it Must use all the x’s
doesn’t assign
each x with a y The x value can only be assigned to one
y
Check this relation out to determine if it is a function.
This is fine—each student gets only one grade. More than one can
get an A and I don’t have to give any D’s (so all y’s don’t need to be
used).
1
2
2
4
3
6
4 8
5 10

Set A is the domain Set B is the range

This is a function Must use all the x’s

The x value can only be assigned to one


y
We commonly call functions by letters. Because function
starts with f, it is a commonly used letter to refer to
functions.
f ( x ) = 2 x − 3x + 6
2
This means
the right The left side DOES NOT
hand side is This means MEAN f times x like
a function the right hand brackets usually do, it
called f side has the simply tells us what is on
variable x in it the right hand side.

The left hand side of this equation is the function notation.


It tells us two things. We called the function f and the
variable in the function is x.
Remember---this tells you what
is on the right hand side---it is
f ( x ) = 2 x − 3x + 6
2

f (2) = 2(2) − 3(2) + 6


not something you work. It says 2
that the right hand side is the
function f and it has x in it.

f (2) = 2(4) − 3(2) + 6 = 8 − 6 + 6 = 8


So we have a function called f that has the variable x in it.
Using function notation we could then ask the following:
This means to find the function f and instead of
Find f (2). having an x in it, put a 2 in it. So let’s take the
function above and make brackets everywhere
the x was and in its place, put in a 2.

Don’t forget order of operations---powers, then


multiplication, finally addition & subtraction
Find f (-2). f ( x ) = 2 x − 3x + 6
2

f (− 2) = 2(− 2) − 3(− 2) + 6
2

f (− 2) = 2(4) − 3(− 2) + 6 = 8 + 6 + 6 = 20

This means to find the function f and instead of having an x


in it, put a -2 in it. So let’s take the function above and
make brackets everywhere the x was and in its place, put in
a -2.

Don’t forget order of operations---powers, then


multiplication, finally addition & subtraction
Find f (k). f ( x ) = 2 x − 3x + 6
2

f (k ) = 2(k ) − 3(k ) + 6
2

( )
f (k ) = 2 k − 3(k ) + 6 = 2k − 3k + 6
2 2

This means to find the function f and instead of having an x


in it, put a k in it. So let’s take the function above and make
brackets everywhere the x was and in its place, put in a k.

Don’t forget order of operations---powers, then


multiplication, finally addition & subtraction
Find f (2k). f ( x ) = 2 x − 3x + 6
2

f (2k ) = 2(2k ) − 3(2k ) + 6


2

( )
f (2k ) = 2 4k − 3(2k ) + 6 = 8k − 6k + 6
2 2

This means to find the function f and instead of having an x


in it, put a 2k in it. So let’s take the function above and
make brackets everywhere the x was and in its place, put in
a 2k.
Don’t forget order of operations---powers, then
multiplication, finally addition & subtraction
Let's try a new function Find g(1)+ g(-4).

g (x ) = x − 2 x
2

g (1) = (1) − 2(1) = −1


2

g (− 4) = (− 4) − 2(− 4) = 16 + 8 = 24
2

So g (1) + g (− 4) = −1 + 24 = 23
The last thing we need to learn about functions for
this section is something about their domain. Recall
domain meant "Set A" which is the set of values you
plug in for x.

For the functions we will be dealing with, there


are two "illegals":
1. You can't divide by zero (denominator (bottom)
of a fraction can't be zero)
2. You can't take the square root (or even root) of
a negative number

When you are asked to find the domain of a function,


you can use any value for x as long as the value
won't create an "illegal" situation.
Find the domain for the following functions:
Since no matter what value you
() choose for x, you won't be dividing
f x = 2 x − 1 by zero or square rooting a negative
number, you can use anything you
Note: There is
want so we say the answer is:
nothing wrong with
the top = 0 just means All real numbers x.
the fraction = 0
If you choose x = 2, the denominator
will be 2 – 2 = 0 which is illegal
x+3
g (x ) = because you can't divide by zero.
x−2 The answer then is:
illegal if this All real numbers x such that x ≠ 2.
is zero means does not equal
Let's find the domain of another one:

h(x ) = x − 4
Can't be negative so must be ≥ 0

x−4 0 solve
this x4
We have to be careful what x's we use so that the second
"illegal" of square rooting a negative doesn't happen. This
means the "stuff" under the square root must be greater
than or equal to zero (maths way of saying "not negative").
Summary of How to Find the
Domain of a Function
• Look for any fractions or square roots that could cause one
of the two "illegals" to happen. If there aren't any, then the
domain is All real numbers x.
• If there are fractions, figure out what values would make the
bottom equal zero and those are the values you can't use.
The answer would be: All real numbers x such that x ≠
those values.
• If there is a square root, the "stuff" under the square root
cannot be negative so set the stuff ≥ 0 and solve. Then
answer would be: All real numbers x such that x is defined
by whatever you got when you solved.
NOTE: Of course your variable doesn't have to be x, can be
whatever is in the problem.
Functions

19
Definition of a function
• A function takes an element from a set and maps it to a UNIQUE
element in another set.

Another definition to the FUNCTION:


Let X and Y be sets. A function f from X to Y is a rule that assigns every element x of X to a
unique y in Y.
We write f: X → Y and f(x) = y
X = domain, Y = codomain
y = image of x under f,
x = preimage of y under f
range = subset of Y with preimages

20
Function terminology
f maps R to Z

R f Z
Domain Co-domain

f(4.3)

4.3 4

Pre-image of 4 Image of 4.3

21
More functions
A pre-image The image
Domain Co-domain of 1 of A

Ali A “a” 1
Bob B “bb“ 2
Chris C “cccc” 3
Dave D “dd” 4
Emma F “e” 5

A class grade function A string length function

22
Even more functions

Range

a 1 “a” 1
e 2 “bb“ 2
i 3 “cccc” 3
o 4 “dd” 4
u 5 “e” 5

Some function… Not a valid function!


Also not a valid function!

23
Function arithmetic
• Let f1(x) = 2x
• Let f2(x) = x2

• f1+f2 = (f1+f2)(x) = f1(x)+f2(x) = 2x+x2

• f1*f2 = (f1*f2)(x) = f1(x)*f2(x) = 2x*x2 = 2x3

24
One-to-one functions
• A function is one-to-one if each element in the co-domain has a
unique pre-image

a 1 a 1
e 2 e 2
i 3 i 3
o 4 o 4
5 5

A one-to-one function A function that is


not one-to-one

25
More on one-to-one
• Injective is synonymous with one-to-one
• “A function is injective”
• A function is an injection if it is one-to-one

a 1
• Note that there can
e 2
be un-used elements
i 3
in the co-domain
o 4
5

A one-to-one function

26
Example
Let f (x ) = 3x − 7 , g ( x ) = −5x + 3 where f , g : → ., Find:
(a) f ( −3), g (0.2), f (0) (b) f + g ( x ) (c) f + g (−5)

Solution
(a) f (−3) = 3(−3) − 7 = −9 − 7 = −16
g (0.2) = −5(0.2) + 3 = −1 + 3 = 2
f (0) = 3(0) − 7 = 0 − 7 = −7

(b) f + g (x ) = f (x ) + g (x )
= (3x − 7) + (−5x + 3)
= (3x − 5x ) + (−7 + 3) = −2x − 4

(c) f + g (−5) = −2(−5) − 4 = 10 − 4 = 6


Example
Is f (x ) = 2x + 5 where f : → , a one-to-one function.

Solution
Let f (x ) = f ( y )

 2x + 5 = 2 y + 5 (adding − 5 to both sides)


 2x = 2 y (dividing both sides by 2)

 x =y
 f (x ) is one-to-one.
Example
Is f (x ) = x 2 + 1 where f : → , a one-to-one function.

Solution
Let f (x ) = f ( y )

 x 2 + 1 = y 2 + 1 (adding − 1 to both sides)


 x 2 = y 2 (taking to both sides)

 x = y
 f (x ) is not one-to-one.
NOTE
to clear the previous example

f (3) = (3) 2 + 1 = 9 + 1 = 10
f (−3) = (−3) 2 + 1 = 9 + 1 = 10

3  −3 but f (3) = f (−3)  f ( x ) is not one-to-one.


Combinations of Functions
Operations with Functions:
• Sum ( f + g )(x) = f (x) + g (x)

• Difference ( f − g )(x) = f (x) − g (x)


• Product
( f  g )(x) = f (x) g (x)
• Quotient f f (x )
 (x ) = , where g ( x )  0
g g (x )
Example: Let f(x) = 5x² -2x +3 and g(x) = 4x² +7x -5
• Find f + g • Find f - g

f ( x) + g ( x) f ( x) − g ( x)
(5 x 2 − 2 x + 3) + (4 x 2 + 7 x − 5) (5 x 2 − 2 x + 3) − (4 x 2 + 7 x − 5)
5x 2 + 4 x 2 − 2 x + 7 x + 3 − 5 5x 2 − 4 x 2 − 2 x − 7 x + 3 + 5
9x 2 + 5x − 2 x 2 − 9x + 8
Example:
Example: Let f(x) = 5x² and
and g(x) = 3x – 1.
• Find f · g • Find f/g

f (x )  g (x ) f (x )
, where g ( x )  0
5 x (3x − 1)
2 g (x )
2

5 x (3x ) − 5 x (1)
5x 1
2 2
, where x 
3x − 1 3
15x − 5 x3 2
Example:
Example: f(x)=2x + 3 and g(x) = x -7

f  g
Find  ( x ) Find  ( x )
g f 

2x + 3 x−7 3
, x7 , x−
x−7 2x + 3 2
Function Operations

Addition : ( f + g )( x) = f (x ) + g (x )

Multiplication : ( f  g )(x ) = f (x ) g (x )

Subtraction : ( f − g )(x ) = f (x ) − g (x )

f f (x )
Division :  (x ) = where g(x )  0
g g (x )
Adding and Subtracting Functions
Let f (x ) = 3x + 8 and g(x ) = 2 x − 12.
Find f + g and f - g

( f + g )( x) = f (x ) + g (x ) ( f − g )( x) = f (x ) − g (x )
= (3x + 8) + (2 x − 12) = (3x + 8) − (2 x − 12)
= 5x − 4 = x + 20

When we look at functions we also want to look at


their domains (valid x values). In this case, the
domain is all real numbers.
Multiplying Functions
Let f (x ) = x - 1 and g(x ) = x + 1.
2

Find f  g

f (x ) g ( x) = ( x 2 − 1)( x + 1) In this case, the domain is


all real numbers because
= x + x − x −1
3 2 there are no values that will
make the function invalid.
Dividing Functions
Let f (x ) = x 2 - 1 and g(x ) = x + 1.
f 
Find  
g
f (x ) x 2 − 1
= =
g (x ) x + 1
In this case, the domain is
all real numbers EXCEPT
-1, because x=-1 would give
( x − 1)( x + 1) a zero in the denominator.
= x −1
( x + 1)
Composition of Functions
• A composite function is a combination of two functions.

• You apply one function to the result of another.


• The composition of the function f with the function g is written as
f(g(x)), which is read as ‘f of g of x.’

• It is also known as which is read as ‘f composed with g of x.”


( f  g )( x ),
• In other words:

( f  g )( x ) = f ( g ( x ))
Ex: f(x)=2x + 5 and g(x) = x - 3
• You can work out a single “rule” for the composite function in
terms of x. g ( f ( x))

Find ( f  g )( x ) ( g  f )( x ) = g (2 x + 5)
= (2 x + 5) − 3
= 2x + 2
• Do you think ( f  g )(x) will give you the same result?
( f  g )(x ) = f (x − 3)
= 2( x − 3) + 5 NO!
= 2x − 6 + 5
= 2x −1
REMEMBER ( g  f )( x ) = 2 x + 2
You Try….
f(x) = 2x + 2 g(x) = (x + 2)2

Find: (g  f )(x) ( f  g )(x)


g (2 x + 2 ) = ((2 x + 2) + 2) 2 ( )
f ((x + 2) 2 ) = 2 x 2 + 4x + 4 + 2
= (2 x + 4 ) = 2x 2 + 8x + 8 + 2
2

= 4 x + 8 x + 8 x + 16
2 = 2x 2 + 8x + 10

= 4 x 2 + 16x + 16
You may need to evaluate a composite function for a
particular value of x.
f ( x ) = 5 − 3 x and g ( x ) = x 2 + 4 . Find ( f  g )(3 ).
Method 1:
Work out the ( f  g )(x ) = 5 − 3(x 2 + 4)
composite = −3 x 2 − 7
function.
Then substitute
3 for x.
( f  g )(3) = −3(3)2 − 7
= −27 − 7
= −34
You may need to evaluate a composite function for a
particular value of x.
f ( x ) = 5 − 3 x and g ( x ) = x 2 + 4 . Find ( f  g )(3 ).

g (3) = (3) + 4 = 13
Method 2: 2

Substitute 3 into
g(x).

f (13) = 5 − 3(13) = −34


Substitute that
value into f(x).
Example – Composition of Functions

Let f (x ) = x − 2 and g (x ) = x . Find (g  f )(− 5)


2

Method 1: Method 2:

(g  f )(x) = g ( f (x)) (g  f )(x) = g ( f (x))


g (x ) = g ( x − 2) = ( x − 2) 2 g ( f (− 5)) = g (−5 − 2)

(g  f )(− 5) = (− 5 − 2) 2
= g (−7)

= (−7) = 49
2
= (−7) = 49
2

You might also like