Professional Documents
Culture Documents
Gedney
The Derivative
Derivative f ( x) :
x
o The measure of the instantaneous rate of change of a function with
respect to a dependent variable.
o The derivative is equal to the slope of the curve at the point at which the
derivative is evaluated
o Fundamental law of calculus:
f ( x)
f xo x f xo
f x lim
x x xo
x 0 x
xo xo x x
Page 1 of 12
ELEC 4333/5333 University of Colorado Denver S. Gedney
Discrete Approximation of a Derivative
Consider the Taylor series expansion of f(x) about the point x x :
f (x ) 1 2 f (x ) 2 1 3 f (x ) 3 1
f ( x x ) f ( x ) x x x ...
x 1! x2 2! x3 3!
f ( x)
Move f ( x ) to the left and divide by x :
f ( x x ) f ( x ) f ( x ) 2 f ( x ) 1 2 f (x ) 1
3
x x ...
x x x2 2! x3 6
Solving:
f ( x ) f ( x x ) f ( x ) 2 f ( x ) 1 2 f (x ) 1
3
x x ... xo xo x x
x x x 2
2! x 63
Page 2 of 12
ELEC 4333/5333 University of Colorado Denver S. Gedney
We could also consider the Taylor series expansion of f(x) about x x :
f (x ) 1 2 f (x ) 2 1 3 f (x ) 3 1
f ( x x ) f ( x ) x x x ...
x 1! x 2
2! x 3
3!
f ( x)
xo x xo x
Approximation error:
x x
f ( x ) f ( x )
f (x )
2 2
O x 2 f x .
x x
Page 4 of 12
ELEC 4333/5333 University of Colorado Denver S. Gedney
f ( x)
x x
f (x ) f (x )
f (x ) 2 2 O x 2 .
x x
xo
x x x
xo xo
2 2
Due to cancelation of the odd-terms, the error converges as x 2
“Second-order” convergence
E.g., reduce x by 0.1, error reduces by 0.01 ( x 2 ).
Page 5 of 12
ELEC 4333/5333 University of Colorado Denver S. Gedney
Example
Page 7 of 12
ELEC 4333/5333 University of Colorado Denver S. Gedney
Another Example
Page 8 of 12
ELEC 4333/5333 University of Colorado Denver S. Gedney
Page 9 of 12
ELEC 4333/5333 University of Colorado Denver S. Gedney
Higher-Order Finite Difference Approximations
Again, subtracting the two expansions about the central point x (even derivatives
cancel!):
x x
f (x ) f (x )
2 f ( x ) x 2 1 f ( x ) x 4 1 f ( x ) ...
3 5
2
x x 24 x 3 1920 x 5
Page 10 of 12
ELEC 4333/5333 University of Colorado Denver S. Gedney
x x 3 x 3 x
f (x ) f (x ) f (x ) f (x )
9 2 2 2 2
x 3 x
f (x ) 2 9 f (x )
3
4 27 f ( x )
5
9 x x
x 24 x 3
1920 x 5
f (x ) 2 3 f (x )
3
4 243 f ( x )
5
x x ...
x 8 x 3
640 x 5
Simplifying:
3 x x x 3 x
f (x ) 27 f ( x ) 27 f ( x ) f (x )
2 8 f ( x ) x 4 117 f ( x ) ...
5
2 2 2
3 x x 320 x 5
Page 11 of 12
ELEC 4333/5333 University of Colorado Denver S. Gedney
Page 12 of 12