Numerical Differentiation
Salekul Islam North South University
22
Todays Agenda
Differentiation Second
Differentiation
interpolation
CSE 257
33
Introduction
We are familiar with differentiation when analytical formrelation between independent variable x and dependent variable yis given. How about if only tabular format values are given? Numerical differentiation means calculating the derivatives from a set of given value Replace a complicated, unknown function with an interpolating polynomial and then differentiate the polynomial
CSE 257 Numerical Method CSE 257 Numerical
44
CSE 257
55
Numerical Differentiation
Let be the values of a function corresponding to the values Let p(x) be the interpolating polynomial whose graph passes through these points If the points are equally spaced the function is represented by any one of the formulae such as Newtons or Stirlings or Bassels formula.
CSE 257
66
Let the interpolating points xi (i = 0, 1, . . . , n) be equally spaced with spacing h Let y = f(x) be represented by y = p(k) where x = x0 + k.h
We have,
CSE 257
77
When x = x0 , i.e. k = 0
For different values of n (i.e. number of points), approximate formulae for For n = 1,
CSE 257 Numerical Method CSE 257 Numerical
88
By taking, n = 2
CSE 257
99
At x = x0 , i.e. k = 0
CSE 257
1010
Example
From the following table, find f (1.4). Compare your result with f (1.4) = cosh(1.4) = 2.1509.
1111
Example contd.
CSE 257
1212
Another Example
First, we have to find out thethe table we The From differences. difference table is have, Substituting these values in the equation,
CSE 257
1313
More Example
Find the first and second order derivative of the function tabulated below at x = 3.
CSE 257
1414
Lagranges Interpolation Formula (See section 4.20 on page 123 for more details)
1515
CSE 257
Numerical Method
1616
CSE 257
Numerical Method
1717
CSE 257