Functions
Functions 1 / 30
Functions
Suppose we have two sets, D and E .
A function f is a rule that assigns to each element x of the set D exactly
one element, called the value of f at x and denoted by f (x), in the set E .
Definition and Notation
The set D is called the domain of the function f .
We write f : D → E to indicate that the domain is D and the values of f
belong to E .
The set of all values f (x) as x varies through the domain of f is called the
range of f (standard notation: R).
Example
f (x) = x 2
D=R
R = [0, ∞).
Functions 2 / 30
Domain and range
Problem
1
f (x) = √
2
x −4
Find the domain and the range.
Solution
The domain: we have to solve x 2 − 4 > 0
(x − 2)(x + 2) > 0
Sign of (x + 2)(x − 2):
+ − +
−2 2
D = (−∞, −2) ∪ (2, ∞).
Functions 3 / 30
Domain and range
Solution (cont.)
√
The range is the set of values of y for which the equation 1/ x 2 − 4 = y
has a solution. √
Note y 6= 0. Then x 2 − 4 = 1/y .
Observe that y > 0. Then
x 2 − 4 = 1/y 2
x 2 = 1/y 2
p +4
x = ± 1/y 2 + 4.
So, if y > 0, then the equation has a solution.
R = (0, ∞).
Functions 4 / 30
Graphs
Definition
Let f : D → R be a function, where D is a subset of R.
The set of all points (x, y ), where x ∈ D and y = f (x), is called the graph
of f .
f (x)
Functions 5 / 30
Graphs
The vertical line test
A curve in the xy -plane is the graph of a function of x if and only if no
vertical line intersects the curve more than once.
Example
y y
x x
Graph. Not a graph.
Functions 6 / 30
Piecewise-defined functions
Such functions are defined by different formulas on different intervals.
Example
2
x , if x < −0.5
f (x) = 2x, if − 0.5 ≤ x ≤ 1
0.25
2, if x > 1
−0.5 1
−1
f (−2) = (−2)2 = 4
f (3) = 2
Functions 7 / 30
Transformations of functions
Functions 8 / 30
Shifts
Vertical and horizontal shifts
Let c > 0.
To obtain the graph of y = f (x) + c, shift the graph of y = f (x) a
distance c units upward.
To obtain the graph of y = f (x) − c, shift the graph of y = f (x) a
distance c units downward.
To obtain the graph of y = f (x − c), shift the graph of y = f (x) a
distance c units to the right.
To obtain the graph of y = f (x + c), shift the graph of y = f (x) a
distance c units to the left.
Functions 9 / 30
Shifts
y
c
y = f (x) + c
−c c
x
y = f (x + c) y = f (x) y = f (x − c)
−c
y = f (x) − c
Functions 10 / 30
Stretching and reflecting
Vertical and horizontal stretching and reflecting
Let c > 1.
To obtain the graph of y = cf (x), stretch the graph of y = f (x) vertically
by a factor of c.
To obtain the graph of y = c1 f (x), shrink the graph of y = f (x) vertically
by a factor of c.
To obtain the graph of y = f (cx), shrink the graph of y = f (x)
horizontally by a factor of c.
To obtain the graph of y = f (x/c), stretch the graph of y = f (x)
horizontally by a factor of c.
To obtain the graph of y = −f (x), reflect the graph of y = f (x) about
the x-axis.
To obtain the graph of y = f (−x), reflect the graph of y = f (x) about
the y -axis.
Functions 11 / 30
Vertical stretching
y
y = cf (x)
y = f (x)
y = 1c f (x)
Functions 12 / 30
Horizontal stretching
y
y = f (cx) y = f (x) y = f (x/c)
Functions 13 / 30
Reflecting
y
y = f (x)
y = −f (x)
y = f (−x)
Functions 14 / 30
Operations on functions
Functions 15 / 30
Elementary operations
The operations f + g , f − g , fg , f /g are defined in the most obvious way:
just add/subtract/multiply/divide the values of the functions f and g .
What are the domains of these functions?
Let Df be the domain of f and Dg be the domain of g .
Then
Df +g = Df ∩ Dg
Df −g = Df ∩ Dg
Dfg = Df ∩ Dg
Df /g = Df ∩ Dg ∩ {x|g (x) 6= 0}
Functions 16 / 30
Composition of functions
Definition
Let f : Df → R and g : Dg → R be two functions.
The composition of f and g (denoted f ◦ g ) is the function
(f ◦ g )(x) = f (g (x))
The domain of f ◦ g is the set of all x ∈ R such that g is defined at x
(i.e., x ∈ Dg ) and f is defined at g (x) (i.e., g (x) ∈ Df ).
Functions 17 / 30
Composition of functions
Problem
√
Let f (x) = x and g (x) = 1 − x 2 .
Find f ◦ g , g ◦ f and their domains.
Solution
p √
(f ◦ g )(x) = f (g (x)) = g (x) = 1 − x 2
Domain: x ∈ Df ◦g if and only if 1 − x 2 ≥ 0
(1 − x)(1 + x) ≥ 0
Sign of (1 − x)(1 + x):
− + −
−1 1
Df ◦g = [−1, 1]
Functions 18 / 30
Composition of functions
Solution (cont.)
√
(g ◦ f )(x) = g (f (x)) = 1 − (f (x))2 = 1 − ( x)2 = 1 − x
Domain: x ∈ Dg ◦f if and only if x ≥ 0.
Dg ◦f = [0, ∞)
Functions 19 / 30
Special kinds of functions
Functions 20 / 30
Even functions
Definition
A function f : D → R is called even if for each x ∈ D we have −x ∈ D
and f (−x) = f (x).
Example
Let f (x) = x 2 + x 4 .
Then f (−x) = (−x)2 + (−x)4 = x 2 + x 4 = f (x).
So, f is an even function.
Functions 21 / 30
Even functions
Geometrically, a function is even if and only if its graph is symmetric about
the y -axis.
f (x) = x 2 + x 4
Functions 22 / 30
Odd functions
Definition
A function f : D → R is called odd if for each x ∈ D we have −x ∈ D and
f (−x) = −f (x).
Example
Let f (x) = x + x 3 .
Then f (−x) = (−x) + (−x)3 = − x − x 3 = −f (x).
So, f is an odd function.
Functions 23 / 30
Odd functions
Geometrically, a function is odd if and only if its graph is symmetric about
the origin.
f (x) = x + x 3
Functions 24 / 30
Even and odd functions
Example
Let f (x) = x 2 + x 3 .
Then f (−x) = (−x)2 + (−x)3 = x 2 − x 3 .
f (−x) 6= f (x)
f (−x) 6= −f (x)
So, f is neither even nor odd.
Functions 25 / 30
Increasing and decreasing functions
Definition
A function f : D → R is called increasing on an interval I ⊂ D if for each
x1 , x2 ∈ I , such that x1 < x2 , we have f (x1 ) < f (x2 ).
Definition
A function f : D → R is called decreasing on an interval I ⊂ D if for each
x1 , x2 ∈ I , such that x1 < x2 , we have f (x1 ) > f (x2 ).
Graphs
increasing decreasing
Functions 26 / 30
Increasing and decreasing functions
Example
f (x) = −2x
If x1 < x2 , then −2x1 > −2x2 , i. e., f (x1 ) > f (x2 ).
f is a decreasing function.
Functions 27 / 30
One-to-one functions
Definition
Let f : D → R be a function.
f is called one-to-one if it never takes on the same value twice.
In other words, for each x1 , x2 ∈ D, x1 6= x2 we have f (x1 ) 6= f (x2 ).
Example
a) Let f (x) = x 3 . If x1 6= x2 , then x13 6= x23 . Thus f is one-to-one.
b) Let f (x) = x 2 . Take x1 = −1 and x2 = 1. We see that x1 6= x2 , but
f (x1 ) = f (x2 ). Thus f is not one-to-one.
Functions 28 / 30
One-to-one functions
Example
All increasing functions are one-to-one.
All decreasing functions are one-to-one.
Functions 29 / 30
One-to-one functions
Horizontal line test
A function is one-to-one if and only if no horizontal line intersects its
graph more than once.
Example
f (x) = x 2 f (x) = x 3
not one-to-one one-to-one
Functions 30 / 30