EXC2910 Lecture Notes
EXC2910 Lecture Notes
FABIAN A. HARANG
Contents
1. List of symbols 2
2. The numbers and sets 3
3. Basic rules of algebra 5
4. Linear equations 11
5. Quadratic equations 14
6. Systems of linear equations 18
7. Inequalities 20
8. Functions 24
9. Quadratic functions 29
10. Polynomials 33
11. Limits and Asymptotes 39
12. Differentiation 42
13. Rules of differentiation 44
14. Tangent line 47
15. Function Analysis 49
16. Financial Analysis 54
17. Annuities 61
18. Two variable functions 65
19. Optimization under constraints: The Lagrange method 73
20. Integration 77
21. Introduction to linear algebra: Gauss Elimination 86
1
EXC2910 THE FIRST SEMESTER 2
1. List of symbols
Numbers are the basic building block of mathematics. We use them to quantify
various objects of interest and they allow us to compare different quantities due to
their natural order. In these notes we will only work with what is called the real
numbers; pretty much any number that you are able to think of. We typically divide
this class of numbers into three collections: The integers, the rational numbers and
the irrational numbers. Let us discuss these three separately before we see how they
are all contained in the real numbers.
2.1. Natural numbers. The integers are the numbers of the form: 0, 1, 2, 3, 4....
(often called positive integers), but also negative numbers of the form −1, −2, −3, −4....
(negative integers). Clearly there are infinitely many integers; try counting them!
A collections of numbers Is typically called a set. We therefore use the brackets
{·} to denote a set. For example, the collection of numbers given by 1, 2 and 3 can be
written as the set {1, 2, 3}. Similarly the collection of numbers 1, −102, 247 and −3
can be denoted by {1, −102, 247, −3}. When talking about collections of numbers
which are of infinite size, we typically include only three or four numbers from the
collection, and then write ... after, allowing the reader to understand that there
are infinitely more of the numbers, and they follow the pattern from the first three
or four numbers. For example, to denote all the positive integers we may write
{1, 2, 3, 4, ...}. The negative integers can then be written as {..., −4, −3, −2, −1}.
Note that we always preserve the order, and thus the triple ... here comes before the
first number.
The collection of all integers is denoted by Z. This can be written mathematically
as
Z := {..., −3, −2, −1, 0, 1, 2, 3, ...}. (2.1)
Here, the symbol Z is used to represent the collection of numbers. So we can say
for example that a number n is contained in (in the collection) Z, meaning that
the number n is an integer. To simplify this further with mathematical notation
we write n ∈ Z. The symbol ∈ means that whatever is on the left hand side is
contained in whatever is on the right hand side.
The collection of integers can again be divided into two sub-collections: All the
numbers that can be divided by the number 2 (and leaving no remainder) and the
numbers that can’t. We call these two collections even and odd numbers respectively.
More concretely we have
It is readily seen that any even number can be divided by 2: for example 2/2 = 1,
4/2 = 2, 6/2 = 3 and so on. Similarly, for the odd numbers we see that if we divide
by 2 we get a remainder (i.e. a decimal number): 1/2 = 0.5, 3/2 = 1.5, 5/2 = 2.5
and so on. More generally, we can say that any even number is any number of the
form 2k where k is an integer (see definition above). An odd number can therefore
be written as any number of the form 2k + 1 where k again is an integer.
2.2. Rational numbers. The rational numbers is the next sub-collection of num-
bers that we will consider. Even though the collection of integers is infinitely large
(as there is infinitely many integers), the collection of rational numbers is much
bigger! Let us first define this class, and then we will see why. The set of rational
numbers is denoted by Q and consists of all numbers which can be written as a
fraction between two integers. That is, any rational number k can be written as
k = ab where a and b are integers. Therefore, 13 is a rational number, since 1 and 3
are integers. Similarly, − 12 , 52 , 25 and 5678
1234
are all rational numbers. Note also that
any integer is also a rational number. Indeed, if k is an integers contained in the
collection Z then k = k1 and so it is also a rational number.
To write this mathematically, we have that the rational numbers Q are defined
by
a
Q := {k = : a, b ∈ Z}. (2.3)
b
We read this definition as " all numbers k which is given as a fraction ab , where a
and b are integers (i.e. contained in Z)".
Note in particular that between any two integers, we can find infinitely many
rational numbers! Indeed, let us look for rational numbers between 0 and 1. For
example the numbers 12 , 31 , 14 and so on are all contained between 0 and 1.
2.3. Real numbers. Simply put, the real numbers is the collection of "all numbers
between −∞ and +∞". This is not a very rigorous account. We can rather think
of the real numbers as a continuous line: The real numbers clearly contains all
the integers and all the rational numbers, but they also contain all the so called
irrational numbers. These are numbers that cannot be written as a fraction between
two integers (i.e. of the form ab for two integers a and b).
EXC2910 THE FIRST SEMESTER 5
The basic rules of algebra is about understanding abstract relations between num-
bers. The basic building blocks of algebra is addition, subtraction, multiplication
and division. While we will assume good knowledge of these four fundamental op-
erations here, but we will recall the order of which these operations must happen
when faced with what we call an algebraic expression.
(a + b) · c = a · b + b · c.
a · b = b · a and a + b = b + a
(a · b) · c = a · (b · c) and (a + b) + c = a + (b + c).
• Distributive property
(a + b) · c = a · c + b · c.
Rules of fraction. Let a, b, c, d be real numbers. Then the following rules holds:
• negative fractions
a −a a
− = = .
b b −b
• Addition with common denominator
a c a+c
+ = .
b b b
• multiplication of fractions
a c ac
· = .
b d bd
• Division of fractions
a c a d ad
÷ = · = .
b d b c bc
Remark 3.2. Note that the addition rule also implies the following rule for subtrac-
tion of fractions with a common denominator. Indeed, since the rule holds for any
real numbers a and b, note that −a is also a real number, and thus by the addition
rule we have that
a c a (−c) a + (−c) a−c
− = + = = .
b b b b b b
3.3. Integer powers. Working with numbers, we typically encounter expressions
where a number is multiplied by itself several times. We call this to take a power of
a number. More concretely, we have the following definition:
The following proposition provides us with some basic rules for powers of numbers
Proposition 3.4 (Rules of integer powers). Let n and s be integers, and a and b be
real numbers. Then the following holds:
i. an as = an+s
ii. (an )s = ans .
EXC2910 THE FIRST SEMESTER 7
iii. a−1 = a1
iv. if a ̸= 0 then a0 = 1 (00 is undefined).
v. (ab)n = an bn
vi. ab = a · 1b .
9 = 3 · 3 = 31 · 31 = 32 = 9 (3.1)
More generally, if we let Mn−1 denote the money we have in the bank after saving
for n − 1 years, we can derive a formula to figure out how much we will have in
the bank after n years. As before, we have
r r
Mn = Mn−1 + Mn−1 = Mn−1 (1 + ). (3.2)
100 100
By iterating backwards, one can show that
r n
Mn = M0 (1 + ) . (3.3)
100
We say that the interest rate is compounded, meaning that the next year we earn
interest both on the principle amount saved but also on all earlier interest rates
gained. This makes our savings grow at a so called exponential rate.
3.5. Factorization. A technique which will become very useful in our mathematical
analysis is known as factorization. The basic idea is to break down a number into
smaller factors. By doing so, we can understand in more detail what "this number is
made up of" and we can therefore see common factors in two numbers, which might
cancel out under for example division.
More precisely, suppose x is a real number, and that there exists two numbers
a and b such that x = a · b. Then a and b are two factors of x. When factorizing
a number, we typically want to continue this factorization until the factors only
consists of prime numbers (recall that a prime number is a number which is only
divisible by 1 and itself). For example, the number 21 can be factorized into 3 · 7
(both 3 and 7 are prime numbers). Another example is the number 16 which can
be decomposed into 4 · 4, where 4 and 4 are the two factors. However, 4 can be
factorized further into 2 · 2 and we therefore have that 16 = 2 · 2 · 2 · 2. Another
way of factorizing a number is to first "split" the number into two numbers added
together. For example, 32 = 14 + 18. Now 14 = 2 · 7 and 18 = 2 · 9 and therefore we
have 32 = 2 · 7 + 2 · 8. Observe that the factor 2 is common for both the numbers
that are added together, and so we can factorize this number outside a parenthesis
to see that
32 = 2 · 7 + 2 · 8 = 2 · (7 + 8).
Although this trick seems rather difficult in order to decompose 32 into 2·16, we will
see that for general algebraic expressions, factorization of this form will drastically
simplify our expressions.
Consider now an algebraic expression of the form 2x − 4x2 . We can write this in
terms of its factors
2x − 4x2 = 2 · x − 2 · 2 · x · x.
EXC2910 THE FIRST SEMESTER 9
We recognize that 2 · x is common in both of the terms, and so we can put this
outside a parenthesis, in order to see that
2x − 4x2 = 2 · x · 1 − 2 · 2 · x · x = 2x · (1 − 2x).
Note that we must leave a 1 in place where the first 2x stood. Try to verify that
this is true by multiplying out the parenthesis on the right hand side above.
Finding common factors in algebraic expressions will be very important in order
to reduce the complexity and to quickly be able to analyse such expressions.
(a − b)(a + b) − a2 + b2 (3.4)
is an algebraic expression. Very often can we work with such an algebraic expression
in order to simplify it to make it easier to read and understand. For example, if we
open up the parenthesis above by multiplying we see that
Thus we have simplified the product of the two parenthesis. Inserting this compu-
tation back into Equation (3.4) we see that
(a − b)(a + b) − a2 + b2 = 0. (3.5)
3.7. Quadratic identities. The quadratic identities are a collection of three for-
mulas relating to the expansion of the square of a sum or difference. Knowing these
identities by heart makes computations much faster, and it is highly recommended
to learn these identities and make sure that one understand how to derive them.
Exercise 3.6. Show that formula (I) − (III) holds. To this end, begin to look at
the parenthesis expression on the left hand side of the identities, and "open this up".
3.8. Exercises.
Exercise 3.8. Using the rules for integer powers in combination with the rules for
fractions, show that for any integer n and s and real numbers a, b, c and d
4 −2
(1) (ab) a
b3 a2
=b
(2) ac
bc
= ab
(3) (a + b)2 = a2 + 2ab + b2
(4) (a − b)2 (a + b) = a3 + b3 − a2 b − b2 a + b3 .
Exercise 3.9. Suppose you invest 1000 NOK in a financial product that guarantees
you a return of 10% per year in the next 10 years. Show that after 10 years your
money has grown to 2594 NOK.
4. Linear equations
3x − 5 = 2x + 2. (4.1)
Here x represents an unknown number which is such that the left hand side of the
= sign is equal to what is on the right hand side. The mathematical problem is
therefore to figure out what the unknown number x is. So, when asked to solve such
an equation, we mean that we are looking for a real number a which is such that
if we replace x in the equation by a, then what is on the left hand side is equal to
that on the right hand side. Let us illustrate this further: we could guess that the
solution to the above equation is 2 (this means that the number a = 2).But inserting
the number 2 in place of x in the above equation we see that we get
3 · 2 − 5 = 2 · 2 + 2 =⇒ 1 = 6 (4.2)
The conclusion on the right hand side is obviously not true; 1 ̸= 6 ("1 is not equal
to 6). Therefore 2 cannot be a solution to the equation.
On the other hand, let us try the solution 7. Inserting 7 in place of x in the
original equation we see that
3 · 7 − 5 = 2 · 7 + 2 =⇒ 21 − 5 = 14 + 2 =⇒ 16 = 16. (4.3)
Here we see that the left hand side of the equality sign is equal to the right hand
side! This means that 7 is a solution to the equation. We then typically say that
x = 7 is the solution. For now, we have only guessed at different solutions. This is
typically impossible in real world applications, and it is therefore useful to learn a
few methods in order to figure out the correct solution to the equation by simply
using the algebraic manipulations we have worked with in the previous section.
The important thing to remember when working with equations is the following
proposition:
ax + b = cx + d,
ax + b + n = cx + d + n. (4.4)
(2) We can subtract a number or variable n to both sides of the equation, i.e.
ax + b − n = cx + d − n.
EXC2910 THE FIRST SEMESTER 12
(4) we can divide both sides of the equation by a number n (not equal to 0), i.e.
(ax + b) (cx + d)
= .
n n
4.1. An algorithm to solve linear equations. We will now present a simple
algorithm to solve linear equations. An algorithm is just a recipe containing useful
steps and rules to follow to reach the goal of solving a linear equation.
Algorithm: We are given an equation of the form
ax + b = cx + d, (4.5)
ax + b − cx = cx + d − cx =⇒ ax − cx + b = d.
Step 2: Now we want to collect all the numbers which is not multiplied with x on
the right hand side. In our case, this means that we want the number b to move
to the right hand side. To do this, we subtract b on both sides of the equation
that we derived in Step 1, and we see that
ax − cx + b − b = d − b =⇒ (a − c)x = d − b.
Step 3: Recall that if a and c are numbers, then a − c is also a number, and
assume that a − c is not 0. On the left hand side we now have (a − c)x To get x
on its own, we need to divide by (a − c) on both sides of the equation, using (4)
in Proposition 4.1. We then find that
(a − c)x d−b d−b
= =⇒ x = .
(a − c) (a − c) a−c
d−b
Now we have found a solution to the equation, x = a−c
.
Exercise 4.3. Show that x = 4 is a solution and that 3 is not a solution to the
equation
4(x + 12) = 8x + 32 (4.6)
hint: Insert the number 4 or 3 in place of x in the equation, and see if the right
hand side is equal to the left hand side.
d−b
Exercise 4.4. Show that x = a−c
is a solution to the equation
ax + b = cx + d. (4.7)
d−b
Hint: Insert the number a−c in place of x in the equation, and then check that the
left hand side is equal to the right hand side.
EXC2910 THE FIRST SEMESTER 14
5. Quadratic equations
While the linear equations of last section have terms with an unknown x quadratic
equations also involve a second order term x2 . For example a quadratic equation
could take the form
2x2 − 4x + 10 = 0.
Just as for linear equations we treat x as an unknown number. Our goal is to figure
out what real number which is such that if we replace x by this number, then the
left hand side of the equation is equal to the right hand side (in this case 0). In
contrast to linear equations, quadratic equations will mostly have two solutions. We
are therefore not only looking for one real number solving the equation, but two!
This can be illustrated by the following quadratic equations:
x2 − 16 = 0.
To solve this, we must ask our self "what number is such that if we square that
number, we get 16?" Of course, a candidate is 4, since 42 = 16. But note that
another possibility is −4, since (−4)2 = 16. Thus this equation has two solutions,
and we denote them by x1 and x2 , i.e. x1 = 4 and x2 = −4.
x2 + 2x − 3 = 0. (5.2)
They represent the numbers (often called coefficients) that we find in front of each
of the terms in the quadratic equation.
EXC2910 THE FIRST SEMESTER 15
Exercise 5.4. Solve the following equations without using the ABC formula in the
next section:
(1) 3x2 − 4x = 0
(2) −x2 + 2x = 0
(3) x2 + 4x + 4 = 0
(4) −x2 + 2x − 1 = 0
(5) −x2 + 2x − 26 = 0
5.1. ABC formula. A very useful formula is known as the ABC formula. It will
provide an explicit formula to solve quadratic equation in (5.1), where the solutions
are expressed in terms of the a, b and c coefficients in the abstract equation (thus
ABC formula).
We present the formula in the following proposition:
Proposition 5.5 (The ABC formula). Let a, b, c ∈ R be real numbers, and suppose
a ̸= 0. Let x1 and x2 be given by
√ √
−b + b2 − 4ac −b − b2 − 4ac
x1 = , x2 = . (5.3)
2a 2a
Then x1 and x2 are two solutions to the quadratic equation
ax2 + bx + c = 0.
Remark 5.6. More generally, one commonly use the notation ± to represent the plus
and minus part of the expression, and write
√
−b ± b2 − 4ac
x= . (5.4)
2a
Writing it in this way, it means that there are two solutions, and in one of the
√
solutions we add the term b2 − 4ac in the numerator, and in the other we subtract
the same term.
Example:: Let us solve the following quadratic equation by using the ABC for-
mula:
1
− x2 + 2x − 1 = 0.
2
We observe that for this equation, a = − 21 , b = 2 and c = −1. Inserting this into
the ABC formula, we get
q
−2 + 22 − 4(− 21 )(−1) √
x1 = 1 = 2 − 2.
2(− 2 )
√
Similarly, we can see that x2 = 2 + 2. And so we have two solutions.
EXC2910 THE FIRST SEMESTER 16
The two solutions provided by the ABC formula may seem very complicated.
However, it turns out that these expressions can easily tell us how many solutions
we can expect tot he problem.
Exercise 5.8. Use the ABC formula to first figure out how many real solutions we
have to the following equations, and then afterwards write down the solutions using
the formula.
(1) −x2 + 2x + 3 = 0
(2) 2x2 + 4x + 8 = 0
(3) −2x2 + 2x = −10
(4) − 2δ x2 + 2αx = β (for some given numbers α, δ, β).
Proposition 5.9. Let a, b, c be three real numbers, suppose x1 and x2 are two solu-
tions to the quadratic equation
ax2 + bx + c = 0.
Remark 5.10. This proposition will prove to be very powerful in our analysis. It
tells us that if we know the two solutions of a quadratic equation, then we can
EXC2910 THE FIRST SEMESTER 17
Let us illustrate the power of this proposition with the following example.
Example: Simplify the following fraction
x2 + x − 6
.
x+3
By factorizing the quadratic expression in the numerator x2 + x − 6 we might see
that cancellations will happen. Therefore, we first solve the quadratic equation
x2 + x − 6 = 0. By using the ABC formula, we see that
√
−1 ± 1 + 4 · 6
x= (5.6)
2·1
and therefore
x1 = 2, and x2 = −3. (5.7)
Applying Proposition 5.9 it follows that
x2 + x − 6 = (x − 2)(x + 3). (5.8)
Using this knowledge we see that
x2 + x − 6 (x − 2)(x + 3)
= = x − 2. (5.9)
x+3 x+3
And so by factorizing the quadratic expression, we have managed to get a cancella-
tion in the fraction, and we are left with a simple linear expression x − 2.
EXC2910 THE FIRST SEMESTER 18
6.1. Two equations and two unknowns. In section 4 we learned how to solve
equations of the form
2x − 3 = 4x + 9. (6.1)
In this section we will take this type of equations one step further by introducing
one more unknown variable y. To this end, consider the equation
2x = y − 3. (6.2)
To solve this equations we try to find a pair of numbers (x∗ , y ∗ ) which is such that if
we replace x with x∗ and y with y ∗ then the right hand side is equal to the left hand
side. However, it is not difficult to see that there must be infinitely many pairs of
numbers (x∗ , y ∗ ) satisfying this equation. Indeed, note that if we choose for example
x∗ = 1 then y ∗ = 5 will be a solution. Similarly for x∗ = 2 then y ∗ = 7 is a solution.
By only having one equations we can think that this is too little information in order
to determine one unique solution in the case where we have two unknowns (i.e. x
and y).
Let us therefore introduce one more equation, so that we consider the system of
equations:
(I) 2x = y − 3
(6.3)
(II) − x + 3 = y.
Now we have two equations with two unknowns, where the labels (I) and (II)
denotes the two equations. To solve this system, we will follow a simple strategy:
First consider equation (I) and solve this for the unknown y. We see that y = 2x−3.
We then insert this information into equation (II), that is, we replace y in equation
(II) by 2x − 3 (as y must equal to this value). From equation (II) we then find that
−x + 3 = 2x − 3 =⇒ x = −6.
We have therefore found a value for x. Inserting this value (x = −6) back into the
original equation (I) we find
2(−6) = y − 3 =⇒ y = −9.
We have therefore found out that (x∗ , y ∗ ) = (−6, −9) is a solution to the system of
equations in (6.3). This solution is in fact unique, in the sense that there is no other
pair of numbers (x∗ , y ∗ ) that will solve this equation, the solution we have found is
the only one.
It turns out that in order to find a unique solution to a system of linear equations
we will require in general the same number of unknown variables as the number
of equations. In our latest example we had a system with two equations and two
unknowns, which allowed for a unique solution.
EXC2910 THE FIRST SEMESTER 19
7. Inequalities
With the real numbers comes a natural order of the elements contained in the
set of real numbers. For example, we have that 1 is smaller than 2. We then write
1 < 2 (this means in fact that 1 is strictly smaller than 2).
While equations investigates when two algebraic expressions are equal, inequalities
investigate when one algebraic expression is either larger or smaller than some other
algebraic expression. Let us first recall the four different symbols we will use: let a
and b be two unknown numbers
• if a < b then "a is strictly less than b" (meaning that a is not equal to b)
• if a > b then "a is strictly larger than b" (meaning that a is not equal to b)
• if a ≤ b then "a is less or equal to b" (meaning that a may be equal to b)
• if a ≥ b then "a is greater or equal to b" (meaning that a may be equal to b)
Suppose I have two different unknown quantities: 2x − 4 and 6x + 2, and I am
interested in knowing the answer to the following questions "for what values of x
will 2x − 4 < 6x + 2? ". To answer this problem, we can treat the inequality in
much the same way as we treat equations; we may add, subtract, multiply or divide
by numbers on each side of the inequality. To solve the above problem, we want to
get x alone on the left hand side, and the known numbers on the right hand side.
We add 4 and subtract 6x to both sides, and see that
Now we have isolated the x terms on the left hand side and we have a number
on the right hand side. But we must now be careful. Because in contrast to the
methodology for solving equations, something special happens with inequalities if
we multiply or divide both sides by a negative number. We summarize this in the
following rule
Rule: Suppose that −a ≤ b (respectively a < b). Then multiplying both sides
by the negative number −c we get ca ≥ −cb (respectively ca > −cb). Equivalently,
if we divide by −c we get ac ≥ − cb (respectively ac > − cb ).
This rule tells us that if we multiply by −1 (or any negative number) then we
must switch the inequality sign.
Going back to our example we divide by −4 on each side and see that
6 3
− 4x < 6 ⇐⇒ x > − ⇐⇒ x > − . (7.1)
4 2
Thus the solution to the inequality is given by all x greater than − 32 , i.e. x > − 32 .
This means in particular that if we choose any number greater than − 32 and replace
x in the inequality 2x − 4 < 6x + 2, then the left hand side will be smaller than the
right hand side, and we say that the inequality holds.
EXC2910 THE FIRST SEMESTER 21
Dividing both sides by 3 we see that x < −3 which is then the solution to the
inequality.
7.1. Sign diagrams. For more complicated inequalities involving for example sec-
ond order algebraic expression it is very useful to do a systematic investigation of
the solution by using a Sign diagram. In this section we will learn how to use this
diagram, and we will illustrate its usefulness.
Consider the general quadratic inequality
ax2 + bx + c ≥ 0. (7.4)
From the previous section we know how to solve the equation ax2 + bx + c = 0 by
using the ABC formula. Furthermore, in Section 5.2 we saw that if x1 and x2 are two
solutions to the quadratic equation, then we can factorize the quadratic expression
Assume for now that a > 0. The sign diagram to analyse the expression a(x −
x1 )(x − x2 ) is written as follows:
a(x − x1 )(x − x2 )
x1 x2
———————|———————|———————
(x − x2 ) −−−−−−−−−|−−−−−−−−−0 + + + + + +
(x − x1 ) −−−−−−−−−0 + + + + + + | + + + + + +
a +++++++++| + + + + + + | + + + + + +
a(x − x1 )(x − x2 ) + + + + + + 0− − − − − − 0 + + + + + +
The first horizontal line is to represent the x-axis; the potential values of x on the
real number line. In the second line, we analyse the first factor (x − x2 ), and we
ask our self; "For what values of x will x − x2 be positive, negative or 0?". When
x < x2 it is clear that x − x2 is going to be negative. This is then represented with
"minus sign line" − − −− in the diagram. (x − x2 ) is negative until we see that it
is 0 for x = x2 . Then for x > x2 it is positive, which is represented with a "plus
line" + + +. We analyse the factor x − x1 in the same way. Since a is assumed to
be a positive number, we represent this factor as something positive for any values
of x (it is indeed not depending on x as it is a fixed number). By multiplication of
the signs of the three factors we then find out when the product a(x − x1 )(x − x2 )
is positive, negative or equal to 0 in the last line. We can therefore read of the
solution. to the original inequality a(x − x1 )(x − x2 ) ≥ 0 by looking at the last line
in the sign diagram, and we find the solution: x ≤ x1 or x ≥ x2
Example Solve the inequality
−x2 − x + 12 ≥ 0.
−(x − 3)(x + 4) ≥ 0,
EXC2910 THE FIRST SEMESTER 23
i.e. "For what values of x is −(x − 3)(x + 4) positive?". Analysing each parts
separately, we create the following sign diagram:
a(x − x1 )(x − x2 )
−4 3
———————|———————|———————
(x − 3) −−−−−−−−−|−−−−−−−−−0 + + + + + +
(x + 4) −−−−−−−−−0 + + + + + + | + + + + + +
−1 −−−−−−−−−| − − − − − − | − − − − − −
a(x − x1 )(x − x2 ) − − − − − − 0 + + + + + + 0− − − − − −
In the last line of the sign diagram we can now read of the solution to the inequality:
−4 ≤ x ≤ 3.
Exercise 7.2. Use the sign diagram method to solve the following inequalities:
(1) (x + 1)(x − 4) ≥ 0
(2) (x − 3)(x + 2) ≤ 0
(3) x2 − 2x + 21 < 1
(4) −2x2 + 4x − 4 < 0
x2 −3x−4
(5) (x−1)(x−4)
≥ 0.
EXC2910 THE FIRST SEMESTER 24
8. Functions
Functions are used to describe the relationship between two variables. Given an
input variable, a function will provide us with a corresponding output variable. FOr
example, in economics we know that there must be a relationship between the price
of a product, and the demand of the same product. If the price is low, then demand
increases, and if the price is high, the demand decreases. In this example, we can
interpret the price p as the input of a function f which tells us the demand for
the product for a given price. When the function receives an input variable p, we
evaluate the function f (p) which then assigns a number for the demand at that price
level. How the function f assigns a number for demand given a price level p must
then be specified with a mathematical expression. For example, the function could
be given by
f (p) = 100 − 2p.
Here, p is the input variable, and f (p) is the output variable. The expression 100−2p
provides us with a simple recipe for how to transform the input variable into an
output variable. Remember that p represents in this example the price of a given
product (which is a positive number). Then the function tells us that if the price is
p = 4, then the demand for the product (i.e. the number of products we will sell)
is equal to f (4) = 100 − 2 × 4 = 92. If the price is p = 30 (a significant increase in
price from p = 4), then the demand is f (30) = 100 − 2 × 30 = 40. We see that the
function provides us with the desired relationship between price and demand.
In general, we think of the function as the component which connects the numbers
of two sets. Let X and Y be two collections of real numbers (for example, X and
Y could be any real number, or only the real numbers that are between 0 and 1,
or some other collection). The function f assigns to each element in X exactly one
element of Y . We can think of this procedure as in the following diagram
X 7→ f (x) 7→ Y. (8.1)
Thus for each x in the set X, we obtain a value y in the set Y , and we have that
y = f (x). In most cases in these notes, both X and Y will be the set of real numbers
R (that is; all real numbers). Before moving on to a a systematic study of various
elementary functions, we will provide a generic definition of a function.
Definition 8.1. A function f from a set X to a set Y assigns an element of X to
an element of y, such that y = f (x). For each x in X, the notation f (x) means
that the function f is evaluated in the point x. The set X is then called the domain
(often denoted by D) and Y is called the range.
When both the domain and range of a given function is the set of real numbers
R, then a function can be graphically represented in a two-dimensional coordinate
EXC2910 THE FIRST SEMESTER 25
system, as seen in Figure 8.1. The horizontal line in the coordinate system is called
the x-axis, and the vertical line is called he y-axis. This two lines cross in the point
(x, y) = (0, 0), called the origin. In order to create a sketch of a function in a
coordinate system, it is useful to create a table where different x values are matched
with different y values trough the application of the function f . Let us look at one
example.
Example: Consider the function f (x) = 2x + 3 with X = Y = R. We will now
compute the function value for a few different values of x that will be represented
in a table:
x f (x) = y
−3 f (−3) = −3
−2 f (−2) = −1
−1 f (−1) = 1
0 f (0) = 3
1 f (1) = 5
2 f (2) = 7
3 f (3) = 9
The above table provides us with coordinates in order to sketch the graph of the
function in to a coordinate system. Note that in a coordinate system, each point
in the two dimensional plane is represented by one x value, and one y value (the
function value). Thus, from the first line in the table, we find the coordinate (x, y) =
(−3, −3), and we can continue in a similar way for the rest of the lines in the table.
This gives us:
8.1. Linear functions. We will in this section look closer at linear functions, also
called "straight lines". We begin with a definition:
f (x) = ax + b. (8.2)
EXC2910 THE FIRST SEMESTER 26
Here, x is the variable, and for each x in the domain y = f (x) assigns a value in the
range. The parameter a is called the slope, and b is called the intercept.
The slope parameter of a linear function describes the increase or decrease of the
function, given an increase in the variable x. For example, if a = 2, then it means
that the function value f (x) will increase by 2 if we increase the x value by 1. If the
slope parameter is a = −3, it means that the function value f (x) will decrease with
−3 if we increase the x value by 1.
The intercept parameter tells us where the straight line is crossing the y axis; that
is, when x = 0. For example, if b = −5, it means that the straight line intercepts
the y axis when y = −5.
The slope and the intercept completely characterize any straight line in a coordi-
nate system. That means; if we know the slope and the intercept.
Any straight line that we can draw in a coordinate system (for example the straight
line in Figure 8.2) can be represented as a linear function. In fact, given only two
points in a coordinate system, call them (x1 , y1 ) and (x2 , y2 ), there is a unique line
that intersects both of these two points, and this straight line can be described by
a linear function f (x) = ax + b. The challenge is then to infer from the two points
what the slope a and b should be.
Given the assumption that the two points are coming from a linear function, we
must have that the following system of equations holds:
y1 =ax1 + b
(8.3)
y2 =ax2 + b.
Note that here x1 , x2 , y1 , y2 are known numbers to us, but a and b are unknown. The
system of equations must therefore be solved with respect to a and b. Rewriting the
system of equations slightly, we see that
y1 − ax1 =b
(8.4)
y2 − ax2 =b.
EXC2910 THE FIRST SEMESTER 27
In particular, this must mean that the left hand side in the first equation is equal
to the left hand side in the second equation, i.e.
y1 − ax1 = y2 − ax2 .
Proposition 8.3. Given two coordinates (x1 , y1 ) and (x2 , y2 ), the straight line that
intersects both of these points are given by f (x) = ax + b, where
y2 − y1
a= , (8.5)
x2 − x 1
and b = y1 − ax1 .
Let us illustrate this proposition with the following example: Problem: Given
the two coordinates (x1 , y1 ) = (2, 3) and (x2 , y2 ) = (−1, 6), derive the straight line
that intersects both these points.
Solution: We need to find a straight line f (x) = ax + b that intersects the two
given points. This means that we need to figure out the value for a and for b in the
linear function. Using the formula for a in (8.5), we have that
6−3
a= = −1 (8.6)
−1 − 2
and then b = 3 − (−1)2 = 5. Thus the straight line is given by the function
f (x) = −x + 5. (8.7)
Exercise 8.4. Find the straight line (linear function) that intersects the following
points:
(1) (1, 5) and (−3, 2)
(2) (−5, 5) and (5, −5)
(3) (10, 1) and (5, −5)
(4) (1, 1000) and (2, 2500)
Given two linear functions f (x) = ax + b and h(x) = a′ x + b′ for some given
numbers a, b, a′ , b′ , we could ask our self; when will the straight line generated by
f (x) intersect the straight line generated by h(x)? Said differently, for which value
of x will the two lines cross?
We can answer this question graphically by sketching the two straight lines into
a coordinate system, and see where the two lines intersect. This is illustrated in
EXC2910 THE FIRST SEMESTER 28
Exercise 8.5. Find the the value for x where the following two lines meet:
(1) f (x) = 2x − 3 and h(x) = −4x + 2
(2) f (x) = x + 4 and h(x) = 3x − 5
√ √
(3) f (x) = −5x + 5 and h(x) = − 5x + 5
Exercise 8.6. Consider the two straight lines f (x) = 10x − b and h(x) = x + 5.
Determine the value of b which is such that the two lines intersect when x = 2.
EXC2910 THE FIRST SEMESTER 29
9. Quadratic functions
Note that the various properties of the quadratic function has strong ties to the
solvability of quadratic equations and inequalities, considered in previous sections.
In fact, in the analysis of quadratic functions, it will be useful to factorize the
quadratic expression in order to provide computational insights into the graphical
representations.
Proposition 9.2. Let f (x) = ax2 + bx + c for given real numbers a, b, c. Define two
variables √ √
−b + b2 − 4ac −b − b2 − 4ac
x1 := , x2 := .
2a 2a
EXC2910 THE FIRST SEMESTER 31
With the factorized version of the quadratic function we are in good shape to
answer interesting questions related to the graph of the function. For example; if we
are interested in knowing where the function f (x) crosses the x-axis, we may simple
ask to solve the equation f (x) = 0, or using the factorized representation of f (x) we
then need to solve a(x − x1 )(x − x2 ) = 0. But this is simple to solve: it is clear that
the solution is given by x1 and x2 . On the other hand, if we want to know when f (x)
is positive, we may try to solve the inequality f (x) > 0, or formulated alternatively
as a(x − x1 )(x − x2 ) > 0. But this is then simply solved in a sign diagram, in the
same way as we have done in Section 7.1.
Exercise 9.3. Determine where (if ) the following functions intersect the x axis,
and provide a sketch of the function:
(1) f (x) = −2x2 − 3x + 10
(2) f (x) = x2 − 2x + 1
(3) f (x) = x2 − 9
It is rather easy to determine the value of x which gives us the largest possible or
smallest possible value for f (x). We call this the maximum or minimum point.
Proposition 9.4. Consider the quadratic function f (x) = ax2 +bx+c. The following
statements holds:
i) If a > 0 then there exists a minimum point (and not a maximum point) for
the function f . The minimum value of f is attained at x∗ = − 2a
b
, and f (x∗ )
is the minimal value.
ii) If a < 0 then there exists a maximum point (and not a minimum point) for
the function f . The maximum is attained at x∗ = − 2a b
, and f (x∗ ) is the
minimal value.
Remark 9.5. Note that the formula for the minimum and maximum point is the
same; it is really the sign of a that will determine if the point that we find is a
maximum or minimum. Recall also that the sign of a determines if the function is
shaped like U or like ∩. See Proposition 9.1.
that f will ever take). Then the graph of f is symmetric around the point x∗ . This
means that for any h > 0 we have f (x∗ + h) = f (x∗ − h).
10. Polynomials
10.1. Polynomial division. Given two polynomials say Pn (x) and Pm (x), we want
to divide one by the other, that is, we need to compute Pn (x) ÷ Pm (x), or written
as a fraction, we want to compute PPmn (x)
(x)
. To do this, we can follow very similar
algorithms as we use when we divide large numbers such as 123 4
. In the following
we will limit our self to the case when we have a third-degree polynomial that is
divided by a first degree polynomial, i.e. we will compute
ax3 + bx2 + cx + d
. (10.2)
a′ x + b ′
How we will be able to do this will be illustrated through practical examples.
Example 1: Compute the following polynomial division (x3 +x2 −5x+3)÷(x−1).
Solution: We have that
(x3 + x2 − 5x + 3) ÷ (x − 1) = ......,
and we need to figure out what to put in place of the dots on the right hand side.
We follow this simple algorithm:
(1) Consider the denominator x − 1 consisting of x and −1; and we ask, what
do I need to multiply x with in order to get x3 (the leading order term in
the numerator). The answer is x2 since x2 × x = x3 (and we write this then
EXC2910 THE FIRST SEMESTER 34
below the x3 term). We also see that x2 × (−1) = −x2 (and we write this
below the x2 term). Therefore we write
(x3 + x2 − 5x + 3) ÷ (x − 1) = x2 ......
−(x3 − x2 )
− 2x2
At last we take the two first terms: x3 + x2 and we subtract the two terms
that we computed: x3 − x2 , and we then get −x2 . This is now the term that
we will work with in the next step.
(2) We must now as our self: "What do we need to multiply x with in order to
get −2x2 ?" The answer is −2x. Now if we multiply −2x by −1 (the second
term in the denominator x − 1) we get 2x. We also need to move the −5x
term down next to the −2x2 term and We therefore now write
(x3 + x2 − 5x + 3) ÷ (x − 1) = x2 + 2x....
−(x3 − x2 )
(−2x2 − 5x)
− (−2x2 − 2x)
− 3x
(3) Now we need to ask our self: "What do we need to multiply x with in order
to get −3x?". The answer is −3, and we note that −3 × (−1) = 3. We
therefore get
(x3 + x2 − 5x + 3) ÷ (x − 1) = x2 + 2x − 3
−(x3 − x2 )
(−2x2 − 5x)
− (−2x2 − 2x)
− 3x + 3
−3x + 3
0
Since the remainder is now 0 we conclude that the answer is given on the
right hand side: x2 + 2x − 3.
Example 2: Compute the following polynomial division (−6x3 + 7x2 + 5x − 3) ÷
(2x − 3).
Solution: We have that
and we need to figure out what to put in place of the dots on the right hand side.
We follow this simple algorithm:
(1) Consider the denominator 2x − 3 consisting of 2x and −3; and we ask, what
do I need to multiply 2x with in order to get −6x3 (the leading order term in
the numerator). The answer is −3x2 since −3x2 × 2x = −6x3 (and we write
this then below the x3 term). We also see that −3x2 × (−3) = 9x2 (and we
write this below the x2 term). Therefore we write
At last we take the two first terms: −6x3 + 7x2 and we subtract the two
terms that we computed: −6x3 + 9x2 , and we then get −2x2 . This is now
the term that we will work with in the next step.
(2) We must now as our self: "What do we need to multiply 2x with in order
to get −2x2 ?" The answer is −x. Now if we multiply −x by −3 (the second
term in the denominator 2x − 3) we get 3x. We also need to move the 5x
term down next to the −2x2 term and We therefore now write
(−6x3 + 7x2 + 5x − 3) ÷ (2x − 3) = −3x2 − x....
−(−6x3 + 9x2 )
(−2x2 + 5x)
− (−2x2 + 3x)
2x
(3) Now we need to ask our self: "What do we need to multiply 2x with in order
to get 2x?". The answer is 1, and we note that 1 × (−3) = −3. We therefore
get
(−6x3 + 7x2 + 5x − 3) ÷ (2x − 3) = −3x2 − x + 1
−(−6x3 + 9x2 )
(−2x2 + 5x)
− (−2x2 + 3x)
2x − 3
2x − 3
0
Since the remainder is now 0 we conclude that the answer is given on the
right hand side: x2 + 2x − 3.
EXC2910 THE FIRST SEMESTER 36
Pn (x) a
= Pn−m (x) + , (10.4)
Pm (x) Pm (x)
where a is some number. In the previous two example a = 0. In the next example,
we will consider a polynomial division where a ̸= 0
Example 3: Compute the following polynomial division (x3 +x2 −2x−3)÷(x−1).
Solution: We have that
(x3 + x2 − 2x − 3) ÷ (x − 1) = ......,
and we need to figure out what to put in place of the dots on the right hand side.
We follow this simple algorithm:
(1) Consider the denominator x − 1 consisting of x and −1; and we ask, what
do I need to multiply x with in order to get x3 (the leading order term in
the numerator). The answer is x2 since x2 × x = x3 (and we write this then
below the x3 term). We also see that x2 × (−1) = −x2 (and we write this
below the x2 term). Therefore we write
(x3 + x2 − 2x − 3) ÷ (x − 1) = x2 ......
−(x3 − x2 )
2x2
At last we take the two first terms: x3 + x2 and we subtract the two terms
that we computed: x3 − x2 , and we then get 2x2 . This is now the term that
we will work with in the next step.
(2) We must now as our self: "What do we need to multiply x with in order to
get 2x2 ?" The answer is 2x. Now if we multiply 2x by −1 (the second term
in the denominator x − 1) we get −2x. We also need to move the −2x term
down next to the 2x2 term and We therefore now write
(x3 + x2 − 2x − 3) ÷ (x − 1) = x2 + 2x....
−(x3 − x2 )
(2x2 − 2x)
− (2x2 − 2x)
0−3
EXC2910 THE FIRST SEMESTER 37
We see that (2x2 − 2x) − (2x2 − 2x) = 0. But we need to move down the
−3, so we now have 0 − 3. But there is no positive power of x that I can
multiply x with in order to get −3. And therefore, we take the −3 and add
it to the solution by dividing by x − 1, and we get
3
(x3 + x2 − 2x − 3) ÷ (x − 1) = x2 + 2x −
x−1
−(x3 − x2 )
(2x2 − 2x)
− (2x2 − 2x)
0−3
3
The solution is therefore x2 + 2x − x−1
.
x3 + x2 − 5x + 3 = 0
lim f (x) = 0,
x→∞
"explodes" when x approaches 0, and we say that x = 0 is a critical value for the
function f (x) = x1 . The straight line that can be drawn vertically from this critical
value is then called the Vertical Asymptote.
g(x)
Proposition 11.3. Consider the following function given as a fraction f (x) = h(x) ,
∗ ∗
where g(x) and h(x) are functions. If there exists point x which is such that h(x ) =
0, then x∗ is a point for a Vertical Asymptote (VA) of the function f (x). Thus;
to find the (VA) we simply need to solve the equation h(x) = 0.
12. Differentiation
As we will see later in the curriculum, derivatives of functions will play a central
role in the analysis of different properties of functions. However, the reader might
think that the definition of the derivative looks complicated, and difficult to use in
practice. Fear not; there are several rules for computing the derivative of specific
functions. And it is these rules that we will use throughout the course to compute
derivatives of various functions, and use in the analysis of the graphs produced by
these functions. The next section will recall all these rules.
Exercise 12.2. Use the definition of the derivative in (12.2) to differentiate the
following functions
(1) f (x) = K for some constant number K.
(2) f (x) = 12 x − 2
(3) f (x) = (2 − x)2
EXC2910 THE FIRST SEMESTER 44
f ′ (x) = 0
.
• (Power functions) If f (x) = axn then
f ′ (x) = anxn−1
the first thing we observe is that it is constructed from the sum of the two terms
2x3 and 4x−2 . We can therefore identify these to terms by two functions g(x) and
h(x) by saying g(x) = 2x3 and h(x) = 4x−2 , and thus we immediately that we will
need to use the linearity rule. Secondly, we observe that both g and h in this case
are given as power functions (for g we see that a = 2 and n = 3, and for h we see
that a = 4 and n = −2). Thus in order to differentiate these functions we need to
follow the rule for power functions. By this rule, we see that
and
h′ (x) = 4 · (−2)x−2−1 = −8x−3 .
EXC2910 THE FIRST SEMESTER 45
Thus combining these two results with the rule of linearity, we find that
Once you learn these rules, the considerations done above will quickly be com-
puted, and the derivative is easily found.
Remark 13.1. Sometimes we use different labels for functions. Most of the time, you
might be used to writing f (x) = ... while it is perfectly fine to label the function
with some other letter or symbol. In mathematics it is quite common to use the
Greek alphabet to supplement the Roman alphabet. For example α(x) = x2 is just
another label for the function x2 . In the next sections we will use several different
labels for functions to get used to this.
13.2. Exponential and logarithmic functions. We also need some rules for dif-
ferentiation of the exponential function ex and the natural logarithm ln(x). Recall
that these functions satisfy the following properties:
• eln(x) = x
• ln(ex ) = x
• ex+y = ex ey
• (ex )n = enx
• ln(xn ) = n ln(x)
• ln(xy) = ln(x) + ln(y)
• ln( xy ) = ln(x) − ln(y).
The above properties would be smart to remember. You will remember them by
doing several exercises.
These functions satisfy the following rules for differentiation:
• If f (x) = ex then f ′ (x) = ex
• If f (x) = ln(x) then f ′ (x) = 1
x
We also have some special rules; which can be seen as combinations of the rules of
differentiation for the natural logarithm/exponential function and the general rules
for differentiation above:
• if f (x) = eu(x) then f ′ (x) = eu(x) u′ (x)
• If f (x) = ln(u(x)) then f ′ (x) = u(x)1
u′ (x)
13.3. Exercises. We illustrate the rules for differentiation with the following exer-
cises:
Exercise 13.2 (Power functions). Differentiate the following functions with respect
to x:
(1) f (x) = 9x−2
EXC2910 THE FIRST SEMESTER 46
Exercise 13.4 (Product rule). Differentiate the following functions with respect to
x:
(1) f (x) = ex x3
(2) f (x) = ln(x)x2
(3) f (x) = g(x)x−5
(4) h(x) = 2x−2 4x3
Exercise 13.5 (Quotient rule). Differentiate the following functions with respect to
x:
(1) f (x) = 2x−3
4x+1
(2) f (x) = x14
(3) g(x) = h(x)
x2
+5
3x
(4) f (x) = √x + 4
Exercise 13.6 (Chain rule). Differentiate the following functions with respect to x:
(1) f (x) = (3x + 2)2
(2) f (x) = 1 − ln(x3 )
(3) g(x) = e−3x+2
(4) f (x) = (100x100 − 99x99 )2
Exercise 13.7 (Mixed rules). Differentiate the following functions with respect to
x:
(2x−3)3
(1) f (x) = 4x+1
2
ex
(2) f (x) = x4
(5x+ 2x+1 )−2
(3) g(x) = x
x
2
−1
(4) f (x) = √3x −2
( x+2)
EXC2910 THE FIRST SEMESTER 47
Recall that any straight line y(x) is given on the form of a linear function
y(x) = ax + b, (14.1)
b = f (x1 ) − ax1 .
Replacing a and b in (14.1) with the two quantities found above, we obtainthe
following formula for the secant line intersecting the points (x1 , f (x1 )) and (x1 +
h, f (x1 + h)) :
f (x1 + h) − f (x1 ) f (x1 + h) − f (x1 )
y(x) = x + f (x1 ) − x1
h h
f (x1 + h) − f (x1 )
= f (x1 ) + (x − x1 )
h
What happens then to this line when the points (x1 , f (x1 )) and (x1 + h, f (x1 + h))
is chosen closer and closer to each other? and in particular, when they are infinitely
close to each other? (i.e. when we consider the limit h → 0). Then we obtain the
tangent line; the straight line which "just touches" the curve in one point. The
derivative of the function f plays a central role in describing this line. We summarize
this in the following proposition.
Remark 14.2. Note that the tangent line y is a linear function of x (convince yourself
that it is a linear function). x1 is in this case considered to be fixed (constant). Also
note that this formula looks indeed like the formula for the secant line, but where
we have taken the limit when h → 0.
EXC2910 THE FIRST SEMESTER 48
In order to compute the tangent line, we see that we need to be able to compute
the derivative of a function f (x). The following exercises will require to compute
the tangent line.
14.1. Exercises.
By knowing the derivative of a function, we can figure out several interesting and
important facts about the the function it self. For example; for what values of x will
the function f (x) increase or decrease? which value of x will give me the maximal
(or minimal) output f (x)? and when does the function change from being convex
to concave (or concave to convex)?
To find the maximal or minimal value of a function, we can simply investigate
when the slope of the tangent is zero (i.e. the tangent line is horizontal). Indeed, the
tangent line will only be horizontal in the point where either the slope changes from
negative to positive or from positive to negative, creating a maximum or minimum
point. Recalling from the last section that the slope of the tangent line is given by
the derivative of the function it self, it is sufficient to figure out when the derivative
of the function is 0. This gives rise to the following definition
Remark 15.2. Note that there might be more than one stationary point associated
to a function f .
From this definition it follows that in order to find the stationary points x0 we
need first to find the derivative f ′ (x) associate to the function f , and then solve
the equation f ′ (x) = 0. The solution to this equation is then one (or more) real
number(s) which we call stationary points.
Exercise 15.3. Let f (x) = x2 − 2x + 1. We shall now find the stationary points
of this function. We first compute the derivative. Following the rules in the above
sections, we have that
f ′ (x) = 2x − 2
. Now we need to solve the equation
f ′ (x) = 0.
This is the same as solving the linear equation 2x − 2 = 0. It is readily seen that the
solution to this equation is given by x = 1 Thus, the number x = 1 is a stationary
point of the function f .
Using this, we create a sign diagram for the function, in order to determine
when it is positive and when it is negative.
−1 0 3
———————|———————|———————|———————
x −−−−−−−−−|−−−−−−−−−0 + + + + + + | + + + + + +
x − 3 −−−−−−−−−| − − − − − − | − − − − − − 0 + + + + + +
x + 1 −−−−−−−−−0 + + + + + + | + + + + + + |+++++++++
f (x) − − − − − − 0 + + + + + + 0− − − − − − 0+++++++++
From the sign diagram we see that f (x) < 0 when x < −1 or 0 < x < 3,
and f (x) > 0 when −1 < x < 0 or x > 3. This completes the answer to
point (1).
(2) We begin to compute the derivative of f :
We use the ABC formula again to find stationary points; i.e. solving f ′ (x) =
0. We see that
√ √ √
4 ± 16 + 4 · 9 4 ± 52 4 ± 2 13
x= = = . (15.5)
6 6 6
√ √
This gives the two solutions: x1 = 4+26 13 and x2 = 4−26 13 . For notational
ease we simply keep calling these two numbers x1 and x2 instead of writing
them explicitly. We can factorize the derivative of f as
f ′ (x) = (x − x1 )(x − x2 )
x1 x2
———————|———————|———————
x − x2 −−−−−−−−−|−−−−−−−−−0 + + + + + +
x − x1 −−−−−−−−−0 + + + + + + | + + + + + +
f ′ (x) + + + + + + 0− − − − − − 0 + + + + + +
From the sign diagram we conclude that f (x) = 0 for x = x1 or x2 , f ′ (x) > 0
for x < x1 or x > x2 , and f ′ (x) < 0 for x1 < x < x2 . This implies that
the function f has stationary points x1 and x3 (which are local minima or
maxima) and is increasing when x < x1 or x > x2 and decreasing when
x1 < x < x 2 .
(3) At last we compute the second derivative f ′′ (x):
f ′′ (x) = 6x − 4. (15.7)
In order to find inflection points, we must solve f ′′ (x) = 0. Since the second
derivative is a linear function, this is simple:
2
6x − 4 = 0 ⇔ 6x = 4 ⇔ x = . (15.8)
3
We therefore have an inflection point at x = 23 . We then need to determine
where the function is convex and where it is concave. This we find by solving
f ′′ (x) < 0 and f ′′ (x) > 0. Since this is a linear equation it is sufficent to
check one of them;
2
6x − 4 < 0 ⇔ x < . (15.9)
3
The second derivative f ′′ (x) < 0 when x < 32 , and is therefore concave for
all x < 23 . The function is then convex for all x > 32 .
(4) At last we include a sketch of the function:
Next, you should try the four steps of function analysis on the following exercise.
EXC2910 THE FIRST SEMESTER 53
Exercise 15.6. In the following exercise you are supposed to analyse the given
function by going through step 1-4 above.
(1) f (x) = 2x2 − x
(2) f (x) = ex
(3) f (x) = 3 ln(x)
(4) g(x) = xex
(5) v(x) = (x2 + x−2 )−1
(6) h(x) = ln(x) + ln(x2 ) + ln(x3 )
EXC2910 THE FIRST SEMESTER 54
With the total revenue function at hand, we can compute the marginal revenue.
The marginal revenue tells us approximately how much more we will earn by selling
one more unit. The marginal revenue is given as the derivative of the total revenue
function, i.e. T R′ (x). For example, T R′ (40) tells us approximately how much more
we will earn if we increase our sales from 40 units to 41 units.
EXC2910 THE FIRST SEMESTER 55
We are typically given a total cost function T C(x). This function is given on the
form
T C(x) = A + Bx + Cx2 , (16.5)
where A, B, C are real numbers. The number A we can think of as the fixed cost
of the business; the cost which does not change if we increase the number of units
produced. This could be the cost of renting a factory or shop for example. The
number B represents the variable unit costs; typically the cost of producing one
unit, without taking into account the number of units produced. The number C
is probably the most interesting. This number can be used to represents the extra
costs that accumulates if we produce many units. This is to take into account that
if we where to produce many units, we might need to hire extra staff, rent a larger
warehouse, invest in more equipment etc. This can accumulate where quickly and it
is therefore important to include this in the total costs. Similarly as for the revenue
we are also interested in the marginal cost. This is given as the derivative of the
total cost function T C ′ (x) and tells us approximately how much more it will cost
to produce one more unit. For example T C ′ (40) tells us approximately how much
more it will cost to produce 41 relative to producing 40 units.
The profit when producing and selling x units is typically denoted by π(x) and is
given by the difference between the total revue T R(x) and total costs T C(x),
Note that the profit function in our running example will be a quadratic function
Again we deal with a quadratic function, and given that β + C > 0 we note that the
sign in front of the x2 term is negative. This implies (recall from previous analysis
of quadratic functions) that the function π will have a maximum point (we say that
it is concave; for all x). As a business analyst we are of course interested in finding
the optimal number of units to produce and sell with respect to the given profit
function. That is, we want to find the maximal profit. From our knowledge of
function analysis, we can find this maximum by solving the equation
Recalling that the profit is equal to the difference between total revenue and total
costs, we see that
π ′ (x) = T R′ (x) − T C ′ (x). (16.9)
And thus in order to obtain maximal profit, we must have that
T R′ (x) − T C ′ (x) = 0.
EXC2910 THE FIRST SEMESTER 56
This implies in particular that the maximal profit happens when the marginal rev-
enue is equal to the marginal cost, i.e.
T R′ (x) = T C ′ (x).
With this knowledge of the concepts of financial analysis, you are encouraged to
try the following exercises, which are of a similar type to those that could be given
at an exam.
NOTE: in the following exercises you should use a calculator, as the numbers
will become quite big. Since the numbers are going to be very large, or sometimes
difficult to write explicitly, you are encouraged to label the numbers by letters; for
example you could say that the number 10286903 is called α.
Exercise 16.1. Alf owns a micro brewery. He estimates that the relation between
demand and price p per unit of beer sold as a function of the number of units sold
x is given by
1
p = 80 − x. (16.10)
50
His total costs for producing the beer is given by the function
1 2
T C(x) = 10000 + 2x + x. (16.11)
100
Alf needs your advice on how many units of beer he should produce and sell in order
to obtain the maximum profit. In order to do so, complete the following tasks:
(1) Compute the total revenue function.
(2) Compute the profit function.
(3) Find the maximum of the profit function.
Alf tells you that the government has restricted his production to only 2000 units
of beer. How many units should alf produce then?
Exercise 16.2. Ingrid owns a computer software company. The company produce
and sell a cyber-security software, which is sold to businesses. In her business,
the fixed costs are typically high (labor costs, server costs, location costs) while the
unit costs are very small. At the same time, if the number of units sold gets large,
the business will require new servers, and extra staff which will increase the total
costs. She estimates the following relationship between the price of the cybersecurity
software (per unit) and the number of units sold x
1
x = 1000 − p (16.12)
1000
Her total costs is given by the function
You will hep Ingrid to analyse the profit of her business and figure out how many
units she should sell in order to obtain the maximal profit. To this end, complete
the following tasks:
(1) Compute the total revenue function.
(2) Compute the profit function.
(3) Find the maximum of the profit function.
At last we also present one more quantity of interest; namely the average cost.
This is the average cost per unit when producing x units. We find this from the
following formula:
T C(x)
AC(x) = . (16.14)
x
That is, the average cost is the total costs of producing x units, divided by the
number of units produced.
16.1. Elasticity. The concept of elasticity is used to measure how the change in
one variable will affect the change in another. In light of our discussion of financial
analysis, we are especially interested in the relationship between price p and demand
x, and how a change in the price will impact the change in demand (and vice versa).
We can therefore heuristically think of the elasticity E as the following
relative change in demand
E=
relative change in price
Let us denote by ∆x = change in demand and ∆p = change in price. For example,
∆p = new price−old price. Then the relative change in demand and price is defined
as follows:
∆x ∆p
relative change in demand = , relative change in price = . (16.15)
x p
Thus, our simple formula for the elasticity is given by
∆x
x ∆x p
E= ∆p
= (16.16)
p
∆p x
x = b + ap, (16.17)
EXC2910 THE FIRST SEMESTER 58
for some numbers a and b. In this case, the we can think of the demand, the variable
x (appearing alone on the left hand side), as a function of the price p, and we can
simply write
x(p) = b + ap. (16.18)
This simply means that; given a price p we have a demand x(p).
Going back to the formula for the elasticity in (16.16), let us look at the term ∆x
∆p
Since we are now assuming x is a function of p, then let p0 represent an "old price"
and let p0 + h represent a new price (i.e. the price has moved by h), and then we
have that
∆x x(p0 + h) − x(p0 ) x(p0 + h) − x(p0 )
= = .
∆p p0 + h − p0 h
Note that this fraction is similar to the relative change that we have seen in Section
12, and especially on the right hand side of the definition of the derivative in 12.2.
Thus if we let h → 0, then we see that
x(p0 + h) − x(p0 )
lim = x′ (p). (16.19)
h→0 h
Thus, when considering "infinitely small changes in the price, we get the derivative
of the demand with respect to the price. This gives rise to the following definition
of elasticity of demand with respect to the price:
Exercise 16.4. Compute the elasticity of demand w.r.t. price E(p) and show when
it is elastic, unit elastic or inelastic by using a sign diagram for the following rela-
tionships between price p and demand x.
EXC2910 THE FIRST SEMESTER 59
16.2. Geometric series and annuities. Consider the following sequences of num-
bers:
In each sequence you can try to guess the next number that should appear by
looking at the pattern created by the previous numbers. In particular, let us denote
by a1 the first number appearing in a sequence, a2 the second, and an the nth number
of the sequence. Then in the first sequence above we see that a1 = 1, a2 = 2, a3 = 4
and so on. Note in particular, that a2 = 2a1 . And a3 = 2a2 . In general we see that
a1 = 1
a2 = 2a1 = 2
a3 = 2a2 = 2 · 2a1 = 4
a4 = 2a3 = 2 · 2 · 2a1 = 8
....
We could continue this pattern as long as we want. We see that the base number
here, a1 is equal to 1 and the "multiplicity parameter" k is equal to 2; the next
number in the sequence is given by the previous term multiplied by k = 2.
We call a sequence of this form a geometric sequence. In financial applications
we are especially interested in computing the sum of the numbers in a geometeric
sequence. Let us denote the sum of the first n numbers in a geometeric sequence by
Sn . Then Sn is given by the sum
Sn = a1 + a2 + a3 + a4 + . . . + an .
Sn = a1 + a1 k + a1 k 2 + . . . + a1 k n−1 . (16.20)
EXC2910 THE FIRST SEMESTER 60
When n gets very large, it can be difficult to summarize all the terms quickly, and
it would be convinient to have a simple formula for this purpose. Due to the nice
structure of the geometeric series, we can simply find such a formula. First note
that if we multiply Sn by k we get
k Sn = a1 k + a1 k 2 + . . . + a1 k n .
Essentially we just increase the degree of the polynomial by 1. Let next look at the
difference between Sn and k Sn :
Sn − kSn
= a1 + a1 k + a1 k 2 + . . . + a1 k n−1
− a1 k + a1 k + a1 k 2 + . . . + a1 k n
=a1 − a1 k n .
Thus by factorizing, we see that
Sn (1 − k) = a1 (1 − k n ) (16.21)
which implies that
1 − kn
Sn = a1 .
1−k
Thus in order to sum up all the numbers in a geometric sum up to order n, we can
simply use this formula.
With the above formula, do the following exercise:
Exercise 16.5. Find the base number a1 and the multiplicity parameter in the fol-
lowing geometric sum, and use the formula to compute the value of the sum:
(1) S8 = 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128
(2) S5 = 5 + 15 + 45 + 135 + 405
(3) S3 = 1 + r + r2 (here we assume r is a fixed number)
(4) S8 = 1 + 12 + 14 + 81 + 16
1 1
+ 32 1
+ 64 1
+ 128 . (will this sum ever be larger than 2
if we include more terms? )
EXC2910 THE FIRST SEMESTER 61
17. Annuities
In this section we will discuss the concept of present value and future value of
money, and use this concepts in connection with annuities. An annuity is a stream
of money of equal size arriving with a fixed interval length between them in the
future. It is especially important that the amount that we pay or receive is fixed
for all payments, as we can then use our knowledge about geometric sequences to
easily compute its value.
First let us recall the formula for saving M amount of money and having it in the
bank for n-years at interest rate r:
S = M (1 + r)n . (17.1)
The amount S is then the amount that you have in the bank after n years when
saving M amount of money today at annual interest rate r. Note that S is a future
value; it is an amount that can be obtained after having the money in the bank
for n years. But money has time value! this means that 100 kroner today is worth
more than 100 kr in one year. Indeed, if you are offered 100 NOK today or in 100
year, take the money today and save the money at interest rate r and you will in
one year have (1 + r)100 NOK in the bank, which is greater than 100 NOK. Thus
the same amount is worth more today than in the future. This is a very important
principle in finance and economics, and should be accounted for in most decisions.
In light of this, how much is then 100 NOK received in one year worth today?
This question can be formulated differently; how much money do I have to put in
the bank today in order to have 100 NOK in one year? This implies the following
equation
100 = (1 + r)M (17.2)
where we must solve for M . If r = 0.02, then
100
M= . (17.3)
1, 02
M is then the present value of 100 NOK received in one year.
Suppose now that you are saving a fixed amount of 1 000 N OK per year for 5 years
at 5% interest rate. First payment is done in 1 year. Then you are first interested in
computing the future value of this saving scheme; how much money will we have
1 year after final payment? Let us illustrate this in the following table:
af ter1 year F V1 = M (1 + r)
af ter2 years F V2 = M (1 + r)2 + M (1 + r)
af ter3 years F V3 = M (1 + r)3 + M (1 + r)2 + M (1 + r)
af ter4 years F V4 = M (1 + r)4 + M (1 + r)3 + M (1 + r)2 + M (1 + r)
EXC2910 THE FIRST SEMESTER 62
(1 + r)3 − 1
= 1000 .
r(1 + r)3
Using the formula for the future value, we see that (17.6) holds.
17.1. Annuity loan. A typical mortgage is given as an annuity loan. You first
borrow an amount from the bank, and then repay back in equal repayments over
the duration of the loan. Assume that you borrow K amount of money (insert your
favourite positive number in place of K if you want) at an interest rate r. You
will repay the loan over n years with annual repayments. To make thing easy, you
want each payment to be the same. But how much should each payment be? It is
easiest to see this from the Banks point of view; they are investing K amount of
money today (i.e. lending it to you) at an interest rate r. after one year you will
pay M amount of money, and continue this every year for n years. Therefore, in
order for the bank to not lose money, they need that the present value of the future
down-payments should equal the amount that you borrow today
K = P Vn (17.8)
principal (the principal being the borrowed amount)? Yes: we can think of the first
annual repayment as something which is divided into two parts:
M = rK + installment (17.12)
where rK represents the annual interest rate r multiplied with the borrowed amount
that is still unpaid. In the first payment, we have not paid anything, so this is still
K. In the example above, rK = 0.05 · 1 000 000 = 50 000. Thus 50 000 of the
first down payment will be interest. Then the remaining difference M − rK is the
amount we pay in installment (the amount paid down on the principal). We see
that installment = M − rK = 76 421.51 − 50 000 = 26 421.51 NOK.
17.2. Exercises.
Exercise 17.1. You save 100 NOK every year for the next 50 years at a fixed
interest rate 5%. How much money will you have in the bank after the end of year
50?
Exercise 17.2. You save 100 NOK per month at a monthly interest rate 1%. The
bank compounds your interests monthly. How much money will you have after 50
years?
Exercise 17.3. You borrow 20 000 at annual interest rate r = 20% over 3 years.
a) What is the annual amount of repayment? (i.e. M )
b) How much of the first repayment amount is given as interests and how much
is installment?
Exercise 17.4. You borrow 50 000 at annual interest rate r = 20% over 5 years.
a) What is the annual amount of repayment? (i.e. M )
b) How much of the first repayment amount is given as interests and how much
is installment?
c) What is the present value of the remaining loan after the first repayment,
just before you are going to pay the second? Hint: here you think of the loan
as a stream of cash, use the present value formula.
EXC2910 THE FIRST SEMESTER 65
We see that this is a function of two variables, x and y. We call functions which
depends on two variables for two variable functions.
Similarly as with functions of one variable we can differentiate and analyse two
variable functions. Being a function with two variables, it is much more challenging
to sketch the graph of a two variable function, as it will look like a surface in a
three dimensional space, i.e. we then consider coordinates of the form (x, y, z) =
(x, y, f (x, y)). However, using the techniques from differentiation we can still find
local/global maximum and minimum points, and determine convexity and concavity
etc.
Let us begin with some terminology. We consider a two variable function f (x, y)
where x and y are real numbers. While we can not differentiate with respect to
both variables at the same time, but we can differentiate either with respect to he
x variable, or with respect to the y variable. When differentiating with respect to
x We then say that we take the partial derivative of f (x, y) with respect to x, and
we denote this by fx′ (x, y) or ∂x
∂
f (x, y). If we differentiate with respect to y, we say
that we take the partial derivative with respect to y and write fy′ (x, y) or ∂y ∂
f (x, y).
When differentiating a two variable function with respect to one of the variables,
you essentially view the other variable as constant, and then differentiate the func-
tion in the same way as you would a one variable function.
We illustrate this with the following example:
f (x, y) = x2 + y 2 .
We will find the partial derivatives of this function, both with respect to x and y.
Let us begin to find the partial derivative w.r.t. x.
When we differentiate this function with respect to x, we treat the y variable as
a constant number. Recall that the derivative of a constant number is 0. Therefore,
EXC2910 THE FIRST SEMESTER 66
using the polynomial rule for differentiation on the x component on the function,
we see that
fx′ (x, y) = 2x + 0 = 2x.
Similarly differentiating the function f (x, y) with respect to y, we treat the x variable
as constant. Therefore
fy′ (x, y) = 0 + 2y = 2y. (18.1)
f (x, y) = ex+y − x2 y 3 .
We will find the partial derivatives of this function, both with respect to x and y.
We begin to find the partial derivative w.r.t. x. In doing so, we treat the y variable
as constant. Thus (with a different notation than in the previous example):
∂ ∂ x+y ∂ 2 3
f (x, y) = e − xy , (18.2)
∂x ∂x ∂x
differentiating each of the terms separately (treating y as a constant) we see that
∂ x+y ∂ x y ∂
e = e e = [ ex ]ey = ex ey = ex+y .
∂x ∂x ∂x
∂ 2 3 ∂ 2 3
x y = [ x ]y = 2xy 3 .
∂x ∂x
Combining these two, we see that
∂
f (x, y) = ex+y − 2xy 3 .
∂x
Similarly, to compute the partial derivative w.r.t. y, we see that
∂ ∂ x+y ∂ 2 3
f (x, y) = e − xy . (18.3)
∂y ∂y ∂y
Treating now x as a constant, and y as the variable we differentiate with respect to,
then we have that
∂ x+y ∂ x y ∂
e = e e = ex ey = ex ey = ex+y .
∂y ∂y ∂y
∂ 2 3 ∂
x y = x2 y 3 = x2 3y 2 .
∂y ∂y
Exercise 18.1. Differentiate the following functions both with respect to x and with
respect to y:
(1) f (x, y) = 2x − 3y
(2) f (x, y) = x2 − 2x + 3xy − 400
(3) f (x, y) = ex+y (1 + xy)
(4) f (x, y) = 2xy ln(x2 y)
EXC2910 THE FIRST SEMESTER 67
18.1. Higher order derivatives. The two variable functions can also be differen-
tiated to a higher order, similar to what we have done for one variable functions.
Recall that when we differentiate a function, then the derivative is in itself a new
function, that could potentially be differentiated. For example, f (x, y) = x2 + y 2 ,
then we recall from the example in the previous section that fx′ (x, y) = 2x. We can
differentiate this function once more with respect to x in order to find the second
partial derivative with respect to x to see that
fx′′ (x, y) = 2.
as there is no y term in the derivative fx′ (x, y). The second order partial derivatives
will be denoted in the following way
∂2 ∂2 ∂2
fx′′ (x, y) = f (x, y), fy′′ (x, y) = f (x, y), ′′
fxy (x, y) = f (x, y).
∂x2 ∂y 2 ∂x∂y
The first one is the second partial derivative w.r.t. x, the second is the second partial
derivative w.r.t. y and the third is the second partial derivative w.r.t. x first and
then y. The last one is also often called the mixed-partial derivative. Interestingly,
we have the following:
Exercise 18.3. Differentiate the following functions to the second order; both com-
pute the derivatives w.r.t. x and y and the mixed-partial derivatives.
(1) f (x, y) = 2x2 − 3y 4 + 2xy
(2) f (x, y) = (x + 3)(y + 4)
(3) f (x, y) = 5x2 (x2 − 2xy)
(4) f (x, y) = ln(x2 + y 2 )
1
(5) f (x, y) = x2 +y 2
Recall that a two variable function may represent for example the total cost
function from producing two different goods, where number of units produced is
x and y. Just as in the case of one-variable functions, we are then interested in
knowing the minimum total cost, and to this end find the optimal quantities x and
y such that the total cost becomes as small as possible.
In general when considering a two variable function f (x, y) we are interested in
finding stationary points. Recall that a stationary point for a one variable function
is a point x∗ such that f ′ (x∗ ) = 0. To find such a point in the one dimensional case
EXC2910 THE FIRST SEMESTER 69
we simply differentiate the function f ′ (x) and then solve the equation f ′ (x) = 0.
We will see that finding stationary points for two variable functions will follow by
the very same argument, but we now have two different derivatives to consider; one
for each variable. We summarize this in the following proposition.
So far we have not classified the stationary points that we have found. Recall
that a stationary point for a one variable function can be either a maximum or
minimum point for the function. This is also true for a two variable function, but
here we also have one more category of points; saddle points. Saddle points are
stationary points where the function can be seen as a local minimum point in one of
the variables while being a local maximum in the other variable. This is illustrated
in the following function. We see that in if we follow the x axis, then the function
is convex, while if we follow the y axis, the function is concave. This results in the
saddle point. We can simply check that this occurs in the point (x∗ , y ∗ ) = (0, 0).
In order to classify what type of stationary point we have for a given function (i.e.
local max, min or saddle), we need to compute the second derivatives (in a similar
EXC2910 THE FIRST SEMESTER 71
way as we done for one-variable functions), and then follow a simple test procedure.
We summarize this in the next proposition.
by using the tools from the Proposition. First, we know that a stationary point is
given by (x∗ , y ∗ ) = (0, 0). The first partial derivatives is given by fx′ (x, y) = 2x and
fy′ (x, y) = −2y. The second order derivatives are simply computed:
fx′′ (x, y) = 2, ′′
fxy = 0, ′′
fyy (x, y) = −2.
Exercise 18.6. Find all stationary points of the functions and classify them accord-
ing to Proposition 18.5.
(1) f (x, y) = 3x2 − 2x + 2y 2 − 3y
(2) f (x, y) = x2 − y 2 + 2xy
(3) f (x, y) = 5x4 y 3 − 2y 2
(4) f (x, y) = −xyex+y
(5) f (x, y) = ln(y 2 x2 − 2xy + 1)
The business operates with the following total cost function for producing x units of
Product A and y units of Product B:
1
T C(x, y) = (x2 + y 2 ) + 4x + 5y − xy + 1000.
2
The business asks you to help them figure out the following:
(1) Find the profit function.
(2) Find stationary points of the profit function and classify them.
(3) What is the optimal profit?
(4) The business tells you that they will only be able to produce up to 500 units
of Product A. What will then the optimal profit be?
Exercise 18.8. Find all possible stationary points of the functions in Exercise 7.3
and classify them.
EXC2910 THE FIRST SEMESTER 73
So far we have learned how to find stationary points and classify local maximum
and minimum points associated to the stationary points for a two variable function
f (x, y). In doing so, our approach was completely unconstrained, in the sense that
the variables x and y could potentially be any real number, and was not limited in
any way. However, in reality, we are often interested in optimizing functions under
certain constraints on the variables. We illustrate this with the following example.
Here, the max π(x, y) simply means that we wish to maximize the value of π(x, y).
The condition x + y = 1000 is due to the constraint that the total number of snow-
boards sold must equal to 1000. The goal is thus to choose the optimal combination
of x and y such that the profit π(x, y) becomes as large as possible, while at the
same time ensuring that x + y = 1000.
Illustrated by the example above, the problem of optimizing the function is faced
with a constraint on the variables x, y. We call this optimization under constraint.
There exists several methods to deal with such optimization problems, but in this
course we will work with the method of Lagrange, named after the great 1700 century
Italian mathematician Joseph Louis Lagrange.
Using the method is rather simple in it self and provide a powerful tool for analysis.
In these notes we will only focus on application of the method towards optimiza-
tion of functions under constraints, and will therefore not dig any deeper into the
reasoning behind the method of Lagrange.
We first present a definition for the so called Lagrangian associated with a func-
tion.
Definition 19.1. Let f (x, y) be a differentiable function, and suppose we are given
the optimization problem
The Lagrangian L(x, y) is a new function that we create involving both the func-
tion f (x, y) that we aim to optimize, as well as the constraint condition g(x, y) − c
(note that in order for the constraint equality to be satisfied, we need to find a pair
(x, y) with is such that g(x, y) − c = 0).
We will now present the so called Lagrange multiplier method.
Lagrange multiplier method Suppose you want to solve the following problem:
(3) Solve the above system of three equations with respect to the three unknown
variables (x, y, λ). Any triplet (x, y, λ) that solves these three equations is
a solution candidate, and at least one of the candidates will be the true
solution to the constrained optimization problem.
Let us illustrate the above method with two examples.
Here the constant c = 1. We begin with the step (1) of the method; formulate the
Lagrange function. This is then given by
Continuing with step (2) we see that L′x (x, y) = y − λ and L′y (x, y) = x − λ. We
move to step (3) and formulate the system of equations
L′x (x, y) = y − λ =0
L′y (x, y) = x − λ =0
x + y =1.
In order for the first to equations to hold we must have that x = y. Inserting this
into the third equation, we see that 2x = 1 =⇒ x = 21 . Inserting this information
again into the third equation implies that y = 21 . The only solution candidate is
therefore (x∗ , y ∗ ) = ( 12 , 12 ).
Example: Maximize the function f (x, y) = x + y such that the variables x and
y satisfies the following equation for a circle with radius 1; x2 + y 2 = 1. Written
differently, we want to solve the following problem:
For step (2) we differentiate the Lagrangian function and see that L′x (x, y) = 1−2λx
and L′y (x, y) = 1 − 2λy. For step (3) we then set up the three equations that we
need to solve:
solutions will give us a maximum, and therefore we insert the two solutions into the
original function f to check:
1 1 √ 1 1 √
f (x∗1 , y1∗ ) = f ( √ , √ ) = 2, and f (x∗2 , y2∗ ) = f (− √ , − √ ) = − 2. (19.4)
2 2 2 2
We see that the point (x∗1 , y1∗ ) = ( √12 , √12 ) provides us with a maximum under the
constraint.
To practice optimization under constraints, we recommend to do the following
exercises.
Exercise 19.3. A business is producing two different products. They produce and
sell x units of product A and produce and sell y units of product B. Their profit
function is given by
xy
π(x, y) = −x2 − y 2 + + 200x + 100y − 100.
2
a) What pair (x, y) will give the maximum profit for the business?
b) What is the maximum profit in this case?
c) The management tells you that they want to produce a total of 150 units.
Under this constraint, what is the optimal number of units produced?
EXC2910 THE FIRST SEMESTER 77
20. Integration
We are by now very well acquainted with differentiation of functions, both in one
and two variables. There is also another mathematical concept which has strong
links to differentiation, and can be seen as the "inverse operation" to that of differ-
entiation.
Given a function describing the relationship between distance traveled and time
spent travelling, we can calculate the speed at which we are travelling at any given
moment in time; as illustrated in section 12. The concept of integration works in the
opposite direction; given a function for the speed at which we travel at any point in
time, we can calculate the distance we have travelled.
We begin with a definition of what we call the anti derivative.
This definition tells us that to find the anti derivative of a given function f (x) we
must try to find a function F (x) which is such that its derivative F ′ (x) is equal to
f (x).
Let us illustrate this with an example.
Definition 20.2. Let F (x) be the anti derivative of a function f (x). We then say
that the indefinite integral of f (x) is equal to F (x) and we write
Z
f (x) dx = F (x) + c.
R R
The notation is the symbol for for integration. We say that f (x) dx is an
indefinite integral.
We provide the following three examples for the computation of some elementary
indefinite integrals:
EXC2910 THE FIRST SEMESTER 78
Example:
R
(1) The integral 1 dx = x + c since an anti derivative of the function f (x) = 1
is given by F (x) = x + c (Indeed, check that the derivative of F (x) i equal
to f (x)).
(2) The integral x dx = 21 x2 +c since an anti derivative of the function f (x) = x
R
F ′ (x) = x2 . Thus, using that f (x) = x2 , we see that F (x) + c is the anti
derivative of f (x), and we therefore conclude by definition of the indefinite
integral.
Working with the computation of various indefinite integrals it is useful to follow
some simple rules. We provide these rules in the following proposition.
Proposition 20.3 (Rules for integration). The following computation rules holds
for indefinite integrals
1
R
(1) xp dx = p+1 xp+1 + c for p ̸= −1.
R
(2) a dx = ax + c for some constant a.
R R R
(3) f (x) + g(x) dx = f (x) dx + g(x) dx for any two functions f (x) and
g(x).
R R
(4) af (x) dx = a f (x) dx for some constant a.
R
(5) ex dx = ex + c.
(6) eax dx = a1 eax + c.
R
(7) x1 dx = ln(x) + c.
R
It is strongly encouraged to try to prove for yourself that the above rules holds
by using the definition of the indefinite integral and anti derivatives together with
your knowledge of differentiation.
20.2. Definite integration. As we have seen in the previous section; the indefinite
R
integral f (x) dx and the anti derivative F (x) of a function coincides, and answers
the question "what function is such that its derivative is equal to f (x)?". However,
the concept of integration can be used for a great variety of applications. The most
fundamental being to compute the area underneath a graph induced by a function
f (x). We will illustrate this with the following example. Consider the familiar
function f (x) = x2 . This function has a convex shape, and its graph between x = 0
and x = 5 is given as in the following figure.
and it turns out that we can compute this area by using integration.
Proposition 20.5. Let F (x) be an anti derivative of a function f (x). The definite
integral of f (x) from the point a to b is given by
Z b
f (x) dx = [F (x)]ba = F (b) − F (a). (20.2)
a
EXC2910 THE FIRST SEMESTER 80
With the above definition in hand, we are now ready to compute some definite
integrals. Example Consider the function f (x) = x2 . We are interested in comput-
ing the area underneath the graph of this function between x = 0 and x = 4 (i.e.
the area sketched in blue in the above figure). To this end, we know from the above
Proposition that the area A is given by
Z 4
A= x2 dx. (20.3)
0
We first find the anti derivative of f (x) = x2 . Using the first rule of integration we
find that F (x) = 13 x3 is an anti derivative of this function. Using the proposition to
compute indefinite integrals, we therefore have
Z 4
1 1 1
A= x2 dx = [ x3 ]40 = 43 − 03 ≈ 21.3.
0 3 3 3
Example: Compute the area underneath the graph of the function f (x) = ex
from x = 1 to 2. We now that the anti derivative of ex is simply F (x) = ex .
Therefore Z 2
A= ex dx = [ex ]21 = e2 − e1 .
1
20.3.1. Integration by parts. This technique is one of the most widely used inte-
gration techniques in mathematical analysis, and is highly useful in a great variety
of applications. The technique can help us with the following type of problem:
Compute the following indefinite integral:
Z
f (x)g(x) dx.
Since we have a product between two functions f and g, finding the anti derivative
can be very tricky. However, based on the product rule for differentiation we can
find a relation for this type of integrals which in many cases can help us compute
this indefinite integral.
Let (uv)′ denote the derivative of the product u(x)v(x). Recall that for the
product of two functions we have the following rule of differentiation
(uv)′ = u′ v + uv ′ .
Here, we have simply dropped the (x) notation for later convenience. Integrating
both sides, and using that the anti derivative of (uv)′ is equal to uv, we see that
Z Z
uv = u (x)v(x) dx + u(x)v ′ (x) dx.
′
The above expression is called th integration by parts formula. This formula tells
us that if we want to compute the integral of two functions u′ (x)v(x) then it is equal
to the product uv minus the integral u(x)v ′ (x) dx.
R
Example Compute the indefinite integral of the function f (x) = x ln(x), i.e.
R
x ln(x) dx. To compute this integral we can use the integration by parts technique.
Suppose u′ (x) = x and v(x) = ln(x). Then u(x) = 12 x2 , and v ′ (x) = x1 , and it follows
that Z Z
1 2 1 21
x ln(x) dx = x ln(x) − x dx
2 2 x
In the last integral, we see that we get a cancellation of one x term, and therefore
Z Z
1 2 x
x ln(x) dx = x ln(x) − dx.
2 2
Using that 21 x dx = 14 x2 + c we find that
R
x2
Z
1
x ln(x) dx = x2 ln(x) − + c, (20.4)
2 4
giving us a nice and simple expression for the integral we wanted to compute. Let
us also check that what we have on the right hand side is indeed the anti derivative
2
of x ln(x). To do so, we need to differentiate the function F (x) = 21 x2 ln(x) − x4 .
We observe by the product rule that
1 1
F ′ (x) = x ln(x) + x − x = x ln(x), (20.5)
2 2
We define u′ (x) = ex and v(x) = x. Then we have that u(x) = ex , and v ′ (x) = 1.
By the integration by parts formula, we then find
Z Z Z Z
′ ′
xe dx = u (x)v(x) dx = u(x)v(x) − u(x)v (x) dx = xe − ex 1 dx (20.6)
x x
R
The last integral on the right hand side is straight forward to compute; ex dx =
ex + c, and therefore
Z
xex dx = xex − ex + c = ex (x − 1) + c.
The integration by parts can also be used to compute the definite integral. That
is, for the definite integral we have the following formula
Z b Z b
′ b
u (x)v(x) dx = [u(x)v(x)]a − u(x)v ′ (x) dx.
a a
Rule: When we study an integral of the form f (x)ex dx, try to set u′ (x) = ex
R
and v(x) = f (x). When we study an integral of the form f (x) ln(x) dx, set u′ (x) =
R
Exercise 20.11. (difficult) What must n be for the following equality to hold
x3
Z
xn ln(xn+1 ) dx = (ln(x3 ) − 1).
3
20.3.2. Integration by substitution. Another powerful technique in order to compute
indefinite or definite integrals is called integration by substitution. In this technique,
the idea is to substitute a complicated part of the function we want to integrate by
an easier term, and then substitute back after integration. Let us illustrate this with
an example: We are interested in computing the integral
Z
(2x3 + 3)7 x2 dx.
This looks at first glance like a very difficult integral to compute. However, we can
substitute what is inside the parentheses by a new variable; define u = 2x3 + 3.
Then u is essentially a function of x, and we see that u′ (x) = 6x2 . Therefore we
write du = x2 dx. inserting this into the integral above, we see that
Z Z
3 7 2 1
(2x + 3) x dx = u7 du (20.7)
6
Now the integral on the right hand side is easy o compute with the power rule;
u8
Z
u7 du = + c.
8
Therefore Z
1 8
(2x3 + 3)7 x2 dx = u +c (20.8)
48
EXC2910 THE FIRST SEMESTER 84
Proposition 20.12. Let f (x) and h(x) be two functions such that h′ (x) exists for
all x. Let F (x) be the anti derivative associated to f (x). Then the following integral
holds: Z
f (h(x))h′ (x) dx = F (h(x)) + c. (20.10)
While using this technique for indefinite integrals follows the procedure outlined
in the above example, when considering definite integrals one must also take into
account the substitution that has been done in the integration limits. We illustrate
this in the following proposition.
Proposition 20.13. Let f (x) and h(x) be two integrable functions, and suppose
F (x) is the anti derivative of f (x). Then
Z b Z h(b)
′ h(b)
f (h(x))h (x) dx = f (u) du = [F (u)]h(a) = F (h(b)) − F (h(a)).
a h(a)
Again, this looks like a difficult integral to compute. However, define f (x) = x2 ,
and h(x) = 2x2 − x + 3, and note that h′ (x) = 4x − 1. We then see that
Z 2 Z 2
2 2
(2x − x + 3) (4x − 1) dx = f (h(x))h′ (x) dx. (20.14)
1 1
From the above proposition we then know that
Z 2 Z h(2) Z h(2)
′ 1 h(2)
f (h(x))h (x) dx = f (u) du = u2 du = [ u3 ]h(1) . (20.15)
1 h(1) h(1) 3
By simple evaluation we find that h(1) = 2·12 −1+3 = 4 and h(2) = 2·22 −2+3 = 9
and we get Z 2
1 1
f (h(x))h′ (x) dx = 93 − 43 ≈ 221.6. (20.16)
1 3 3
Exercise 20.14. Identify the functions f (x), h(x), h′ (x) and F (x) such that the
method of substitution can be applied in the following integrals, and compute the
indefinite integrals:
R
(1) 2(2x − 3)2 dx
R
(2) (ex − 2)(ex − 2x + 3) dx
(3) 4 (2x(x−1)
R
2 −4x+3) dx
R
(4) 2(2x − 3) ln(2x − 3) dx.
ax + by = p1
(21.1)
cx + dy = p2 ,
for any specific numbers a, b, c, d and p1 , p2 . The two equations describe a specific
relationship between the two variables x and y, and our goal is to find a pair of
numbers (x, y) which solves both equations at the same time. To solve this sys-
tem of equations we have used either the method of substitution or the method of
elimination. These two methods works very well when we are considering the above
problem; two equations with two unknowns. We have also solved a system of three
equations with three unknowns of the form
where the solution is given as a triple (x, y, z). We have observed that by using
the same methods as described above for the system of two equations to solve the
system of three equations, we will spend significantly more time, as the system gets
much more involved. In applications to business, finance, economics or marketing,
we typically have a very large number of equations describing a relationship between
several different variables, and using these methods to solve such equations is then
very difficult.
To reduce the complexity of such large systems of equations, one can represent the
equations through a mathematical construction called a matrix (matrices in plural).
A matrix is an array collecting all the coefficients in front of the unknown variables
in a system of equations. For example, relating to the system of two equations in
(21.1) we construct the matrix
!
a b p1
.
c d p2
The first column to the left in this matrix represents the coefficients multiplied with
the x variable in (21.1), and the second column represents the variables multiplied
by y. The column that comes after the vertical line represents numbers on the right
hand side of (21.1). This matrix provides a simple way to represent the coefficients
appearing in (21.1), without writing up the variables x and y; the position of each
number implicitly describes how the numbers relates to each variable. Similarly, we
can construct a matrix corresponding to the system of three equations in (21.2) as
EXC2910 THE FIRST SEMESTER 87
the following
a11 a12 a13 p1
a21 a22 a23 p2 .
Where the right hand side is the reduced matrix. Note that this implies that the
following system of equations
−x + 2y = 2
x+y =0
has the solution (x, y) = (− 34 , 43 ).
Example: Use Gauss elimination method to find the reduced matrix associated
to
1 0 2 4
2 1 −1 0 . (21.6)
0 0 3 3
Our goal is now to use the elimination method to find a matrix
1 0 0 x
0 1 0 y .
0 0 1 z
for some numbers x, y, z.
EXC2910 THE FIRST SEMESTER 89
0 0 3 31 3 13 0 0 1 1
Multiply now the third row with 2 and subtract it from the first row to obtain
1−0 0−0 2−2×1 4−2×1 1 0 0 2
2 1 −1 0 = 2 1 −1 0 .
0 0 1 1 0 0 1 1
Now we only need to deal with the second row. We note that this is simply combina-
tion of two operations, one involving the first row, and one involving the third row.
multiply the first row by 2 and subtract it from the second row to obtain. Begin to
multiply the first row by 2 and subtract from the second row. Then we get
1 0 0 2 1 0 0 2
2 − 2 × 1 1 − 0 −1 − 0 0 − 2 × 2 = 0 1 −1 −4 .
0 0 1 1 0 0 1 1
0 0 1 1 0 0 1 1
We have now obtained the reduced form of the matrix, and we see that (x, y, z) =
(2, −3, 1). This corresponds then to the solution of the following system of equations
with three unknowns
x + 2z = 4
2x + y − z = 0
3z = 3.
Exercise 21.1. Use Gauss elimination method to reduce the following two dimen-
sional matrices:
! ! !
−3 2 4 −1 1 1 −4 −1 5
a) b) c)
4 1 −2 2 1 −3 2 1 −1
.
EXC2910 THE FIRST SEMESTER 90
Exercise 21.2. Use Gauss elimination method to reduce the following two dimen-
sional matrices:
1 2 −3 2 −1 1 −1 2
a) 3 −4 1 0 b) 2 −1 2 0
0 2 −1 1 2 −1 −1 1
.