You are on page 1of 47

Differential calculus

Background mathematics review David Miller


Differential calculus

First derivative

Background mathematics review David Miller


First derivative

For some function y  x 


The (first) derivative is the y
“slope”
gradient or
x
rate of change
of y as we change x the first derivative is written
If for some small “infinitesimal” dy
y  x  
change in x, called dx dx
y changes by some small The “ratio” notation on the
“infinitesimal” amount dy right is “Leibniz notation”
First derivative
dy dy
The derivative at some specific dx x1
dx x3

point x1 can be written y y


dy
y  x1  
 x
dx x1
x1 x3 x
The value of the derivative is
the slope of the “tangent” line
the dashed line in the figure
at that point
y
Equal in value to the tangent
x
First derivative
y
Looking at the slope  x 
y  x1  
 x   x   2 
y  x1    y  1
x  
 2   2 
x  x  x
y  x1  
of the “orange” line  2 
as we reduce x x
the “orange” line slope x1
becomes closer to the slope
of the “black” tangent line
First derivative

In the limit as x becomes very small


i.e., in the limit as x “tends to zero”
lim
x 0

this ratio becomes the (first) derivative


 x   x 
y  x1    y  x1  
dy
 lim  2   2 
dx x1
x 0 x
Sign of first derivative

If y increases as we increase x
dy
dy y dy  0
 0  0 dx
dx dx
sloping up to the right

If y decreases as we increase x
x1 x3 x
dy
 0
dx
sloping down to the right
Derivative of a power
d n
x  nx n1
dx dy
yx 2
 2x
1 2 dx

0.5
1  0.5 0 0.5 1

2
1  0.5 0 0.5 1
Derivative of a power

The derivative of a straight line is a constant


The straight line has a constant slope
1 yx 1
dy
1
dx

0.5
1  0.5 0 0.5 1

1
1  0.5 0 0.5 1
Derivative of a power

The derivative does not depend on the “height”


All these lines have the same slope
1 1
dy
yx 1
dx

0.5
1  0.5 0 0.5 1

1
1  0.5 0 0.5 1
Derivative of a power

The derivative does not depend on the “height”


All these lines have the same slope
1 1
dy
y  x  0.25 1
dx

0.5
 1  0.5 0 0.5 1

1
1  0.5 0 0.5 1
Derivative of a power

The derivative does not depend on the “height”


All these lines have the same slope
1 1
dy
y  x  0.5 1
dx

0.5
 1  0.5 0 0.5 1

1
1  0.5 0 0.5 1
Derivative of a power

The derivative of a constant is zero


y is not changing with x
1 1
y  0.5

0.5
 1  0.5 0 0.5 1
dy
0
dx
1
 1  0.5 0 0.5 1
Derivative of an exponential
d
exp  x   exp  x 
dx
3 3

2 2
dy
y  exp  x   exp  x 
1 1 dx

1  0.5 0 0.5 1  1  0.5 0 0.5 1


Derivative of a logarithm
d 1
ln  x  
dx x
2 10
y  ln  x 
1
dy 1

0 1 2 3 5 dx x
1
2
3
0 1 2 3
Derivatives of sine and cosine
d
sin  x   cos  x 
dx
1 1
dy
y  sin  x   cos  x 
dx
 
 

1 1
Derivatives of sine and cosine
d
cos  x    sin  x 
dx
1 1
dy
y  cos  x    sin  x 
dx
 
 

1 1
Differential calculus

Second derivative

Background mathematics review David Miller


Second derivative
1
The second derivative is
The derivative of the derivative
d 2 y d  dy 
y  x   2    0.5
dx dx  dx 
The rate of change of the x
derivative or “slope”
1  0.5 0 0.5 1
Second derivative
1
The slope at x / 2 is, for small x
dy y  0   y  x 

dx x /2 x 0.5
And similarly at x / 2
dy y  x   y  0  x

dx x /2 x
1  0.5 0 0.5 1
So
dy dy

d y d  dy 
2
dx x /2 dx x /2
    lim
dx 2 dx  dx  x0 x
Second derivative
1
The slope at x / 2 is, for small x
dy y  0   y  x 

dx x /2 x 0.5
And similarly at x / 2
dy y  x   y  0  x

dx x /2 x
1  0.5 0 0.5 1
So
d 2 y d  dy  1  y  x   y  0   y  0   y  x  
    lim   
dx 2
dx  dx  x  0 x   x  x 
Second derivative
1
The slope at x / 2 is, for small x
dy y  0   y  x 

dx x /2 x 0.5
And similarly at x / 2
dy y  x   y  0  x

dx x /2 x
1  0.5 0 0.5 1
So
d 2 y d  dy  y  x   2 y  0   y  x 
    lim
dx  dx  x0  x 
2 2
dx
Sign of second derivative

Going from a positive first


d2y
derivative 2
0
dx dy
To a negative first derivative dy  20
 0 dx d y
Gives a negative second dx 2
0
derivative y dx
Going from a negative first
derivative x1 x2 x3 x4 x
To a positive first derivative
Gives a positive second
derivative
Sign of second derivative

Any region where the first


d2y
derivative is decreasing with 2
 0
dx
increasing x
d2y
Has a negative second 2
 0
dx
derivative y
Any region where the first
derivative is increasing with xxx x x x x
increasing x
Has a positive second
derivative
Sign of second derivative

Points where the derivative is


neither increasing or d2y
 0
d2y
 0
decreasing dx 2
dx 2

i.e., second derivative is


changing sign y
correspond to zero second
derivative x x x
Known as
inflection points
Curvature

The second derivative can be


thought of as the
“curvature”
of a function

Large positive curvature


Curvature

The second derivative can be


thought of as the
“curvature”
of a function

Small positive curvature


Curvature

The second derivative can be


thought of as the
“curvature”
of a function

Large negative curvature


Curvature

The second derivative can be


thought of as the
“curvature”
of a function

Small negative curvature


Curvature

The value of the curvature does


not depend on the “height” of
the function
All these curves have the same
curvature
Differential calculus

Linearity and differentiation rules

Background mathematics review David Miller


Linearity – linear superposition

For two functions Example


u  x  and v  x  f  x   x  ln x
Split into
The derivative of the
u  x   x v  x   ln x
sum is the sum of the
So
derivatives du dv 1
d du dv 1 
u  x   v  x     dx dx x
dx dx dx So
d u  v  1
f  x 
  1
dx x
Linearity – multiplying by a constant

For a function u  x  Example


The derivative of f  x   a x  a x1/2
a constant a times a Split into
function a u  x   x1/2
is So
a times the derivative du 1 1/2 1
 x 
d du dx 2 2 x
 au   a So
dx dx
du a
f  x  a
 
dx 2 x
Linearity

An operation or function f  x  is linear if


f  y  z  f  y  f  z
“linear superposition” or “additivity”
condition
and
f  ax   a f  x 
“multiplication by a constant” (or formally
“homogeneity of degree one”) condition
Example of nonlinear operation

The function
f  x   x2
does not represent a linear operation
f  y  z    y  z   y 2  z 2  2 yz
2

But
f  y   f  z   y2  z2
So for this function
f  x  y
is not in general equal to
f  x  f  y
Product rule

For two functions Example


u  x  and v  x  f  x   x 2 sin x
Split into
The derivative of the
u  x   x 2 v  x   sin x
product is
So
d dv du du dv
 uv   u  v dx
 2x
dx
 cos x
dx dx dx
So
d  uv 
f  x   x 2 cos x  2 x sin x
dx
Quotient rule

For two functions Example x3


f  x 
u  x  and v  x  1  x2
Split into
The derivative of the
u  x   x3 v  x   1  x 2
ratio or quotient is
So
du dv du dv
v u  3x 2
 2x
d u dx dx dx dx
  
dx  v  v2 So
d u       2x
2 2 3
1 x 3 x x
 
dx  v  1  x 2 2
Quotient rule

For two functions Example x3


f  x 
u  x  and v  x  1  x2
Split into
The derivative of the
u  x   x3 v  x   1  x 2
ratio or quotient is
So
du dv du dv
v u  3x 2
 2x
d u dx dx dx dx
  
dx  v  v2 So
d u 3 x 2
1  x 2
  x 3
 2x
 
dx  v  1  x 2 2
Quotient rule

For two functions Example x3


f  x 
u  x  and v  x  1  x2
Split into
The derivative of the
u  x   x3 v  x   1  x 2
ratio or quotient is
So
du dv du dv
v u  3x 2
 2x
d u dx dx dx dx
  
dx  v  v2 So
d u 3 x 2
1  x 2
  2 x 4

 
dx  v  1  x 
2 2
Quotient rule

For two functions Example x3


f  x 
u  x  and v  x  1  x2
Split into
The derivative of the
u  x   x3 v  x   1  x 2
ratio or quotient is
So
du dv du dv
v u  3x 2
 2x
d u dx dx dx dx
  
dx  v  v2 So
d  u  3x 2 2 x4
   1  x2 
dx  v  1  x 
2 2
Chain rule

For two functions Example


f  y  and g  x  h  x   1  x 
2 2

Split into
The derivative of the g  x   1  x2 f  y   y2
“function of a function”
Can be split into a
product
 df   dg 
f  g  x       
d
dx  dg   dx 
Chain rule

For two functions Example


f  y  and g  x  h  x   1  x 
2 2

Split into
The derivative of the g  x   1  x2 f g  g2
“function of a function”
So
Can be split into a dg df  g 
 2x  2g
product dx dg
 df   dg  So
f  g  x       
d
 2 1  x 2   2 x  4 x 1  x 2 
dh
dx  dg   dx 
dx
Chain rule

For two functions Example


h  x   exp  a x 
f  y  and g  x 
Split into
The derivative of the g  x  a x f  g   exp  g 
“function of a function”
So
Can be split into a dg df  g 
a  exp  g 
product dx dg
 df   dg  So
f  g  x       
d
dh
dx  dg   dx   exp  ax   a  a exp  ax 
dx
Chain rule

For two functions Example


h  x   exp  a x 2 
f  y  and g  x 
Split into
The derivative of the g  x   a x 2 f  g   exp  g 
“function of a function”
So
Can be split into a dg df  g 
 2ax  exp  g 
product dx dg
 df   dg  So
f  g  x       
d
 exp  ax 2   2ax  2ax exp  ax 2 
dh
dx  dg   dx 
dx

You might also like