Introduction To Functions
Introduction To Functions
Introduction to Functions
Definition
Definition
Definition
A function f from a set D to a set Y is a rule that assigns a unique value f (x) in Y to each
x ∈ D.
f
a w
b x
c y
d z
D .. .. Y
. .
Nomenclature
Definition
A function f from a set D to a set Y is a rule that assigns a unique value f (x) in Y to each
x ∈ D.
Remark
(i) A function may be defined as a set of pairs {(a, x), (b, z), (c, x), (d, y ), ...}.
(ii) D is called the domain, Y is called the codomain of the function.
(iii) For every a ∈ D, there must be a unique y ∈ Y such that f (a) = y . f (a) = y is called the
image of a.
(iv) The range R = {f (x) | x ∈ D} of f is a subset of the codomain R ⊆ Y that contains all
the images of f .
(v) In this course, D is always a subset of R and Y = R.
(vi) If the domain of f is not stated explicitly or restricted by context, the domain is assumed
to be the largest set of real x-values for which the formula gives real y -values. This is
called the natural domain of f .
Example
1. f (x) = x 2 , −2 ≤ x ≤ 2.
▶ The domain is [−2, 2].
▶ The range is [0, 4].
2. f (x) = x1 .
▶ The natural domain is R \ {0}.
▶ The range is R \ {0}.
√
3. f (x) = x.
▶ The natural domain is [0, ∞).
▶ The range is [0, ∞).
√
4. f (x) = 1 − x 2 .
▶ The natural domain is [−1, 1].
▶ The range is [0, 1].
Example
0, x < 0
5. Piecewise functions: f (x) = .
1, x ≥ 0
▶ The domain is divided into 2 sets, with a different rule for each sets.
▶ When x < 0, f (x) = 0.
▶ When x ≥ 0, f (x) = 1.
x, x ≥ 0
6. Modulus, or absolute value: f (x) = |x| = .
−x, x < 0
▶ This is a piecewise function.
▶ Examples: |2| = 2 since 2 ≥ 0, |−3| = −(−3) = 3 since −3 < 0.
7. Floor function: f (x) = ⌊x⌋.
▶ ⌊x⌋ = n whenever n ≤ x < n + 1.
▶ Examples: ⌊2.4⌋ = 2, ⌊1.9⌋ = 1, ⌊3⌋ = 3, ⌊−0.3⌋ = −1.
8. Ceiling function: f (x) = ⌈x⌉.
▶ ⌈x⌉ = n whenever n − 1 < x ≤ n.
▶ Examples: ⌈2.4⌉ = 3, ⌈1.9⌉ = 2, ⌈3⌉ = 3, ⌈−0.3⌉ = 0.
Graph of a Function
Graph of a Function
Definition
Let f be a function with domain D. The graph of f consists of the points in the Cartesian
plane (xy -plane, denoted as R2 = R × R),
1. f (x) = x 2
f (x) = x 2 4
−4 −3 −2 −1 1 2 3 4
Example
https://www.geogebra.org/calculator
2. f (x) = |x|.
f (x) = |x| 8
−8 −6 −4 −2 2 4 6 8
−2
Example
https://www.geogebra.org/calculator
3. f (x) = ⌊x⌋.
−3 −2 −1 1 2 3
−1
−2
Verticle Line Test for a Function
▶ For a function f with domain D, and any x ∈ D, there must be a unique y such that
f (x) = y .
▶ For a curve to be the graph of a function, the vertical line x = a must intersect the curve
at a single point (a, f (a)).
Example
The curve is not a graph since the vertical line x = a cuts the curve twice for all a > 0.
3 y2 = x
−1 2 4 6
−3
Operations on Functions
Addition, Subtraction, Multiplication, Division
Binary Operations
Let f be a function with domain Df , and g a function with domain Dg . Define new functions
as follows.
Addition: (f + g )(x)= f (x) + g (x).
Domain of f + g is Df ∩ Dg .
(f ◦ g )(x) = f (g (x)).
Df ◦g = {x ∈ Dg | g (x) ∈ Df }.
Dg Df
f ◦g
Df ◦g
g f
x g (x) f (g (x))
Example
https://www.geogebra.org/m/jqzvk84g
1. Shifting: Let g (x) = x + k for some constant k ∈ R. Then for any function f (x),
x 3 +x 2 −6x
5
+3
Vertical shift: (g ◦ f )(x) = f (x) + k. 6 x 3 +x 2 −6x
5
+1
Shifts the graph of f up by k units if 3 x 3 +x 2 −6x
5
k > 0. x 3 +x 2 −6x
5
−2
Shifts the graph of f down by |k| units if −4 4 8
k < 0. −3
−6
(x + 3)2(x + 1)2 x 2 6 (x − 2)2
Horizontal shift: (f ◦ g )(x) = f (x + k).
Shifts the graph of f left by k units if
k > 0. 3
Shifts the graph of f right by |k| units if
k < 0.
−6 −4 −2 2 4
Example
https://www.geogebra.org/m/jqzvk84g
2. Scaling: Let g (x) = cx for some positive real number c > 0. Then for any function f (x)
√
Vertical scaling: (g ◦ f )(x) = cf (x). 6 2 x
Stretches the graph of f vertically by a 4 √
factor of c if c > 1. x
2
1√
Compresses the graph of f vertically by a 3 x
1
factor of c units if 0 < c < 1. 2 4 6 8
−2
1
2 x 2 (2x)2
Horizontal scaling: (f ◦ g )(x) = f (cx). 2x 9
Compresses the graph of f horizontally by
6
a factor of c if c > 1.
3
Stretches the graph of f horizontally by a
factor of c1 units if 0 < c < 1.
−6 −4 −2 2 4
Example
https://www.geogebra.org/m/jqzvk84g
3 f (x) = x 3 − 4x 2 + 3x
−2 2
f (−x) −f (x)
−3
Example
f (x) = x 3 − 4x 2 + 3x
3
4. Modulus: Let g (x) = |x|. Then for any
function f (x),
Reflecting the negative y :
(g ◦ f )(x) = |f (x)|. −4 −2 2
Symmetric along the y -axis:
(f ◦ g )(x) = f (|x|).
−3
f (|x|) 3
|f (x)| 3
−4 −2 2
−4 −2 2
Question
Let f (x) = x + 1 and g (x) = x 2 . Then (f ◦ g )(x) is
(i) (x + 1)2
(ii) x 2 + 1
Definition
A function of the form f (x) = mx + c, for some m, c ∈ R, is called a linear function.
Remark
(i) m is called the gradient and c is called the y -intercept.
(ii) If m = 0, f (x) = c is called a constant function.
(iii) if m = 1 and c = 0, f (x) = x is called the identity function.
Polynomial
Definition
A function p is a polynomial if it has the expression
Remark
(i) All polynomials have natural domain R = (−∞, ∞).
(ii) The integer n is called the degree of p, denoted as deg(p)=n.
(iii) The constant an , an−1 , ..., a1 , a0 ∈ R are called coefficients of the polynomial.
(iv) Linear functions are degree 1 polynomial, with a1 = m and a0 = c.
(v) Degree 2 polynomials are called quadratic functions, degree 3 polynomials are called cubic
functions, degree 4 polynomials are called quartic functions,... .
Example
Rational Functions
Definition
A rational function is a quotient of polynomials,
p(x)
f (x) = ,
q(x)
Remark
(i) The natural domain of a rational function is the set of all reals x for which q(x) ̸= 0,
{x | q(x) ̸= 0}.
(ii) Polynomials are rational function with q(x) = 1.
Example
The straight red lines approached by the graphs are called asymptotes and are not part of the
graphs.
Algebraic Functions
Definition
Any function constructed from polynomials using the following algebraic operations
(i) addition,
(ii) subtraction,
(iii) multiplication,
(iv) division,
(v) taking roots,
lies within the class of algebraic functions.
Remark
Rational functions are algebraic functions.
Transcendental Functions
Functions that are not algebraic are known as transcendental functions.
Example
1. Trigonometric functions
sin(x), cos(x), tan(x), ...
3. Exponential functions
ax , e 2x , 10−x , ...
4. Logarithmic functions
loga (x), ln(x), lg(x), ...
5. Hyperbolic functions
sinh(x), cosh(x), tanh(x), ...
Injective and Inverse
Injective
Definition
A function f is injective (or one-to-one) on a domain D if f (x1 ) ̸= f (x2 ) whenever x1 ̸= x2 in
D.
f
x1 y1
x2 y2
x3 y3
x4 y4
D .. ..
. .
Example
x2
2
1. f (x) = x is not injective in its natural domain
R.
2. f (x) = x 2 is injective in the domain [0, ∞).
Remark
Horizontal line test for injectivity.
A function y = f (x) is injective if and only if its graph intersects each horizontal line y = b at
most once.
Inverse
Definition
Suppose that f is an injective function on a domain D with range R. The inverse function f −1
is defined by
f −1 (b) = a if f (a) = b.
The domain of f −1 is R and the range of f −1 is D.
Theorem
(i) (Inverse is unique) If g1 and g2 are inverses of f , then g1 = g2 .
(ii) g is the inverse of f if and only if (g ◦ f )(x) = x = (f ◦ g )(x) are the identity functions.
Proof.
Exercise.
Caution
−1 1
f −1 (x) ̸= (f (x)) = .
f (x)
Finding the Inverse of a Function
Solve for x in terms of y (make x the subject of Reflecting along the line y = x.
the formula).
x = 12 y + 1
1
1. y = 2x + 1.
1
2x +1
y =x
x2
√
2. y = x 2 , x ≥ 0. x
y =x
Transcendental Functions
Trigonometric Functions
Definition
For any angle θ, let lθ be the ray starting from the origin, such that the angle between lθ and
positive x-axis is θ. Let C be the circle of radius 1 centered at the origin. Let (xθ , yθ ) be the
point of intersection between lθ and C ,
lθ ∩ C = {(xθ , yθ )}.
Cosine graph
https://www.geogebra.org/m/MjFgAfBv
Sine graph
https://www.geogebra.org/m/S2gMrkbD
Reciprocal of trigonometric Functions
Definition
Secant:
1 (2k + 1)π
sec(θ) = , θ ̸= , k ∈ Z.
cos(θ) 2
Cosecant:
1
csc(θ) = , θ ̸= kπ, k ∈ Z.
sin(θ)
Cotangent:
1 cos(θ)
cot(θ) = = , θ ̸= kπ, k ∈ Z.
tan(θ) sin(θ)
Arc trigonometric Functions
Definition
Arccosine:
cos−1 (θ) = inverse of cos .
Arcsine:
sin−1 (θ) = inverse of sin .
Arctangent:
tan−1 (θ) = inverse of tan .
Exercise: Restrict the domains so that the arc trigonometric functions are well-defined.
Trigonometric Identities
(By Pythagoras theorem)
(Additional Formula)
(Product-Sum Identities)
(Product Identities)
sin(A+B)+sin(A−B)
sin(A) cos(B) = 2
cos(A+B)+cos(A−B)
cos(A) cos(B) = 2
cos(A−B)−cos(A+B)
sin(A) sin(B) = 2
Definition
The exponential function with base a is the function
f (x) = ax ,
where a > 0.
Remark
If a = 1, then f (x) = 1 is a constant function. So, may assume a ̸= 1.
Question
Match the exponential function to its graph.
40
(i) f (x) = 10x
20
−6 −4 −2 2 4
(a)
1 x
(ii) f (x) = 3 40
20
−6 −4 −2 2 4
(iii) f (x) = e x , where e ≈ 2.718281828459045 (b)
is the Euler’s (or natural) number. 40
20
−6 −4 −2 2 4
(c)
Rules for Exponents
ax
2. ay = ax−y ,
y
3. (ax ) = axy ,
4. ax · b x = (ab)x ,
ax a x
5. bx = b
Logarithmic Functions
Definition
The logarithm function with base a, denoted as
y = loga (x),
Remark
(i) Similarly, we will require a > 0 and a ̸= 1.
(ii) loga (x) = y ⇔ x = ay .
(iii) lg(x) := log10 (x) is the logarithmic function with base 10.
(iv) ln(x) := loge (x), called the natural log, is the logarithmic function with base e, the Euler
(or natural) number.
(v) The natural domain of loga (x) is R+ = (0, ∞).
Properties of Logarithmic Functions
Algebraic properties
1. (Product rule) loga (x1 x2 ) = loga (x1 ) + loga (x2 )
2. (Quotient rule) loga xx21 = loga (x1 ) − loga (x2 )
Inverse properties
1. loga (a) = 1
2. aloga (x) = x
3. loga (ax ) = x
Definition
A function f is an
even function of x if f (−x) = f (x),
odd function of x if f (−x) = −f (x),
for every x in the function’s domain.
Example
1. f (x) = x is an function.
2. f (x) = x 2 is an function.
3. f (x) = x n is an function if n is .
Question
Exercise: Which trigonometric functions are odd functions, which are even?
Increasing and Decreasing Functions
Definition
Let f be a function defined on an interval I and let x1 and x2 be two distinct points in I .
If f (x1 ) < f (x2 ) whenever x1 < x2 , then f is said to be increasing on I .
If f (x1 ) > f (x2 ) whenever x1 < x2 , then f is said to be decreasing on I .
A function that is increasing or decreasing on I is said to be monotonic on I .
Remark
We say that a function is non-decreasing if f (x1 ) ≤ f (x2 ) whenever x1 < x2 , and a function is
non-increasing if f (x1 ) ≥ f (x2 ) whenever x1 < x2 .
Question