Lecture 5 - Differentiation

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 29

Basic Differentiation

Formulas

If the derivative of a function is its slope, then for a


constant function, the derivative must be zero.

d/dx = dk/dx = 0 or ƒ’ = 0
d
 c  0
dx
example: y 3 y  0
The derivative of a constant is zero.
Power Rule:
If n is any real number, then d n
dx
 x   nx n 1

Examples: f  x   x 4 f   x   4 x3
y  x8 y  8 x 7

(3) ƒ’(x) = x x = 1x0 = 1

(4) d/dx x0 = 0(x-1 ) = 0

(5) d/dx x-3 = -3x-4 = [-3/x4 ]

(6) d/dx x ½ = (1/2)x- ½ [ = 1/(2√x) ]


Constant Multiple Rule:

If c is a constant and f is differentiable function, then

d du
 cu   c
dx dx

d n n 1
Examples: cx  cnx
dx

d
7 x  7  5 x  35 x
5 4 4

dx
Exercise 7.1 page152:
The Sum Rule:
d du dv
 u  v  
dx dx dx

Example: y  x  12 x
4
y  4 x  12
3

The Difference Rule:


d du dv
 u  v  
dx dx dx

y  x  2x  2
4 2 dy
Example:  4 x3  4 x
dx
Example
(1) d/dx (7x4 + 2x3 -3x +37)
= 28 x3 +6x2 -3 + 0
=28x3 + 6 x2 -3

(2) d/dx = (ax2 +bx + c )

= 2ax + b
The Product Rule:
d dv du
 uv   u  v Notice that this is not just the
dx dx dx product of two derivatives.

This is sometimes memorized as: d  uv   u dv  v du


d  2
dx 

x  3 2 
x 3
 5 x    
  x 2  3  6 x 2  5    2 x 3  5 x   2x 

6 x 4  5 x 2  18 x 2  15  4 x 4  10 x 2

10 x 4  33x 2  15
The Quotient Rule:
du dv
v u  u  v du  u dv
d u dx dx d 
   or 2
dx  v  v2 v
  v

Example:

d 2 x  5x
3

    
x 2  3 6 x 2  5  2 x3  5 x  2 x 

x 
2
dx x  3
2 2
3
Ex- 2

d/dx(2x -3)/(x + 1)

=[2(x+1) – (2x -3) (1)]/(x + !)2

= 5/(x + 1 )2
Exercise 7.2
Ex -3 Page 160
d/dx [( ax2 + b)/cx] =

[2ax(cx) – (ax2 + b) (c)]/ (cx2 )


= (ax2 – b)/cx2)
Derivative of the Exponential
Function
Main formula

Other Formulas for Derivatives of Exponential


Functions
Derivative of the Natural
Logarithm
The formula for derivative of the natural log is

Since logb (is any other based log) can re-written


as:
Derivative of the Logarithm
and since 1 / ln (b) is a constant
Exercise
1. d/dx (x) ln(x)
= ln(x) + 1
2. Find the derivative of y = ln x2
y = ln x2 = 2 ln x
 The derivative will be simply 2 times the derivative
of ln x.
Exercise
Find derivative of
d/dx log10 (x) = 1/[x(ln(b)]
= ½.302585
Second Derivative
Given f(x) =x3
d/dx = f ‘ = 3 x2

The Second derivative is


d2/dx2 = f ‘’ = 6 x

Example:
f(x) = 3x3 -6x2 + 2x -1
d/dx = f ‘ = 9x2 – 12x + 2
d2/dx2 = f ‘’ = 18 x - 12
Example of Using First and Second
Order Conditions
Suppose you have the following function:
f(x) = x3 – 6x2 + 9x
Then the first order condition to find the critical
points is:
f’(x) = 3x2 - 12x + 9 = 0
This implies that the critical points are at x = 1 and x =
4

3. 2

-2

-4

-6

-8
-0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
Fin500J Topic 4 Fall 2010 Olin Business School 15
Example of Using First and Second
Order Conditions (Cont.)
The next step is to determine whether the critical points are
maximums or minimums.
 These can be found by using the second order condition.
 f “(x) = 6x – 12 = 6(x-2)

Testing x = 1 implies:
 f ' '(1) = 6(1-2) = -6 < 0.
 Hence at x =1, we have a maximum.
Testing x = 3 implies:
 f ' '(3) = 6(3-2) = 6 > 0.
 Hence at x =3, we have a minimum.

Are these the ultimate maximum and minimum of the


function f(x)?

16
Local or Relative maxima and minima
When f” < 0 (negative) then local maximum
When f” > 0 (positive) then local minimum
Example-1:
f(x) = x3 –x
First derivative:
f’(x) =3x2 -1 and setting equal to zero
3x2 -1 =0 or, x2 =1/3 or, x= 1/√3
Second Derivative
f” =6x, check this is positive or negative,
f” =6/√3 is positive.
Therefore at x= 1/√3, the f(x) is minimum (local).
Example-2:
R = 1200Q -2Q2
dR/dQ = f’ = 1200 -4Q and setting equal to zero
Q = 300
d2R/dQ2 = -4
As f”(x) <0 then at Q = 300 the function is (relative or
local) maximum.
Conditions for a Minimum or a Maximum
Value of a Function of Several Variables
Correspondingly, for a function f(x) of several
independent variables x
Calculate f  x  and set it to zero. (Name is Nabla
but said as del). The del symbol can be interpreted as a
vector of partial derivative operators.
Solve the equation set to get a solution vector x*.
Calculate
Evaluate it at x*.
 f x
2
 
Inspect the Hessian matrix at point x*.

H x   2 f  x 
19
Hessian Matrix of f(x)

f  x  is a C 2 function of n variables,
  2 f  x  2 f  x 
  
 x1 2
x1xn 
H x    2 f  x       .
  2 f  x  2 f  x 
  
 xn x1 xn 
2

Since cross - partials are equal for a C 2 function, H(x)


is a symmetric matrix.

Fin500J Topic 4 Fall 2010 Olin Business School 20


Conditions for a Minimum or a Maximum Value of a
Function of Several Variables (cont.)
 Let f(x) be a C2 function in Rn. Suppose that x* is a critical
point of f(x), i.e., f  x *  0.

1. If the Hessian H  x * is a positive definite matrix, then x*


is a local minimum of f(x);
2. If the Hessian H  x * is a negative definite matrix, then
x* is a local maximum of f(x).
3. If the Hessian H  x * is an indefinite matrix, then x* is
neither a local maximum nor a local minimum of f(x).

Fin500J Topic 4 Fall 2010 Olin Business School 21


Positive and Negative Definite Matrix

Where Zxy = Zyx. If the first element on the principle


diagonal, the First Principle Minor |H1| = Zxx is positive
and second principle minor

|H2| = > 0, the second order condition for a


minimum is met.

When |H1| >0, |H2| >0 the Hessian |H| is called positive
definite. A positive definite Hessian fulfills the second
order conditions for minimum.
If the first principle minor |H1| = Zxx < 0 and the
second principle minor

The second order condition for maximum is met.


When |H1|<0, |H2| >0, the Hessian |H| is negative
definite. A negative definite Hessian fulfills the
second order conditions for a maximum.
Example
 Find the local maxs and mins of f(x,y)

f ( x, y )  x  y  9 xy
3 3

 Firstly, computing the first order partial derivatives (i.e., gradient of


f(x,y)) and setting them to zero

 f 
 
 x   3 x 2
 9y 
f ( x , y )    0
 f   3 y 2  9 x 
   
 y 
 critical points  x*, y * is (0,0) and ( 3, -3 ).

Fin500J Topic 4 Fall 2010 Olin Business School 24


Example (Cont.)
 We now compute the Hessian of f(x,y)

 2 f 2 f 
 2 
 x xy   6 x 9 
 f ( x, y )   2    9  6 y .
2

 f  f  
2

 yx y 2 
 
 The first order leading principal minor is 6x and the second order
principal minor is -36xy-81.
 At (0,0), these two minors are 0 and -81, respectively. Since the
second order leading principal minor is negative, (0,0) is a saddle
of f(x,y), i.e., neither a max nor a min.
 At (3, -3), these two minors are 18 and 243. So, the Hessian is
positive definite and (3,-3) is a local min of f(x,y).

Fin500J Topic 4 Fall 2010 Olin Business School 25


Partial Derivatives and Finding
Local Maximum/Minimum
 Suppose our function is f(x, y) = ax +bxy +cy
2 2

We can calculate its partial first derivative as and set


equal to zero
f’x(x, y) = 2ax + by =0
f’y (x, y)= bx + 2 cy = 0
Second Derivatives:
f”xx(x, y) = 2a
f”xy (x, y)= b
f”yx(x, y) = b
f”yy (x, y)= 2 c
Condition of Hessian Determinants

Constructing Hessian from our example:

If we find that 2a is positive and 4ac-b2 is positive then


the function is minimum at x* and y*.
If we find that 2a is negative and 4ac-b2 is positive then
the function is maximum at x* and y*.

You might also like