Differential Calculus
Differential Calculus
Differentiation
Dr Ioannis Moutzouris
Academic year: 2018-2019
1
1. Definitions
Definition: Limit
The limit of f(x) as x approaches a equals L if we can make the values of f(x) arbitrarily
close to L (as close to L as we like) by taking x to be sufficiently close to a (on either
side of a) but not equal to a. We write
lim f x L
x a
2
Definition: Slope of a line
The slope of a line is defined as the amount by which its vertical co-ordinate changes
for a unit increase along the horizontal axis, i.e.
Geometrically, the slope of a line is just the tangent of the angle created by the
intersection of the line and the horizontal axis.
3
Definition: Instantaneous rate of change
The instantaneous rate of change of y=f(x) with respect to x at x=x1, which is
interpreted as the slope of the tangent to the curve y=f(x) at P(x1,f(x1)), is define as
y f x2 f x1
lim lim
x 2 x1 x x 2 x1 x2 x1
f x f a f a h f a
f ' a lim lim
x a xa h0 h
4
Continuity is a necessary condition for differentiability but it is not sufficient. That is,
although differentiability implies continuity, the converse it is not true.
Continuity at a point only rules out the presence of a gap, whereas differentiability
rules out “sharpness” as well. Therefore, differentiability calls for “smoothness” of the
function as well as its continuity.
Example:
The function
y f ( x) | x 2 | 1
is continuous at x=2,but it is not differentiable at x=2.
Observations:
The tangent line to the curve y=f(x) at P(a,f(a)) is the line through P whose slope is
f’(a) , the derivative of f at a.
The derivative f’(a) is the instantaneous rate of change of y=f(x) with respect to x
when x=a.
5
The derivative f’(x) is itself a function
If y=f(x) is a linear function of x, the concepts of average rate of change and the
instantaneous rate of change (the derivative) are equivalent. In other words, the tangent
line to a straight line is the line itself. Also the slope of a line is constant.
35
30
25
20
15
10
0
1 3 5 7 9
-5
6
Example: rate of change of linear function
The production function of a company has the following form:
y 3x 2
Where, y is the output and x is the input, find change in the production for a unit
change in input.
Choose two points on the domain, and find the respective function values
y f ( x) 3 x 2 x1 = 1 y1 3(1) 2 5
x2 = 2 y 2 3(2) 2 8
Compute the slope:
y y2 y1 8 5 3
m 3
x x2 x1 2 1 1
The rate of change in the company’s production function is 3. This means that if the
input for this company increase by one unit the production will increase three times.
7
Example: rate of change of non linear function
The revenue of a company is given by the non-linear form:
y 5 10 x x 2
Where x represents the units of output (for example, cars).
35
30
25
20
15
10
1 3 5 7
8
The rate of change in the revenue (slope of the tangent to the curve) is not the same at
different levels of output. It increases in the beginning and reaches a maximum, and
declines after the maximum. If we plot the graph of the different values taken by the
tangent on the curve, we find:
15
10
0
-1 1 3 5 7 9 11
-5
-10
The plot shows that the rate of change of the function is positive for values of output
lower than 5 and negative for values of output bigger than 5.
9
2. Rules of Differentiation
1) The Constant Function Rule
Derivative of a constant is zero, f ( x ) c
y' f ' ( x ) 0
10
3) Constant times a Function Rule
f ( x) c. g( x)
Derivative of a constant times a function is equal to the constant times the
derivative of that function:
y' f ' ( x ) c. g' ( x )
11
5) Product Rule
Derivative of product of two functions f ( x) g( x). h( x) , is:
e.g. a) y f ( x) 2 x 2 (1 3x)
y ' 4 x(1 3x) ( 3)( 2 x 2 ) 4 x 12 x 2 6x 2 4 x 18x 2
1 3
b) y f ( x ) ( 2 3x 2 ) x
3
1
y ' 6x ( x 3 ) ( 2 3x 2 ) x 2 2 x 4 2 x 2 3x 4 5x 4 2 x 2
3
12
6) Quotient Rule
The derivative of the ratio of two functions, f(x)= g(x) / h(x) is:
g ' ( x ) h( x ) h ' ( x ) g ( x )
y ' f ' ( x)
[h( x)]2
Where g(x) is a differentiable function
3x 2 x 3
e.g y
x3 1
( x 3 1)(6 x 1) (3x 2 x 3)(3x 2 )
y' f' (x)
(x 3 - 1) 2
[6 x 4 x 3 6 x 1] [9 x 4 3x 3 9 x 2 ]
y' f' (x)
( x 3 1) 2
13
7) The Power of a Function Rule
The derivative of a function raised into the power of n, f ( x) [g( x)] is:
n
e.g. a) y f ( x) (1 3x 2 ) 3
g( x) 1 3x 2 g '( x) 6x
y ' 3(1 3x 2 ) 2 (6 x) 18 x(1 3x 2 ) 2
(18 x)(1 6 x 2 9 x 4 )
= -162x 5 108 x 3 18 x
14
8) If, y f ( u) and u = g( x) , where g(x) and f(u) are both differentiable
functions, then the chain rule of derivatives can be applied as follows:
dy dy du
y'
dx du dx
e.g.
a) y ( x 2 3x 1) 3 let us assume y = u 3 and u = x 2 3x 1
dy dy du d (u 3 ) d ( x 2 3x 1)
dx du dx du dx
= 3u 2 (2 x 3) = 3( x 2 3x 1) 2 (2 x 3)
15
2.1. Derivatives of Exponential and logarithmic functions
1) The Natural Exponential Function Rule
i) f ( x) e x f'(x) e x
ii) f(x) e g(x) f'(x) g'(x)e g(x)
iii) f(x) keg(x) f'(x) kg'(x)eg(x)
iv ) f(x) a g(x) f'(x) g'(x)a g(x) . ln a
e.g. a) y e2 x y' 2e 2 x
x3 x 2 x3 x 2
b) ye y' ( 3x 2 x)e
2
3(x 2 1 ) 3(x 2 1 )
c) ye y' 6 xe
16
2) The Natural Logarithmic Function Rule
1
i) f(x) ln x f'(x)
x
g ' ( x)
ii) f(x) ln g ( x ) f'(x)
g ( x)
iii) f(x) log a g ( x )
ln g ( x ) g ' ( x)
f'(x)
ln a g ( x) ln a
36 x 2 3
e.g. a) y ln 12 x 3
y' 3
12 x x
2x 1
b) y ln( x 2 x 1) y'
x2 x 1
5 1
c) y ln(5 x) y'
5x x
2x 1
d) y log( x 2 4) y' *
x 2 4 ln 10
17
2.2. Higher order derivatives
It is possible to find the derivative of a derivative of a function. This is called the
second derivative of a function and measures the slope and the rate of change of the
first derivative.
The notation for the second derivative is y’’ or f’’(x). Similarly, the third derivative of
a function, f’’’(x), measures the slope and the rate of change of the second derivative
and so on and so forth.
The rules for taking the second and higher derivatives are the same as before.
Example:
a) y f ( x) 2 x 2 3x 5 y ' f '( x) 4 x 15x 4
y ' ' f ' '( x) 4 60x 3
y' ' ' f ' ' ' ( x) 180 x 2
18
3. Applications of Derivatives
So far we learned how to find the derivative of a function. Now we study the use of
these derivatives in applications such as plotting functions, finding maximum,
minimum, point of inflection and curvature of a function. We also study some
economic applications of derivatives.
19
3.1. Increasing and decreasing functions
Definition:
A function f(x) is said to be increasing (or monotonically increasing), if successively
larger values of the independent variable x always lead to successively larger values of
f(x), that is if
x1>x2 f(x1)>f(x2)
20
Proposition:If a function is differentiable and decreasing at an interval, its first
derivative is negative, f’(x)<0 at this interval.
This indicates that the slope of the curve at any point, within that interval, is negative.
The figure below illustrates a decreasing function, which has a negative first derivative
at point A and within the chosen interval.
x 0.8
0.7
0.6
y 0.5
0.4
0.3
0.2
0.1
0
-1 -0.8 -0.6 -0.4 -0.2 0 0.2
[Decreasing function]
21
Proposition:By the same token, a function with a positive first derivative within an
interval is an increasing function. The slope or value of the tangent to any point on an
increasing function is positive. The following figure shows an increasing function
0.8
0.7
0.6
y 0.5
0.4
x 0.3
0.2
0.1
0
-1.8 -1.6 -1.4 -1.2 -1
[Increasing function]
22
3.2. Concavity and Convexity
Definition:
A function is said to be concave at x=a, if at some small region close to the tangent to
the line at point [x=a, f(a)], the graph of the function lies below the tangent line.
On the other hand a function is said to be convex at x=a, if at some small region
around the point [x=a,f(a)], the graph of the function lies completely above the
tangent line. The figures below show the graphs of two concave and convex functions.
-0.1 0.8
1 1.2 1.4 1.6 1.8 2
-0.2 0.7
0.6
-0.3
0.5
-0.4
0.4
-0.5 0.3
0.2
-0.6
0.1
-0.7
0
-0.8 -1.8 -1.6 -1.4 -1.2 -1
23
The first derivative measures the rate of change of a function. The second derivative is
the measure of the rate of change of the first derivative.
We can distinguish the following cases (see the figures):
24
The first derivative a function f tells us about its slope. The second derivative of a
function informs us about the curvature of its graph.
We can find whether a function is concave or convex at a point by finding the value of
its second derivative at that point.
Proposition:
If at x= a y''=f''(a)>0 then f(x) is convex at x=a
25
a) f’(x)>0 b) f’(x)<0
f’’(x)>0 f’’(x)>0
c) f’(x)>0 d) f’(x)<0
f’’(x)<0 f’’(x)<0
26
Examples:
Find the slope and curvature of following functions at x=3;
a) y x 2 1
y ' f ' ( x) 2 x f ' (3) = -6 0
y ' ' f ' ' ( x) 2 f'' (3) = -2 < 0
b) y x3 x
y ' f ' ( x) 3 x 2 + 1 f ' (3) = 28 > 0
y'' f''(x) 6 x f''( 3 )=18>0
27
3.3. First derivative test for relative extremum
At a relative maximum or minimum point the function is neither decreasing nor
increasing. Therefore if a relative extremum occurs, either the first derivative does not
exist or if it does is zero. We restrict ourselves to continuous and differentiable
function. Thus
f ' x0 0
The points of the domain at which the first derivative of the function is zero, are
called critical values.
For example, in the figure below, the slope of the tangent lines at x= -1 and x=1 are
zero and at these two point there are a relative maximum and a relative minimum,
respectively.
28
3.3.1. Second derivative test for relative extremum
If x=x0 is a critical value of f(x), then f(x0) will be
1. A relative maximum if f’(x) changes its sign from positive to negative from the
immediate left of the point x0 to its immediate right. Equivalently,
2. A relative minimum if f’ (x) changes its sign from negative to positive from the
immediate left of the point x0 to its immediate right. Equivalently,
29
Note: In order to find maximum and minimum points on a curve (function), we follow
two steps;
i) Take the first derivative of the function, f’(x), set it equal to zero and solve for the
critical point(s), x=x1 , x=x2 , etc. This step is known as the first-order condition,
FOC.
ii) Take the second derivative of the function, f’’(x), and evaluate it at the critical
point(s). This step is known as second-order condition, SOC.
0.8
0.6
0.4
0.2
0
-2 -1 0 1 2
-0.2
-0.4
-0.6
-0.8
30
Example: Find relative maximum and minimum points of the following functions;
a) y x 2 1
FOC : y ' f ' ( x) 2 x 2x 0 x0
b) y 2 x 3 6 x 12
FOC : y ' f ' ( x) 6 x 2 - 6 6x 2 6 0 x1 1 , x 2 1
31
3.3.2. The Nth-derivative test
If f’(x0)=0 and f’’(x0)=0 then f(x0) can be either a relative maximum or minimum, or
an inflectional value (an inflectional value is a point of the graph in which the
curvature changes from concave to convex or vice-versa).
32
3.4. Economic applications of derivatives
3.4.1. Relationship between total, marginal, and average concepts
Marginal Revenue, MR, is defined as the change in the Total Revenue caused by a
unit increase in production. Therefore, using derivative notation
MR d(TR)
d(Q)
33
Average revenue, AR, is defined as the revenue from the sale of each unit, and can
be obtained by dividing the total revenue by the number of units sold as follows;
TR PQ
AR P
Q Q
Find the average and marginal revenues for the following total revenue function and
evaluate them at Q=10 and Q=5.
TR 200Q 3Q 2
d (TR) TR 200Q 3Q 2
MR 200 6Q AR = 200 3Q
dQ Q Q
34
3.4.1.2. Marginal and Average Cost (cost minimisation)
Total Cost, TC, is defined as the total cost of all factors of production involved in
the production of a certain level of output. Total cost consists of two parts, Total
Fixed Cost (TFC) and Total variable Cost (TVC). Where, Fixed costs are those
which are constant and do not vary with the output level, while, the variable cost are
those which vary with different levels of output. Therefore we can write;
TC=f(Q)=TVC+TFC
Marginal Cost, MC, can be defined as the change in the total cost caused by
producing an additional unit of output.
d(TC)
MC f ' ( Q)
d(Q)
Average Cost, AC, is the cost of production of one unit which can be obtained by
dividing the total cost by the number of units produced in the following form;
TC F ( Q )
AC
Q Q
35
Example 1: Find the average cost, AC, and marginal cost, MC, for the following total
cost, TC, function and evaluate them at Q=10 and Q=5.
TC Q3 10Q 2 30Q 20
Now, if we sketch the graphs of total and marginal cost curves, we see that;
36
1) Total cost first rises until reaches a maximum and then falls until reaches its
minimum and then rises again.
2) Marginal cost curve is positive until the total cost reaches its maximum, at this
point marginal cost becomes negative indicating that total cost is falling. Marginal
costs stays at the negative region until total cost reaches its minimum. At this point,
marginal cost will become positive indicating that the total cost is rising again.
75
65
55
45
Cost
35
25
15
-5 0 1 2 3 4 5 6 7 8 9 10 11 12
Quantity
TC MC
37
Now let us find the minimum and maximum of the total cost function. This is
equivalent to setting the MC to zero and solve it to find where the MC cuts the
horizontal axis.
20 400 4 * 3 * 30
MC 3Q 2 20Q 30 0 Q1 , Q2
6
20 40 20 40
Q1 4.38 and Q 2 2.79
6 6
Profit, , of an organisation is the total revenue less total cost and can be shown as;
TC 4Q 12Q 10
2
TR TC Where
TR 3Q 8Q 5
2
Therefore, using the cost and revenue functions above, the profit function will be;
38
TR TC
f (Q) (3Q 2 8Q 5) (4Q 2 12Q 10) Q 2 20Q 5
Having the firm’s total cost and revenue functions (above examples), it is possible to
find the output level, which maximises its profit.
39
3.4.3. Inventory Management
Example 1: A bicycle retailer examined past data and estimated the following
inventory cost function as a function of the order size (the number of bicycles).
C 4,860 Q -1 15 Q 750,000
The order size, which minimises annual inventory costs may be found by optimising
the above function with respect to Q.
Q 2 324 Q 18
40
The turning point is at q=18 bicycles.
Therefore the optimal order size which minimises annual inventory costs is 18
bicycles.
41
3.4.4. Elasticities
42
Therefore, it is the shape of the demand (supply) curve that defines the elasticity of
demand (supply).
For example, if the demand for a commodity does not change with the changes in the
price of that commodity, the demand for the commodity is said to be perfectly
inelastic, figure (b) below.
The price elasticity of demand is unitless and negative, and in practice, we are
interested in the absolute value of this number. Therefore, the higher the number, the
more elastic is the demand curve. Following figure shows three special cases of
demand curve;
43
P P P
Ed>1
Ed+ Ed=0 P1 Ed =1
Ed<1
Q Q Q
(a) (b) (c)
44
Example 1: Find the price elasticity of demand at prices, P=£100, P=£300, for the
following demand function
Q 1000 2P
i) Find the first derivative of the demand equation with respect to price
dQ d (1000 2 P)
2
dP dP
P=£100 Q=1000-2*100=800
iii) Multiply the price-demand ratio by the value of derivative found in stage (i).
100 1 1
Ed (2) (-1/4) 1 inelastic demand
800 4 4
45
ii) Now we must find the price elasticity of demand when P=300
P=£300 Q=1000-2*300=400
iii) Multiply the new price-demand ratio by the value of derivative found in stage
(i).
300 3
Ed (2) then (-3/2) 1.5 1 elastic demand
400 2
Next, we need to find the quantity and price at which the elasticity is equal to one, i.e.
the demand curve is unit elastic. For this purpose, we need to set the elasticity equal to
one (note that it should be -1), and solve for value of Q in terms of P as follows.
dQ P P
Ed 1 * 1 - 2 * 1 - 2P -Q Q 2P
dP Q Q
46
Substituting the value of Q in terms of P in the demand equation will result in the price
at which the price elasticity of demand is equal to one.
Q 1000 2 P
2P 1000 - 2P 4P 1000 P 250
Q 2P
It has is also been proved that the price elasticity of demand of a linear demand curve
with a negative slope depends on the level of the price.
47
The summary of different forms of price elasticity
48
Example 3: Find the elasticity of demand for the following logarithmic demand
function at P=2 and p=5.
ln Q 20 3ln P
dQ dP
E
we need to find d (1)
Q P
d ln Q 1 dQ
we know that if dQ d ln Q
Q , then Q
d ln P 1 dP
also we know that if dP d ln P
P , then P
49
Substitute the values of dlnQ and dlnP in (1), will result in the elasticity of demand.
dQ
Q d ln Q
Ed 3
dP d ln p Ed=3
p
It can be seen that whatever value assigned for P and Q the price elasticity of demand
for a logarithmic demand function of the form lnQ=a-b*lnP would be constant, which
is (-b).
50
3.4.4.1. Use of price elasticity of demand for producers
We know that the revenue of a producer depends on the price of products and the
demand for the products. Therefore the total revenue of the producer, TR, can be
obtained by multiplying the price, P, by the demand for that good, Q.
TR = P*Q
We also know that the marginal revenue of the producer is equal to;
d (TR)
MR d(P Q) dQ dP dP
dQ MR MR P Q M R P Q *
TR PQ
dQ dQ dQ dQ
Q dP 1
M R P1 * M R P1
P dQ Ed
51
Now, it can be seen that if the price elasticity of demand is equal to one, then the MR
will be zero and revenue will be at maximum level.
If Ed , M R 0 and M R P
If Ed 1, MR 0
If Ed 1, MR 0
If 0 Ed 1, MR
If Ed 0 , M R 0 and M R
52
3.4.4.2. Income elasticity of demand
The income elasticity of demand can be defined as the percentage change in the
demand due to a percentage change in income. Mathematically;
Q
100
Percentage change in quantity Q
Percentage change in price income I
100
I
This is equivalent to:
dQ
dQ I Q dQ I
or or
Q dI dI dI Q
I
Depending on the type of good under study, the income elasticity of demand can take
different values. For example, if the value of the income elasticity of demand is greater
than zero, the good is a normal good. This means that, a percentage increase in income
result in a percentage increase in demand.
53
If the value of income elasticity of demand for one good found to be less than one,
then the good is an inferior good, i.e. a percentage change in income result in a
percentage decrease in demand for that good.
Finally, if the income elasticity of demand for a good is found to be zero, then the
good is categorised as neutral good, i.e. a percentage change in income will not have
any effect on the demand for that good.
54
3.4.4.3. Cross Elasticity of Demand
The Cross Elasticity of Demand is defined as the percentage change in the quantity
demanded of Q with respect to a percentage change in the price of another good
(substitute or complement), Py . Mathematically:
dQ / Q dQ Py
Qy
dPy / Py dPy Q
If the Cross Price Elasticity of demand is found to be negative, then a % increase in the
price of the second good will result in a decrease in the demand for the first good.
Such commodities are said to be complements, for example, coffee and sugar.
EQy < 0 when Q, Y are complements
On the other hand, if a percentage increase in the price of the second good increases
the demand of the first good (the good under study), then they are called substitutes,
for example, coffee and tea.
EQy > 0 when Q, Y are substitutes
55
Example: Given the demand function, P Q 4Q 96 , find the price elasticity of demand
2
at P=51. Also find how much the demand changes if price rises by 2%.
P Q2 4Q 96
P=51 51 Q 2 4Q 96 -Q 2 4Q 45 0
This will result in Q=-9 and Q=5. Obviously the first solution does not have an
economic meaning. Therefore, Q=5. Now find the derivative of P with respect to
Q; that is
dP dQ 1
2Q 4
dQ dP - 2Q - 4
56
dQ 1 1
we know that P=51 and Q=5, therefore
dP - 2(5) - 4 - 14
It is easy to find the elasticity of demand using the above value for the derivative
of Q with respect to P.
P dQ 51 1
Ed * * 0.73
Q dP 5 14
This implies that a 2% increase in price will decrease the demand by 1.46%
57
3.5. Taylor and Maclaurin Series
dy d{f (x)}
Let y = f(x), then f 1(x)
dx dx
d2y d{f 1(x)}
2
f 2
(x)
dx dx
d 3 y d{f 2(x)}
3
f 3
(x), etc .
dx dx
1 2
f(x) f(x 0 ) f 1 (x0 ) (x - x 0 ) f (x0 ) (x - x 0 )2
2!
1 3 1 n
f (x0 ) (x - x 0 )3 f (x0 ) (x - x 0 )n Remainder
3! n!
58
where f(x0) is the value of f(x) at the point x0 and n! reads n factorial where
n! n (n - 1 ) (n - 2 ) 2 1
Note 0! = 1! = 1.
1 2 1 3 1 n
f(x) f( 0 ) f 1 ( 0 )x f ( 0 ) x2 f ( 0 ) x 3 f ( 0 )x n Remainder
2! 3! n!
59
Examples of Maclaurin series expansion
Example 1:
Let f(X) ( 1 X)3
We know that ( 1 X) 1 3 X 3 X X . Use MacLaurin's Series to prove it.
3 2 3
f(X) ( 1 X)3 f( 0 ) 1
f 1(X) 3( 1 X)2 f 1( 0 ) 3
f 2(X) 6( 1 X) f 2( 0 ) 6
f 3(X) 6 f 3( 0 ) 6
f 4 (X) 0 f 4 (0) 0
1 1
f(X) 1 3 X 6 X2 6 X3
2! 3!
Thus (1 X) 3
1 3 X 3 X 2
X 3
60
Example 2: Find the value of e
Let f(X) e x then f(X) ex f( 0 ) e 0 1
f 1(X) e x f 1( 0 ) e 0 1
f 2(X) e x f 2( 0 ) e 0 1
X2 X3 Xn
e 1 X
x
...
2! 3! n
61
Another example of Taylor Series
Taylor series expansion is used to measure the sensitivity of bond prices with respect
to changes in interest rates. Using the first two terms of a Taylor series expansion to
approximate the price change we can write
dP 1 d 2P
dP dy 2
(dy) 2
error
dy 2 dy
Dividing both sides of equation by P to find the percentage price change results in
dP dP 1 1 d 2P 1 error
dy 2
(dy )
2
P dy P 2 dy P P
The duration of the bond is define as
1 dP
D
P dy
62
The convexity of the bond is defined as
d 2P
C 2
dy
Bond Price
Actual
price
increase The line representing slope of the curve
Actual
price fall
Current rate Interest rate
Rate decrease Rate increase
63