STK110 Math notes - Quarter 1, 2025 (2)
STK110 Math notes - Quarter 1, 2025 (2)
Department of Statistics
Quarter 1, 2025
Contents
1 Introduction 3
1.1 Linear functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Linear inequalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Quadratic functions (parabolas) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Absolute values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.1 Piecewise functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.2 The Absolute Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4.3 Absolute value equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4.4 Absolute value inequalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Differentiation 14
2.1 The limit of a function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2 Continuity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3 Rates of change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.4 Rules of differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.5 The derivatives of inverse functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.6 The derivatives of special functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.7 Higher order derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.8 Optimisation problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.8.1 Maximum and minimum points of a function . . . . . . . . . . . . . . . . . . . . . . 30
2.8.2 The basics of partial differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3 Integration 36
3.1 Indefinite integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.2 Definite integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3 Some economic applications of integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.3.1 Indefinite integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.3.2 Definite integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.3.3 More examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
1
CONTENTS CONTENTS
4 Matrices 49
4.1 Introduction to matrix concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.2 Matrix operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.2.1 Matrix addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.2.2 Matrix subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.2.3 Transpose of a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.2.4 Scalar multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.2.5 Matrix multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2.6 The identity matrix (I) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.3 The determinant of a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.1 The determinant of a 2 × 2 matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.2 The determinant of a 3 × 3 matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.4 Cramer’s rule used to solve a system of linear equations . . . . . . . . . . . . . . . . . . . . 57
4.4.1 Set of two linear equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.4.2 Set of three linear equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.5 The inverse of a matrix used to solve a system of linear equations . . . . . . . . . . . . . . . 59
4.6 Practical applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.7 Excel functions for matrix algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.7.1 Calculating the transpose of a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.7.2 Calculating the determinant of a matrix . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.7.3 Calculating the inverse of a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.7.4 Multiplying two matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5 Linear Programming 66
5.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5.2 The graphical solution method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.3 The extreme point method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.4 More examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
©Copyright reserved 2
1 INTRODUCTION
1 Introduction
This document is based on the recommended textbook of Swanepoel, A; Vivier, FL; Millard, SM; Ehlers,
R: Quantitative Statistical Techniques. (3rd ed.)
This study theme is mainly self-study, comprising of basic mathematical concepts of which the majority
has already been done at school level.
Example 1.1. Obtain the equation of the line, y = 7x + a, which passes through the point (−5; 12).
Solution 1.1. It is given that (x; y) = (−5; 12) and by replacing that into the linear equation we obtain:
y = 7x + a
12 = 7(−5) + a
12 = −35 + a
a = 47
©Copyright reserved 3
1.1 Linear functions 1 INTRODUCTION
Solution 1.2. The solutions for each of the lines A, B and C are discussed below.
Line A: Horizontal line through y-axis, without a gradient: y = bx+a where b = 0, therefore y = a = 30
[a is known as the y-intercept of the equation].
Line C: Line with intercepts known. A linear equation can be written in the form:
x y
+ =1
x − intercept y − intercept
x y
+ =1
30 10
(multiply equation by lowest common denominator, i.e., 30)
x + 3y = 30
(the line can be written in the y = bx + a form)
1
3y = −x + 30 therefore y = − x + 10
3
y = 3x + 4
y = −x + 2
©Copyright reserved 4
1.2 Linear inequalities 1 INTRODUCTION
Solution 1.3. From the above graph, we can see that there is exactly one (x, y) pair where both linear
equations are equal. Algebraically, we can solve this point of intersection by setting the two equations
equal, and solving for x.
3x + 4 = −x + 2 ∴ 3x + x = 2 − 4
1
4x = −2 ∴ x = −
2
1
Substituting x = − into y = 3x + 4 (or y = −x + 2) we get
2
1 3 8 5 1
y=3 − +4=− + = =2
2 2 2 2 2
1 1
It follows that the equilibrium point is − , 2
2 2
Note: The line is included (solid line) because of the ”≥” sign and the shaded area is above the line.
©Copyright reserved 5
1.2 Linear inequalities 1 INTRODUCTION
Solution 1.5. The line x + y < 2 can be represented in the y = bx + a form: y < −x + 2
Note: The line is excluded (dotted line) because of the ”<” sign and the shaded area is below the line.
Solution 1.6. The line y = 2 is excluded (dotted line) because of the ”<” sign and the shaded area is
below the horizontal line.
©Copyright reserved 6
1.3 Quadratic functions (parabolas) 1 INTRODUCTION
Solution 1.7. The line is included (solid line) because of the ”≥” sign and the shaded area is to the right
of the vertical line.
Remark 1. If we multiply both sides of an inequality by the same negative number, the sign of the inequality
changes.
For example, consider x − y < 2. Make y the subject of the formula by following the steps below:
1. −y < 2 − x
In Study Theme 5 (LP) a system of linear inequalities will be given, i.e., more than one linear inequality
represented on the same graph. Linear programming (LP) includes applied problems in which several
conditions expressed as linear inequalities must be satisfied at the same time.
Solution 1.8. Follow the steps below to draw the function given above:
©Copyright reserved 7
1.3 Quadratic functions (parabolas) 1 INTRODUCTION
From the above graph, we can clearly see that the system has two solutions (or two equilibrium points).
Solve for x where the system is in equilibrium.
©Copyright reserved 8
1.4 Absolute values 1 INTRODUCTION
Solution 1.9. Algebraically, we can solve for x by setting the two equations equal:
x2 − 1 = x
x2 − x − 1 = 0
It is known that when we have a function of the form a + bx + cx2 = 0, which cannot be factorized,
one can solve for x using the quadratic formula:
√
−b ± b2 − 4ac
x=
2c
In the case of our example, a = −1, b = −1 and c = 1, so it follows that
p p
1 + 1 − 4(−1)(1) 1 − 1 − 4(−1)(1)
x= ≈ 1.618 or x = ≈ −0.618
2 2
Therefore, the system is in equilibrium when x = 1.618 or x = −0.618.
Remark 2. If b2 − 4ac is negative, the square root does not exist and thus the quadratic equation a + bx +
cx2 = 0 cannot be solved.
©Copyright reserved 9
1.4 Absolute values 1 INTRODUCTION
The domain (all the values that can go into the function) is all real numbers up to and including 6, which
we can write as
Dom(f ) = (−∞, 6]
or
Dom(f ) = {x ∈ R|x ≤ 6}.
Here are some example values:
x f (x)
-4 16
-2 4
0 0
1 1
2 6
3 7
• What is h(−1)?
x is ≤ 1, so we use h(x) = 2. Thus, h(−1) = 2.
• What is h(1)?
x is ≤ 1, so we use h(x) = 2. Thus, h(−1) = 2.
• What is h(4)?
x is > 1, so we use h(x) = x. Thus, h(4) = 4.
©Copyright reserved 10
1.4 Absolute values 1 INTRODUCTION
The symbol |x| denotes the absolute value of x, which represents the non-negative of x, or the number of
x without its sign. For example, |3| = 3 or | − 3| = −(−3) = 3.
Geometrically, |x| represents the distance of x from 0 (note that distance cannot be negative).
Solution 1.10. x − 2 is the argument. The argument will either be 8, or −8. In other words,
x − 2 = 8, or x − 2 = −8.
x−2=8
x=8+2
x = 10
x − 2 = −8
x = −8 + 2
x = −6
©Copyright reserved 11
1.4 Absolute values 1 INTRODUCTION
2. |x| > c,
where c ≥ 0.
Consider the inequality |x| < 3. For this inequality to be true, what values could x have? Geometrically,
x is less than 3 units from 0 (represented below).
Now, consider the inequality |x| > 3. For which values of x will this be true? Geometrically, x is more
than 3 units away from 0 (represented below).
In general:
Example 1.11. For which values of x will the following inequality be true?
|2x − 1| < 5
Solution 1.11.
−5 < 2x − 1 < 5
−5 + 1 < 2x < 5 + 1
−4 < 2x < 6
−2 < x < 3
©Copyright reserved 12
1.4 Absolute values 1 INTRODUCTION
|1 − 2x| > 9
1 − 2x < −9 or 1 − 2x > 9
1 − 2x < −9
−2x < −9 − 1
−2x < −10
x>5
1 − 2x > 9
−2x > 9 − 1
−2x > 8
x < −4
©Copyright reserved 13
2 DIFFERENTIATION
2 Differentiation
Functions represent the relationships that exist between variables, denoted symbolically by y = f (x), e.g.
y = x + 3. Here, y is called the dependent variable and x the independent or explanatory variable or
predictor.
In the study of functions, it is easy to find the value of y that corresponds to a given value of x. In the
above example, it follows that if x = 2, then y = 2 + 3 = 5. It is also easy to determine the change in the
value of y when the value of x changes over a given interval. If x, in the above example, changes from 2 to
5, y changes from 5 to 5 + 3 = 8, i.e., the value of y increases by 3 units.
Differentiation is all about the rate of change. To study the method of differentiation, it is necessary to
first consider the concept of the limit of a function. According to Khan Academy, limits describe how a
function behaves near a point, instead of at that point.
The limit of f at x = 3 is the value f approaches as it gets closer and closer to x = 3. Approaching from
the left-hand side:
lim f (x) = lim (x + 3) = 6
x→3− x→3−
And:
lim f (x) = lim (x + 3) = 6
x→3 x→3
©Copyright reserved 14
2.1 The limit of a function 2 DIFFERENTIATION
Example 2.2. Consider the function h that is like f in every aspect but undefined at x = 3.
The limit of h at x = 3 is equal to 6 (limx→3 h(x) = limx→3 (x + 3) = 6) but, the value of h(3) is undefined
at x = 3. A possible function could be a rational function:
x2 − 9 (x + 3)(x − 3)
h(x) = = = x + 3, provided that x ̸= 3.
x−3 x−3
Another option is a piecewise function:
(
x + 3, x ̸= 3
h(x) =
undefined, x = 3
©Copyright reserved 15
2.1 The limit of a function 2 DIFFERENTIATION
It follows that
lim |x − 2| = lim (−x + 2) = 0
x→2− x→2−
lim |x − 2| = lim (x − 2) = 0
x→2+ x→2+
and subsequently:
lim |x − 2| = 0
x→2
©Copyright reserved 16
2.1 The limit of a function 2 DIFFERENTIATION
Definition 1 (A limit). When the value of the function y = f (x) approaches the single value L (or remains
constant as L) as x assumes values that approach a from both the left and right sides, then L is called the
limit of f (x) when x approaches a. The left limit is written as
lim f (x) = L
x→a−
Put differently, the difference between f (x) and L can be made arbitrarily small by confining x to a
sufficiently small interval about a, excluding x = a.
Remark 3. The essence of limits is that the value of x only approaches, but never reaches, a. The limit
of a function therefore does not depend on the value of f (x) at the point x = a, or even upon whether f (x)
is defined at that point.
Limit Theorems
Calculating limits can be simplified considerably using several theorems. The theorems are given without
proof. Assume that f (x) and g(x) are two functions of x whose limits exist when x approaches a, for
example:
lim f (x) = L
x→a
and
lim g(x) = M.
x→a
©Copyright reserved 17
2.2 Continuity 2 DIFFERENTIATION
5x(x − 8)
lim
x→2 3x2 − 2x
Remark 4. Although the limit of a function at a specific point does not depend on the value of the function
at that point (see Remark 3), results from various examples indicate that the following is often true:
The question of whether there is a specific rule or pattern to determine when this will be true, arises. The
answer is that it will always be true, provided that f (x) is a continuous function.
2.2 Continuity
The behavior of a function at or close to a point is strongly influenced by its continuity or lack of continuity
at that point. Continuity can be defined as follows:
1. f (a) is defined,
Definition 3. A function f (x) is continuous in an interval if it is continuous at each point of the interval.
A function which is not continuous is said to be discontinuous.
©Copyright reserved 18
2.3 Rates of change 2 DIFFERENTIATION
Example 2.6. The function y = −x2 + 10x − 9 is continuous at the point x = 5, since
18
16
y
14
12
10
8
6
4
2
0
-2 0 1 2 3 4 5 6 7 8 9 10 11
-4 x
-6
-8
-10
Example 2.7. The function h(x) in Example 2.2 is discontinuous at the point x = 3, since, although
condition (ii) of Definition 2 is satisfied. That is,
lim f (x) = 6,
x→3
• Average rate of change (ARC) over the interval [x1 , x2 ] → Slope of the line segment.
©Copyright reserved 19
2.3 Rates of change 2 DIFFERENTIATION
Example 2.8 (ARC). The supply of a certain product (in 1000) is given by the following function:
y = f (x) = 6x + x2
The average rate of change in the example above can generally be visualized by the figure below. Consider
the curve y = f (x) and two points on the curve, P (x, f (x)) and Q(x + h, f (x + h)). The slope of the line
segment P Q is given by:
f (x + h) − f (x) f (x + h) − f (x)
mP Q = =
(x + h) − x h
Suppose point P is held fixed and point Q is moved along the curve towards P . If the curve is
continuous, the distance between x and x + h will get infinitely small, implying the limit that h tends to
is zero. Instead of calculating the slope of a line segment, the slope of the tangent line at P is calculated,
called the instantaneous rate of change (IRC) at P . That is,
f (x + h) − f (x)
IRC at x = lim
h→0 h
©Copyright reserved 20
2.4 Rules of differentiation 2 DIFFERENTIATION
f (x + h) − f (x)
IRC = f ′ (x) = lim
h→0 h
(x + h) − x2
2
= lim
h→0 h
x + 2xh + h2 − x2
2
= lim
h→0 h
2xh + h2
= lim
h→0 h
= lim (2x + h)
h→0
= 2x + 0
= 2x
• Dx y or Dx f (x)
Rule 1
©Copyright reserved 21
2.4 Rules of differentiation 2 DIFFERENTIATION
Rule 2
3. f (x) = x1
You cannot differentiate a function in the denominator; rewrite as a power function first:
f (x) = x1 = x−1
then f ′ (x) = −1 · x−1−1 = −1x−2 = − x12
√
3
4. y = x2
You √
cannot differentiate a function inside a root; rewrite as a power function first:
3
y = x2 = x2/3
dy
then dx = 23 x2/3−3/3 = 32 x−1/3
5. f ′ (x) = √1
x
= x−1/2
−1 −1/2−2/2
then f ′ (x) = 2 x = − 21 x−3/2
Rule 3
1
2. f (x) = 2x
You cannot differentiate a function in the denominator; keep the constant as given, and only write
the the variable as a power function (moving into the numerator)
−1
f (x) = x 2
−2
then f ′ (x) = −x2 = − 2x12
©Copyright reserved 22
2.4 Rules of differentiation 2 DIFFERENTIATION
Rule 4
√ 1 dr dr
2. r = 2t − t + 2s. Calculate ds and dt .
First, we calculate: dr
ds = 2 · 1 · s
1−1 = 2
then √ √
dr √ 1 −1/2 −2 2 −1/2 −2 2 −1/2 1
= 2· t − (−1)t + 0 = t +t = t + 2
dt 2 2 2 t
Example 2.10 (Rules 1 to 4). The price of a product (in Rand) depends on the quantity of the product
sold, and is given by:
p = 350 − 0.08q − 0.002q 2
Solution 2.10.
1. For q = 40 we find
The sales price will increase with R334 if the number of products increases from 40 to 41.
©Copyright reserved 23
2.4 Rules of differentiation 2 DIFFERENTIATION
1. f (x) = x2 (x − 6) then
f ′ (x) = x2 · 1 + (x − 6) · 2x = x2 + 2x2 − 12x = 3x2 − 12x
−3
3. Let r = x13 . We could calculate dx
dr
by rewriting r as r = x−3 and we get dr
dx = (−3)x−4 = x4
. This
same question could also be answered using the quotient rule:
dr x3 · 0 − 1 · 3x2 3x2 3
= 3 2
= − 6
=− 4
dx (x ) x x
dy 1
= (2x + 5)5 · (3x2 + 7)−1/2 · 6x + (3x2 + 7)1/2 · 5(2x + 5)4 · 2
dx 2
= (2x + 5) (3x2 + 7)−1/2 · 3x + 10(3x2 + 7)1/2 (2x + 5)4
5
©Copyright reserved 24
2.4 Rules of differentiation 2 DIFFERENTIATION
Example 2.11. This example will be discussed in class, but you must try it first and then bring your
calculations to class.
©Copyright reserved 25
2.5 The derivatives of inverse functions 2 DIFFERENTIATION
1
Example 2.12. Calculate the equation of the tangent line of the function f (x) = x−1 at x = 3.
Solution 2.12. The equation of a line can be obtained using the equations
y = y1 + m(x − x1 )
or
y = mx + c
where m is the gradient and c the y-intercept of the line. Thus, we have
1 1
f (3) = = at x=3
3−1 2
The point (x1 ; y1 ) is then (3; 1/2). For the gradient we have
1
m = f ′ (x) = −(x − 1)−2 ∴ f ′ (3) = −(3 − 1)−2 = −
4
Thus, for y = y1 + m(x − x1 ) we have
1 1 1 5
y= − (x − 3) = − x +
2 4 4 4
y = 3x + 2
3x = y − 2
1 2
x= y− (Inverse function)
3 3
x = g(y) = f −1 (y) (Inverse function)
dx 1
dy = y −2/3
= 3(x − 2)2 dy 3
dx
©Copyright reserved 26
2.6 The derivatives of special functions 2 DIFFERENTIATION
2
1. g(x) = e3x +7x+2 then
2
g ′ (x) = e3x +7x+2 (6x + 7)
2 5
2. f (x) = e(3x+x ) then
2 5
f ′ (x) = e(3x+x ) 5(3x + x2 )4 (3 + 2x)
x
3. f (x) = e3x(e +1) then
f ′ (x) = e3x (ex + 1)(3xex + (ex + 1)3)
(3x+1)5
4. g(x) = e2x
then
e2x 5(3x+1)4 3−(3x+1)5 e2x 2 15e2x (3x+1)4 −2(3x+1)5 e2x
g ′ (x) = e4x
= e4x
Example 2.13. The demand of a product is given by d = f (p) = 980pe−0.38p , where d is the demand in
thousands and p is the price of the product in Rand.
©Copyright reserved 27
2.6 The derivatives of special functions 2 DIFFERENTIATION
Example 2.14. This example will be discussed in class, but you must try it first and then bring your
calculations to class.
2
The demand (in 100) for a PSP-player in terms of price (in R1000) is given by: D = e−0.2p for p > 0
©Copyright reserved 28
2.7 Higher order derivatives 2 DIFFERENTIATION
dy
If y = ln x, then dx = x1
dy 1 ′ f ′ (x)
If y = ln f (x), then dx = f (x) f (x) = f (x)
dy 15x2 3
1. y = ln(5x3 ), then dx = 5x3
= x
4
2. f (x) = e3x ln(x5 ) then f ′ (x) = e3x 5x
x5
+ ln(x5 )e3x · 3 = e3x x5 + 3 ln(x5 )e3x
5(2x + 1)4 · 2 10
f ′ (x) = 5
=
(2x + 1) 2x + 1
f (iv) (x) = 24
f (v) (x) = 0
2 −7
Example 2.16. Calculate the second-order derivative of f (x) = e3x .
2 −7
f ′ (x) = e3x · 6x
2 −7 2 −7 2 −7 2 −7
f ′′ (x) = e3x · 6 + 6xe3x · 6x = 6e3x + 36xe3x
©Copyright reserved 29
2.8 Optimisation problems 2 DIFFERENTIATION
• Consider f ′ (x) = 0. How do we test if k will lead to a relative min or relative max? Calculate f ′′ (x):
Figure (a): Rel max in the point k Figure (b): Rel min in the point k
©Copyright reserved 30
2.8 Optimisation problems 2 DIFFERENTIATION
Example 2.17 (Optimisation with one critical value). Calculate the extreme and critical value(s) for:
f (x) = 16x − x2
f ′ (x) = 16 − 2x
f ′′ (x) = −2
Critical value(s):
Set f ′ (x) = 0 ∴ 16 − 2x = 0 ∴ x = 8
Therefore, x = 8 is a critical value.
Example 2.18 (Optimisation with two critical value). Calculate the extreme and critical values for:
Critical values:
Set f ′ (x) = 0 ∴ 12x3 − 12x2 ∴ 12x2 (x − 1) = 0 ⇒ x = 0 or x = 1
Therefore, x = 0 and x = 1 are the critical values.
x −0.1 0 0.1
f (x) = 3x4 − 4x3 3(−0.1)4 − 4(−0.1)3 = 0.0043 3(0)4 − 4(0)3 = 0 3(0.1)4 − 4(0.1)3 = −0.0037
©Copyright reserved 31
2.8 Optimisation problems 2 DIFFERENTIATION
Example 2.19 (Application 1). The cost (in Rand) to manufacture x products is given by:
P ′ (x) = −0.1x + 50
P ′′ (x) = −0.1
Critical value(s):
Set P ′ (x) = 0 ∴ −0.1x + 50 = 0 ⇒ x = 500
Therefore, x = 500 is a critical value.
Example 2.20 (Application 2: optimisation with one critical value). A manufacturer produces garden
chairs at a cost of R20 a chair, and his overhead cost is R3000 a week. From previous experience he knows
that he will sell 2000 − 40x chairs a week if he charges Rx a chair. What must the price be, and how many
chairs must he sell per week, to maximize his profit?
Given:
• Sales price: Rx
©Copyright reserved 32
2.8 Optimisation problems 2 DIFFERENTIATION
Solution 2.20.
Profit per chair: x − 20 (price − cost)
Total profit:
P (x) = (2000 − 40x)(x − 20) − 3000 (profit per item × quantity − fixed cost)
P (x) = (2000 − 40x)(x − 20) − 3000 = 2800x − 40x2 − 43000
Critical value(s):
Set P ′ (x) = 0 ∴ 2800 − 80x = 0 ∴ x = 35
Therefore, x = 35 is a critical value.
Example 2.21 (Gross profit and net profit). Know what the terms ”gross profit” and ”net profit” mean.
An analysis of the financial statements of a coal mine indicates that when x tons of coal are extracted per
day, the income and cost (in Rands) of the mine are, respectively, given by:
I ′ (x) = 1210 − 4x
I ′′ (x) = −4
Critical value(s):
Set I ′ (x) = 0 ∴ 1210 − 4x = 0 ⇒ x = 302.5
Therefore, x = 302.5 is a critical value.
2. Calculate the gross profit and the value of x that maximises the gross profit.
GP (x) = I(x) − C(x) = 1210x − 2x2 − (x2 − 2x + 1000) = 1212x − 3x2 − 1000
©Copyright reserved 33
2.8 Optimisation problems 2 DIFFERENTIATION
GP ′ (x) = 1212 − 6x
GP ′′ (x) = −6
Critical value(s):
Set GP ′ (x) = 0 ∴ 1212 − 6x = 0 ⇒ x = 202
Therefore, x = 202 is a critical value.
3. Calculate the net profit and the value of x that maximises the net profit.
N P (x)
= GP (x) − 0.4GP (x) or N P (x) = 0.6GP (x)
= 1212x − 3x2 − 1000 − 0.4(1212x − 3x2 − 1000)
= 727.2x − 1.8x2 − 600
Critical value(s):
Set N P ′ (x) = 0 ∴ 727.2 − 3.6x = 0 ⇒ x = 202
Therefore, x = 202 is a critical value.
∂z
∂x = 35 − 0.1x + 0.03y
∂z
∂y = 32 − 0.08y + 0.03x
©Copyright reserved 34
2.8 Optimisation problems 2 DIFFERENTIATION
∂z
∂x = 35 − 0.1(100) + 0.03(150) = 29.5
The cost increases with R29.50 if an extra unit of product X is produced, when there are 150 units
of product Y produced (i.e., product Y is kept constant at 150).
∂z
∂y = 32 − 0.08(150) + 0.03(100) = 23
The cost increases with R23.00 if an extra unit of product Y is produced, when there are 100 units
of product X produced (i.e., product X is kept constant at 100).
∂z 3
= 6x + e(x −2y) (3x2 )
∂x
∂z 3
= e(x −2y) (−2)
∂y
2. z = 5x ln(x2 + 7y)
∂z 2x
= 5x 2 + ln(x2 + 7y)·5
∂x x + 7y
∂z 7 35x
= 5x 2 + ln(x2 + 7y)·0 = 2
∂y x + 7y x + 7y
The total production cost (in R100) of a factory per year, is a function of the number of spare parts
produced (in 1000) and the number of workers employed, namely:
C(p, w) = p2 + 2p + w2 − 10w − pw + 60
Where p is the number of spare parts produced (in 1000) and w is the number of labourers.
∂C(p, w)
= 2p + 2 − w
∂p
∂C(p, w)
= 2w − 10 − p
∂w
©Copyright reserved 35
3 INTEGRATION
3 Integration
Integration concerns the converse of the differentiation process: the original function must be recovered
from a given derived function. See the diagram below:
Why the constant c in integration? Say the original function is y = f (x) = x3 +5. If you differentiate
the function you get:
d(x3 + 5)
= 3x2 + 0
dx
Now the derivative is integrated, and the original function should be recovered.
3x3
Z
3x2 dx = = x3
3
But this is not exactly the original function. Therefore, a constant c is added to x3 to compensate for the
constant that became zero when differentiated. That is,
Z
3x2 dx = x3 + c .
©Copyright reserved 36
3.1 Indefinite integrals 3 INTEGRATION
Rule 1
Z
1
xn dx = xn+1 + c for n ̸= −1
n+1
x6
Z
1. x5 dx = +c
6
x−1
Z Z
1 −2 1
2. dx = x dx = +c=− +c
x2 −1 x
Note: You do not integrate the function in the denominator. Move the variable to the numerator
as a power function.
Z √ Z 5 5
3 2x 2
x2
3. x3 dx
= x dx = 5 + c = 2 +c
2
5
Note: You do not integrate the function in the root. Rewrite as a power function.
x2
Z Z
4. x dx = x1 dx = +c
2
Rule 2
Z Z
xf (x) dx = k f (x) dx
x−8 −100
Z Z Z
800 1
1. dx = 800 dx = 800 x−9 dx = 800 +c= +c
x9 x9 −8 x8
x1
Z Z
2. 8 dx = 8x0 dx = 8 + c = 8x + c
1
©Copyright reserved 37
3.1 Indefinite integrals 3 INTEGRATION
Rule 3
Z
ex dx = ex + c
Z
f ′ (x)ef (x) dx = ef (x) + c
Z
2 +5x 2 +5x
1. (10x + 5)e5x dx = e5x +c
Z Z
2 1
2x3 +3x2 3 2 1 3 2
2. (x + x)e dx = 6(x2 + x)e2x +3x dx = e2x +3x + c
6 6
Note: The function next to ef (x) should be f ′ (x); a constant can be used for correction. If you
correct with 6 inside, you have to times by 61 outside the integral, 16 · 6 = 1
Z Z
2x
3. 16e dx = 8 2e2x dx = 8e2x + c
Z Z Z
− x4 − x4 1 −x x
4. 4e dx = 4 e dx = 4(−4) − e 4 dx = −16e− 4 + c
4
Rule 4
Z
1
dx = ln(x) + c, x > 0
x
1
R
The answer could also be given as x dx = ln |x| + c.
f ′ (x)
Z
dx = ln(f (x)) + c, f (x) > 0
f (x)
R ′ (x)
The answer could also be given as ff (x) dx = ln |f (x)| + c.
Z Z
1 1 1 1
1. dx = dx = ln |x| + c
2x 2 x 2
Z
6x + 1
2. dx = ln |3x2 + x| + c
3x2 + x
©Copyright reserved 38
3.2 Definite integrals 3 INTEGRATION
Rule 5
Z
1
f ′ (x)[f (x)]n dx = [f (x)]n+1 + c for n ̸= −1
n+1
(x2 + 2x + 1)6
Z
1. (2x + 2)(x2 + 2x + 1)5 dx = +c
6
3
(x2 + 3) 2
Z Z Z
1 1 3
p
2 2
4. 2
6x x + 3 dx = 6x(x + 3) 2 dx = 3 2x(x + 3) 2 dx = 3 3 + c = 2(x2 + 3) 2 + c
2
Rule 6
Z Z Z
[f (x) + g(x)] dx = f (x) dx + g(x) dx
Z Z Z
[f (x) − g(x)] dx = f (x) dx − g(x) dx
x3 2x2
Z Z Z Z
1. (x2 + 2x − 1) dx = x2 dx + 2x dx − dx = + −x+c
3 2
• Definite integral
Z b
f (x) dx = [F (x)]ba = F (b) − F (a)
a
A definite integral has a definite numerical limit. This value may geometrically be interpreted to be
a particular area under a given curve.
Consider the area under the continuous curve, y = f (x), between a and b represented in the figures on the
following page. The shaded area A, enclosed by the curve y = f (x) and the x - axis between the points
x = a and x = b in the domain, is to be determined. In the figure to the left, the area under the curve is
divided into four rectangles. The width of the first rectangle is ∆x1 = x2 − x1 and height f (x1 ). The area
of this rectangle is f (x1 ) ∆x1 . In general, the ith rectangle’s width is ∆xi = xi+1 − xi and height f (xi ).
©Copyright reserved 39
3.2 Definite integrals 3 INTEGRATION
The approximate total area for the figure to the left above is given by:
4
X
A∗ = f (xi )∆xi
i=1
Note that A∗ is an overestimate of the true value of A, because of the unshaded triangular portions not
under the curve. If the unshaded portions can be reduced in size and become close to zero, the approximate
value of A∗ will correspondingly approach the true value of A. This result will be achieved if the number
of rectangles (n) increases and the width of the rectangles is shortened indefinitely, for example, the figure
to the right. Performing this operation at a limit, we obtain the true area A.
Z b n
X n
X
f (x) dx = f (xi )∆xi = A∗ = area A
a i=1 i=1
Remark 5. When n → ∞, then the limit of the sum operation can be substituted by the definite integral
sign from a to b and f (xi )∆xi = f (x) dx because infinitely small changes are made in the width of the
Rb
rectangles. a f (x) dx is referred to as a Riemann integral.
Property 1: The interchanging of the limits of integration changes the sign of the definite integral.
Z a Z b
f (x) dx = − f (x) dx
b a
5 5
x3 53 13
Z
124
x2 dx = = − =
1 3 1 3 3 3
1 1 5 1
x3 13 53
Z Z Z
2 124 2
x dx = = − =− . Therefore x dx = − x2 dx.
5 3 5 3 3 2 1 5
©Copyright reserved 40
3.2 Definite integrals 3 INTEGRATION
Property 2: A definite integral has a value of zero when the two limits are identical.
Z b
f (x) dx = 0
a
3 3
x4 34 34
Z
x3 dx = = − =0
3 4 3 4 4
Property 3
Z b Z b
−f (x) dx = − f (x) dx
a a
3 3
x4 34 14
Z
80
−x3 dx = − =− + = − = −20
1 4 1 4 4 4
3 4 3 4
14
Z
x 3 80
− x3 dx = − =− − =− = −20
1 4 1 4 4 4
Property 4
Z b Z b
kf (x) dx = k f (x) dx
a a
3 3
4x4
Z
3
4x dx = = 34 − 14 = 81 − 1 = 80
1 4 1
!
3 3
x4 34 14
Z
3 80
4 x dx = 4 =4 − =4· = 80
1 4 1 4 4 4
Property 5
Z b Z b Z b
[f (x) ± g(x)] dx = f (x) dx ± g(x) dx
a a a
3 3 3 3 3
x4 34 14
Z Z Z
3 3
(x + 1) dx = x dx + 1 dx = +x = − + (3 − 1) = 20 + 2 = 22
1 1 1 4 1 1 4 4
©Copyright reserved 41
3.2 Definite integrals 3 INTEGRATION
Property 6
Z d Z b Z c Z d
f (x) dx = f (x) dx + f (x) dx + f (x) dx (where q < b < c < d)
a a b c
Z3 3
3 x4 34 14
x dx = = − = 20
4 1 4 4
1
Z5 5
x4 54 34
x3 dx = = − = 136
4 3 4 4
3
Z5 5
x4 54 14
x3 dx = = − = 156
4 1 4 4
1
Z5 Z3 Z5
Therefore, f (x) dx = f (x) dx + f (x) dx
1 1 3
Example 3.1 (Property 6). Calculate the area between the function f (x) = x3 , the x-axis, the line x = −3
and the line x = 5.
5 5
x4 (5)4 (−3)4
Z
Solution 3.1 (Incorrect method). x3 dx = = − = 156.25 − 20.25 = 136
−3 4 −3 4 4
©Copyright reserved 42
3.2 Definite integrals 3 INTEGRATION
Solution 3.1 (Correct method). Hint: Use Property 6 - The integral should be divided into two sub-
integrals, to separate the positive and negative areas.
Z 0
3
Note: We took the absolute value of the first term x dx , since this area is below the x-axis.
−3
Z 0 Z 5
3
Area = x dx + x3 dx
−3 0
x4 x4 5
= −30 + 0
4 4
04 (−3)4
4
04
5
= − + −
4 4 4 4
81 625
= − +
4 4
81 625
= +
4 4
706
= = 176.5 units2
4
Example 3.2 (Property 6). Write down the sub-integrals to represent how the shaded area can be calcu-
lated.
Solution 3.2.
Z −2 Z 0.5 Z 4 Z 4.5
f (x) dx + f (x) dx + f (x) dx + f (x) dx
−3 −2 0.5 4
or
Z −2 Z 0.5 Z 4 Z 4.5
− f (x) dx + f (x) dx − f (x) dx + f (x) dx
−3 −2 0.5 4
or
Z −3 Z 0.5 Z 0.5 Z 4.5
f (x) dx + f (x) dx + f (x) dx + f (x) dx
−2 −2 4 4
©Copyright reserved 43
3.3 Some economic applications of integrals 3 INTEGRATION
Example 3.3. Calculate the total cost function C(p) given the following:
Solution 3.3.
Z Z Z Z
′ 0.4p 0.4p 20
C(p) = C (p)dp = 20e dp = 20 e dp = 0.4e0.4p dp = 50e0.4p + c
0.4
But C(0) = 200.
D(p) = 16 − p2
S(p) = 4p + p2
p = price in Rand
Calculate the consumers’ surplus and producers’ surplus when the market is in equilibrium.
©Copyright reserved 44
3.3 Some economic applications of integrals 3 INTEGRATION
Solution 3.4.
Equilibrium price:
D(p) = S(p)
16 − p2 = 4p + p2
2p2 + 4p − 16 = 0
p2 + 2p − 8 = 0
(p + 4)(p − 2) = 0
∴ p = −4 or p=2
Consumers’ surplus:
D(p) = 0
16 − p2 = 0
(4 − p)(4 + p) = 0
∴p=4 or p ̸= −4
4 4 4
p3 43 23
Z Z
2
D(p)dp = 16 − p dp = 16p − = 16(4) − − 16(2) − = 42.6667 − 29.3333
2 2 3 2 3 3
= 13.3334 × 1000 = R13333.34
Note that the units of consumer surplus are (demand units) × (price units) = 1000 × 1 = 1000
©Copyright reserved 45
3.3 Some economic applications of integrals 3 INTEGRATION
Producers’ surplus:
S(p) = 0
4p + p2 = 0
p(4 + p) = 0
∴p=0 or p ̸= −4
(A negative value of p implies a non-economically viable price)
2 2 2
4p2 p3 (2)3
Z Z
2
S(p)dp = 4p + p dp = + = 2(22 ) + = 10.6667 × 1000 = R10666.67
0 0 2 3 0 3
Note that the units of producer surplus are (supply units) × (price units) = 1000 × 1 = 1000
©Copyright reserved 46
3.3 Some economic applications of integrals 3 INTEGRATION
Example 3.6. The rate at which a secretary’s salary (in Rand/month) changes over the number of years
in service (x), is given by:
2000x
S ′ (x) = 2
x +1
It is also known that she will earn R5084 per month after 3.5 years in service.
1. Calculate the function which expresses her monthly salary in terms of years in service.
Z Z Z
′ 2000 2x
S(x) = S (x) dx = 2
dx = 1000 2
dx = 1000 ln |x2 + 1| + c
x +1 x +1
Now use the information given on salary earned after 3.5 years’ service to determine the value of c.
©Copyright reserved 47
3.3 Some economic applications of integrals 3 INTEGRATION
Example 3.7. The marginal income from the sale of the q th book is given by:
√
I ′ (q) = 45 − 0.21 q − 0.01q with 0 ≤ q ≤ 1000
Calculate the additional income earned when sales increase from 400 to 900 books.
Z 900 Z 900
′ √
I (q)dq = (45 − 0.21 q − 0.01q)dq
400 400
3 900
q2 0.01q 2
= 45q − 0.21 3 −
2
2 400
900
3
= 45q − 0.14q − 0.005q 2
2
400
3 3
= 45(900) − 0.14(900) − 0.005(9002 ) − [45(400) − 0.14(400) 2 − 0.005(4002 )]
2
= 16590
The additional income earned is R16590.
Example 3.8. A sales representative sells motor polish. When q bottles of polish are sold, the mariginal
income of the q th bottle will be equal to
I ′ (q) = 34 − 0.06q − 0.0003q 2 with 0 ≤ q ≤ 400
Motor polish cost R10 per bottle and the sales representative must pay a once-off registration fee of R50.
1. Calculate the total cost and total income functions when q bottles of polish are sold.
IncomeRfunction: R
I(q) = I ′ (q)dq = (34 − 0.06q − 0.0003q 2 )dq = 34q 2 − 0.03q 2 − 0.0001q 3 + c
But I(0) = 0 [When 0 bottles of polish are sold, the income will be equal to R0]
Therefore, the income function is given by: I(q) = 34q − 0.03q 2 − 0.0001q 3
Cost function:
C(q) = 10q + 50
©Copyright reserved 48
4 MATRICES
4 Matrices
4.1 Introduction to matrix concepts
A matrix is a rectangular (or square) array of real numbers arranged in rows and columns. Matrices are
denoted by capital letters and the elements of a matrix by lower case letters. Lower case letters with double
subscripts, such as xij , indicate the element in matrix X located in the ith row and j th column. Consider
the example of matrix A below:
a11 a12 a13 5 1 5
A= =
a21 a22 a23 4 2 7
The element in the second row and first column is indicated by a21 .
The order (or dimension) of a matrix is given as m × n where m denotes the number of rows and
n denotes the number of columns. A matrix is square if m = n. The order of the matrix in the above
example (i.e., matrix A) is 2 × 3. Consider another example:
0 1
B=
2 3
Vectors
A vector is an array (or matrix) of 1 row and n columns (row vector), or 1 column and n rows (column
vector).
Example of a row vector : 1 2 4 is a 1 × 3 row vector.
1
Example of a column vector : 2 is a 3 × 1 column vector.
4
Scalar
A scalar is a single value, or a 1 × 1 matrix. For example, the value 4 is a scalar.
Consider the following matrices for the illustrative examples discussed below:
1
1 −2 2 5 1 1 2
A= , B= , C= , D = 0 and E = −2 4
3 4 −1 1 1 3 1
2
©Copyright reserved 49
4.2 Matrix operations 4 MATRICES
Remark 7. A matrix with all elements equal to zero is called a zero matrix.
• E = −2 4 with e11 = −2 (element in first row, first column) and e12 = 4 (element in first row,
second column).
′ −2
Therefore, the transpose is E = .
4
2 5
• B= with b11 = 2, b12 = 5, b21 = −1, b22 = 1.
−1 1
′ 2 −1
Therefore, the transpose is B = .
5 1
Remark 8. The transpose of a row vector gives a column vector, and the transpose of a column vector
gives a row vector.
©Copyright reserved 50
4.2 Matrix operations 4 MATRICES
1 −2 2 5 (1)(2) + (−2)(−1) (1)(5) + (−2)(1) 4 6
AB = = =
3 4 −1 1 (3)(2) + (4)(−1) (3)(5) + (4)(1) 2 19
2 5 1 −2 17 16
BA = =
−1 1 3 4 2 6
Note: AB ̸= BA
1
2 5
BD = 0 = undefined
−1 1
2
Note: Order of BD = (2 × 2)(3 × 1). Since the number of rows in matrix B is different from the number
of columns in matrix D, the matrix multiplication is undefined.
©Copyright reserved 51
4.2 Matrix operations 4 MATRICES
Remark 9. You will not be given the identity matrix to solve problems, as in the example below. You
must be able to determine the order yourself, such that the particular operation is valid.
Determine A − 4I:
1 5 1 0 1 5 4 0 −3 5
A − 4I = −4 = − =
−1 3 0 1 −1 3 0 4 −1 −1
Example 4.1. Four different types of air fryers are sold by two retailers:
Type
Single basket Dual basket Oven Dual stack
Retailer 1 400 250 260 80
Retailer 2 300 100 240 180
1
400 250 260 80 1 1
. Then E ′ = 1 1 and E ′ = 1 1 1 1 .
Let S = , E2 = and E4 = 2 4
300 100 240 180 1 1
1
12
15
Let P ′ =
16 be the profit (in R100) for the four types. Then P = 12 15 16 20 .
20
2. The total number of air fryers sold per air fryer type.
Matrix notation: E2′ S (1 × 2)(2 × 4) = (1 × 4)
400 250 260 80
1 1 = 700 350 500 260
300 100 240 180
©Copyright reserved 52
4.3 The determinant of a matrix 4 MATRICES
a11 a12
|A| = = a11 a22 − a12 a21 .
a21 a22
2 5
For example, if A = , then
−1 1
2 5
|A| = = 2(1) − 5(−1) = 7.
−1 1
The properties of 2 × 2 matrices are given below. Note that all the properties will hold for any square
matrix.
Property 1
The determinant of a matrix A has the same value as that of its transpose matrix, A′ . That is,
|A| = |A′ |.
2 5
If A = then |A| = 7.
−1 1
′ 2 −1 2 −1
Now, A = so that |A′ | = = 2(1) − 5(−1) = 7.
5 1 5 1
Property 2
Interchanging any two rows (or columns) will alter the sign, but not the numerical value, of the
determinant.
2 5
If A = then |A| = 7.
−1 1
−1 1
Interchanging two rows: = −7
2 5
5 2
Interchanging two columns: = −7
1 −1
©Copyright reserved 53
4.3 The determinant of a matrix 4 MATRICES
Property 3
Multiplying any one row (or column) by a scalar k, will change the value of the determinant k-fold.
2 5
If A = then |A| = 7.
−1 1
Multiplying the first row by k = 10:
20 50
= 20(1) − 50(−1) = 70
−1 1
Property 4
If each element of a row (or column) is added to (or subtracted from) the corresponding element of
another row (or column), the value of the determinant remains the same.
2 5
If A = then |A| = 7.
−1 1
Add the first row and the second row, and place the sum in the first row:
1 6
= 1(1) − 6(−1) = 7.
−1 1
Property 5
If one row (or column) is a multiple of another row (or column), then the determinant is zero.
1 4
|B| = = 1(8) − 4(2) = 0
2 8
Note that the second row is a multiple (×2) of the first row.
Property 6
If one row (or column) of a matrix contains only zeros, then the value of the determinant is zero.
1 2
|B| = = 1(0) − 2(0) = 0
0 0
©Copyright reserved 54
4.3 The determinant of a matrix 4 MATRICES
Alternatively, the first two columns of matrix A can be added to the right. Then, the determinant of A
can be calculated by taking the sum of the products of the left diagonals minus the sum of the products
of the right diagonals (as illustrated below). This illustrative method is used in Quantitative Statistical
Techniques, Swanepoel, et al.
The determinant of A can also be expanded along the jth column, such that:
|A| = a1j C1j + a2j C2j + a3j C3j .
©Copyright reserved 55
4.3 The determinant of a matrix 4 MATRICES
1 2 3
|A| = 4 3 1
0 1 −2
Solution 4.2.
The determinant of A for expansion along row 1 is:
Remark 10. The determinant of A can be determined with expansion along any row or column in the
matrix.
• If |A| =
̸ 0 then the matrix A is non-singular.
Remark 11. Determinants for higher-order matrices (i.e., order 4 and higher) are only expected to be
calculated in Excel.
©Copyright reserved 56
4.4 Cramer’s rule used to solve a system of linear equations 4 MATRICES
a11 x1 + a12 x2 = b1
a21 x1 + a22 x2 = b2
a11 a12 x1 b
In matrix notation we have AX = B with A = ,X= and B = 1 .
a21 a22 x2 b2
The linear equations can be solved using Cramer’s rule defined as follows:
b1 a12 a11 b1
b2 a22 a21 b2
x1 = and x2 =
|A| |A|
Note: The above holds only if A is non-singular (i.e., |A| =
̸ 0).
Example 4.3. Use Cramer’s rule to solve for x1 and x2 in the set of linear equations below:
2x1 − 5x2 = 31
8x1 + 9x2 = −21
2 −5 x1 31
Solution 4.3. In matrix notation we have AX = B with A = ,X= and B = .
8 9 x2 −21
Then, we have:
2 −5
|A| = = 2(9) − (−5)(8) = 58
8 9
31 −5
−21 9 31(9) − (−5)(−21) 174
x1 = = = =3
|A| 58 58
2 31
8 −21 2(−21) − (31)(8) −290
x2 = = = = −5
|A| 58 58
©Copyright reserved 57
4.4 Cramer’s rule used to solve a system of linear equations 4 MATRICES
The linear equations can be solved using Cramer’s rule defined as follows:
b1 a12 a13
b1 a22 a23
b1 a23 a33
x1 =
|A|
and
a11 b1 a13
a21 b2 a23
a31 b3 a33
x2 =
|A|
and
a11 a12 b1
a21 a22 b2
a31 a32 b3
x3 =
|A|
Example 4.4. Use Cramer’s rule to solve for x1 , x2 and x3 in the set of linear equations below:
x1 − 2x3 = 1
4x1 − 2x2 + x3 = 2
x1 + 2x2 − 10x3 = −1
1 0 −2 x1 1
Solution 4.4. In matrix notation: AX = B with A = 4 −2 1 , X = x2 and B = 2 .
1 2 −10 x3 −1
Then, we have:
1 0 −2
|A| = 4 −2 1 = −2
1 2 −10
1 0 −2
2 −2 1
−1 2 −10
x1 =
|A|
−2 1 2 1 2 −2
(−1)2 (1) + (−1)3 (0) + (−1)4 (−2)
2 −10 −1 −10 −1 2
=
−2
18 − 4
=
−2
= −7
©Copyright reserved 58
4.5 The inverse of a matrix used to solve a system of linear equations 4 MATRICES
1 1 −2
4 2 1
1 −1 −10
x2 =
|A|
2 1 4 1 4 2
(−1)2 (1) + (−1)3 (1) + (−1)4 (−2)
−1 −10 1 −10 1 −1
=
−2
−19 + 41 + 12
=
−2
= −17
1 0 1
4 −2 2
1 2 −1
x3 =
|A|
−2 2 4 2 4 −2
(−1)2 (1) + (−1)3 (0) + (−1)4 (1)
2 −1 1 −1 1 2
=
−2
−2 + 10
=
−2
= −4
3 5 7 −5
Example 4.5. Let . Test if is the inverse matrix of A.
4 7 −4 3
Solution 4.5.
−1 3 5 7 −5 1 0
AA = =
4 7 −4 3 0 1
Remark 12. You do not have to calculate the inverse of a matrix by hand, but you must be able to calculate
the inverse of a matrix using Excel.
©Copyright reserved 59
4.5 The inverse of a matrix used to solve a system of linear equations 4 MATRICES
The matrix A−1 can be used to solve a set of linear equations as follows:
AX = B
−1
A (AX) = A−1 (B)
IX = A−1 B
X = A−1 B
Example 4.6 (Two linear equations). Consider the system of two linear equations:
3x1 + 5x2 = 1
4x1 + 7x2 = 0
−1
3 5 7 −5
Solve x1 and x2 using the inverse matrix: A−1 = =
4 7 −4 3
Solution 4.6.
AX = B
3 5 x1 1
=
4 7 x2 0
Therefore,
X = A−1 B
x1 7 −5 1 7
= =
x2 −4 3 0 −4
Example 4.7 (Three linear equations). Consider the system of three linear equations:
8x1 − x2 = 15
x2 + 5x3 = 1
2x1 + 3x3 = 4
−1
8 −1 0 3 3 −5
Solve x1 , x2 and x2 using the inverse matrix: A−1 = 0 1 5 = 1
14 10 24 −40
2 0 3 −2 −2 8
Solution 4.7.
AX = B
8 −1 0 x1 15
0 1 5 x2 = 1
2 0 3 x3 4
©Copyright reserved 60
4.6 Practical applications 4 MATRICES
Therefore,
X = A−1 B
x1 3 3 −5 15
x2 = 1 10 24 −40 1
14
x3 −2 −2 8 4
3(15) + 3(1) − 5(4)
1
= 10(15) + 24(1) − 40(4)
14
−2(15) − 2(1) + 8(4)
28
1
= 14
14
0
2
= 1
0
Suppose the prices of the items are known and are the same for the 3 shops. The prices are R10 for a flag,
R8 for a T-shirt and R5 for a cap. Let:
8 4 10 10 1
S = 2 3 14 , P = 8 , and E3 = 1 .
5 0 6 5 1
5 0 6
The total number of flags sold = 15, T-shirts = 7 and caps = 30.
©Copyright reserved 61
4.6 Practical applications 4 MATRICES
Suppose the income for the 3 shops is known, and the prices of the items are the same at the 3 shops.
Income
Shop 1 162
Shop 2 114
Shop 3 80
To calculate the prices for the items we need to solve for the following linear equations:
8 2 10 x1 162
or SX = B such that 2 3 14 x2 = 114.
5 0 6 x3 80
9 −12 13
The following is given: |S| = 226 and S −1 1
= 113 29 −1 −46
−7.5 10 8
162 4 10
114 3 14
80 0 6 2260
x1 = = = 10
|S| 226
©Copyright reserved 62
4.7 Excel functions for matrix algebra 4 MATRICES
SX = B
X = S −1 B
x1 9 −12 13 162 10
1
x2 = 29 −1 −46 114 = 8
113
x3 −7.5 10 8 80 5
The price of a flag is R10, same as answer in (5).
Value worksheet:
©Copyright reserved 63
4.7 Excel functions for matrix algebra 4 MATRICES
Value worksheet:
©Copyright reserved 64
4.7 Excel functions for matrix algebra 4 MATRICES
Value worksheet:
Value worksheet:
©Copyright reserved 65
5 LINEAR PROGRAMMING
5 Linear Programming
In view of the current economic situation worldwide, much attention has been given recent years to the
execution and completion of tasks in the most efficient and economical way possible. In this chapter, we
shall be interested in maximising and minimising linear expressions of the form
b1 x1 + b2 x2 + · · · + bn xn
where the b’s are the coefficients (constants) of the x ’s and the x ’s represent the variables. Two methods
for the optimisation (maximisation or minimisation) of a linear function subject to certain constraints will
be studied, namely the graphical solution and extreme point methods. The function to be optimised
will from now on be known as the objective function. Linear programming, or linear optimization, is
a mathematical technique used to identify the optimal solution to a problem by either maximising or
minimising a linear objective function. This approach is widely applied across various fields, such as
manufacturing, finance, business, and industry, among others.
5.1 Terminology
• Inequalities
◦ Strict inequalities use the ”less than” (<) or ”greater than” (>) symbols, and do not include
equality. These inequalities are represented by dashed lines on a graph.
◦ Weak inequalities use the ”less than or equal to” (≤) or ”greater than or equal to” (≥)
symbols and allow for equality. These inequalities are represented by solid lines on a graph.
• Constraints
• Feasible region
• Objective function
• Optimal solution
◦ The solution that maximises or minimises the objective function, while satisfying all the con-
straints. Take note that there can be more than one optimal solution.
©Copyright reserved 66
5.1 Terminology 5 LINEAR PROGRAMMING
There are several methods available to solve a linear programming problem, but we will only focus on the
(1) graphical solution method and (2) extreme points method.
1. Graphical solution
This method (also known as the geometrical solution method) is a quick and easy technique with which
to optimise a function with at most three (but preferably two) independent variables, subject to certain
constraints. Because it is difficult to visualise a three-dimensional graphical representation, this method
will only be used in cases with two independent variables.
Before the optimum value of the objective function can be determined, it is necessary to first determine
the region containing all possible solutions (feasible region) and to indicate it on a graph.
Steps to follow:
1. Take the objective function (either profit or cost) and set it equal to any constant (e.g., c).
5. To maximise the profit function, shift the slope line parallel to the profit function, as far away
from the origin as possible but at least one point on the shifted line should still be within the region
of feasible solutions. The last point this slope line is going to touch will be the optimal solution where
profit will be maximised.
6. To minimise the cost function, shift the slope line parallel to the cost function, as close to the
origin as possible but at least one point on the shifted line should still be within the region of feasible
solutions. The last point this slope line is going to touch will be the optimal solution where cost will
be minimised.
2. Extreme points
The corners of the feasible solution region are known as extreme points. In general, it can be proved
that the solution of a system of linear equations can always be found at at least one of the extreme points.
This method involves evaluating the objective function at the extreme points of the feasible region to help
identify the maximum or minimum value of the objective function.
Before the optimum value of the objective function can be determined, it is necessary to first determine
the region containing all possible solutions (feasible region) and to indicate it on the graph.
©Copyright reserved 67
5.1 Terminology 5 LINEAR PROGRAMMING
Steps to follow:
1. Determine the corners of the feasible region. You can determine an unknown coordinate by:
■ finding the point of intersection where the two linear equations intersect, or
■ using Cramer’s rule to solve the system of linear equations.
2. Calculate the values of the objective function (by substituting the co-ordinates of the corner points
of the feasible region).
4. For a profit function, the maximum value will be the optimal solution.
5. For a cost function, the minimum value will be the optimal solution.
6. The solution of the linear equations can always be found in at least one of the extreme points.
7. If two points, let’s say C and D give both an optimal solution then all the points on CD will give
the optimal solutions.
Example 5.1. A car manufacturer produces, among others, two model types, namely L and GL. It is
known that for model L the assembly and finishing-off times for one car are, respectively, 25 and 35 hours,
while for model GL, 50 hours are required for assembling and 30 hours for finishing-off. Suppose that for
a given day 1100 hours are available for assembling and 1050 hours for finishing-off. How many cars of
each of the two models must be produced to maximise profit?
Solution 5.1. The problem can be represented as follows in the form of a table:
Model Type
L GL Available Hours
Assembling Time 25 50 1100
Finishing-Off Time 35 30 1050
Number of Units x y
■ Let x be the number of units for model L and y be the number of units for model GL produced per
day.
■ Select x and y such that the profit is maximised. The profit function is given by 10x + 15y.
Constraints. The following constraints exist for the given day’s production:
©Copyright reserved 68
5.1 Terminology 5 LINEAR PROGRAMMING
Graphical representation:
In the graph below, we have shaded the feasible region where all constraints are satisfied.
25x + 50y ≤ 1100 For both these constraints, you will need to shade
35x + 30y ≤ 1050 the region below and including these lines.
©Copyright reserved 69
5.2 The graphical solution method 5 LINEAR PROGRAMMING
After shading and determining the corner points of the feasible region, we can now use either method find
the optimal solution.
1. Take the profit function and set it equal to any constant (10x + 15y = c).
c 10
2. Simplify and write it in terms of a linear equation (y = mx + c) : y = 15 − 15 x
∆y
3. The slope for the objective function is: − 10
15 = ∆x
4. Draw this slope line on the graph (see the dotted line on the graph below).
5. To maximise the profit function, shift the slope line parallel to the profit function, as far away from
the origin as possible but at least one point on the shifted line should still be within the region of
feasible solutions. The last point this slope line is going to touch will be the optimal solution where
profit will be maximised – in this case, point C.
1. finding the point of intersection where the two linear equations intersect, or
2. using Cramer’s rule (matrix algebra) to solve the system of linear equations.
©Copyright reserved 70
5.2 The graphical solution method 5 LINEAR PROGRAMMING
1. Finding the point of intersection where the two linear equations intersect
The co-ordinates of the point C can be calculated as being (19.5;12.25), seeing that this is the point where
the functions 25x + 50y = 1100 and 35x + 30y = 1050 intersect. The maximum profit is therefore given by
10(19.5) + 15(12.25) = 378.75 (in R1000).
Determinant of A:
25 50
|A| = = (25)(30) − (35)(50) = −1000.
35 30
1100 50 25 1100
1050 30 35 1050
x= = 19.5 and y = = 12.25
−1000 −1000
Hence, the profit is maximised at x = 19.5 and y = 12.25. Given these values for x and y, we have:
Note that the assembly and finishing-off times are optimally used (that is, within the given constraints).
©Copyright reserved 71
5.3 The extreme point method 5 LINEAR PROGRAMMING
The corners of the feasible region are known as the extreme points. In the case of Example 5.1, we have
four extreme points namely A, B, C and D, calculated in the table below.
Since the objective function is a profit function (which we want to maximise), the co-ordinate that will
give the optimal solution will be the co-ordinate with the highest value (point C). Therefore, the maximum
profit is given by 10(19.5) + 15(12.25) = 378.75 (in R1000).
Use both the graphical solution method and extreme point to find the optimal solution for this problem.
©Copyright reserved 72
5.4 More examples 5 LINEAR PROGRAMMING
Solution 5.2.
Firstly, we obtain the region of feasible solutions:
Next, you will need to plot and connect these co-ordinates to start determining the feasible region.
In the graph below, we have shaded the feasible region, where all constraints are satisfied:
x1 + 2x2 ≥ 16 For both these constraints, you will need to shade
x1 + x2 ≥ 10 the regionabove and includingthese lines.
You need to shade the region where x1 and x2 will be positive,
x1 , x2 ≥ 0
meaning greater and equal to zero.
Note: x1 , x2 ≥ 0 means that both x1 and x2 are greater than or equal to 0 , i.e., x1 ≥ 0 and x2 ≥ 0.
1. Take the cost function and set it equal to any constant ( 3x1 + 5x2 = c ).
c
2. Simplify and write it in terms of a linear equation: x2 = 5 − 35 x1
∆x2
3. The slope for the objective function is: − 35 = ∆x1
4. Draw this slope line on the graph (see the dotted line on the graph below).
5. To minimise the cost function, shift the slope line parallel to the cost function, as close to the origin
as possible but at least one point on the shifted line should still be within the region of feasible
solutions. The last point this slope line is going to touch will be the optimal solution where cost will
be minimised.
©Copyright reserved 73
5.4 More examples 5 LINEAR PROGRAMMING
The coordinates of point B can be found as (4, 6) using the two lines of intersection:
x1 + 2x2 = 16
x1 + x2 = 10
Using Cramer’s rule to solve this system of linear equations, we have:
1 2
• Matrix notation: AX = B with A = , X = xx12 and B = 16
10 .
1 1
• You will find the answer to be x1 = 4 and x2 = 6 (try this on your own using Cramer’s rule).
The minimum cost is obtained at x = 4 and y = 6, with the minimum cost given by 3(4) + 5(6) = 42.
Thus, the cost function has a minimum of R42 at x1 = 4 and x2 = 6.
©Copyright reserved 74
5.4 More examples 5 LINEAR PROGRAMMING
Use the graphical solution method to find the optimal solution for this linear programming problem.
Solution 5.3. Follow all the relevant steps (see Examples 5.1 & 5.2) to obtain the graphical display:
Know how to draw the linear equations, shade and find the corner/extreme points of the feasible region.
• Take the profit function and set it equal to any constant (5x + 3y = c) so that y = c
3 − 53 x.
• Draw this slope line on the graph (see the dotted line on the graph below).
©Copyright reserved 75
5.4 More examples 5 LINEAR PROGRAMMING
Example 5.4. A construction company has two teams, namely team A and team B. Each team consists
of at least 1 builder. Each builder in team A works 9 hours per day and gets paid R84. Each builder in
team B works 12 hours per day and gets paid R60. The budget for daily wages for the company is R840.
Suppose that on a given day there are 108 man-hours available. The profit for the construction company
on work done by a builder in team A and B is respectively R40 and R70. Let x denote the number of
builders in team A and let y denote the number of builders in team B.
©Copyright reserved 76
5.4 More examples 5 LINEAR PROGRAMMING
Solution 5.5.
The first constraint can easily be obtained from the horizontal line intersecting the y-axis at y = 1. The
constraint is: 0 ≤ y ≤ 1.
For the second constraint we need to find the equation of the straight line intersecting the y-axis at y = 2
and the x-axis at x = 4. Here, we have two coordinates, namely, (x1 , y1 ) = (4, 0) and (x2 , y2 ) = (0, 2). We
substitute these coordinates into the equation of a straight line:
y2 − y1
y = y2 + (x − x2 )
x2 − x1
(2) − (0)
y = (2) + (x − (0))
(0) − (4)
1
y =2− x
2
©Copyright reserved 77