Tip:
Highlight text to annotate it
X
Hello and welcome to computational techniques web course. We are now in module 6; and module
6, we are going to discuss differentiation and integration - numerical differentiation
and integration specifically.
So, given a function y equal to f of x; sometimes we may not have function y equal to f of x,
but just data points x i or y i or methods to just generate this data points (xi, y i).
So, no matter how we do that. Let us assume that we have some kind of a curve y equal
to f of x, and we are interested in obtaining the differentiating and obtaining the value
d y by d x what it means geometrically is the differentiation is nothing but obtaining
slope of the tangents segment to the curve at the desired point.
So, this is the curve f of x and the slope of the tangent at f of x is just the numerical
derivative, but when if f of x is not available or if it is very difficult to differentiate
this f of x analytically, we can resort to numerical techniques. And numerical techniques,
this is the numerical approximation for the f of x. d y by d x definition is nothing but
limit as delta x tends to 0 delta y divided by delta x, which we can approximately write
as equal to y of i plus 1minus y i divided by x i plus 1 minus x i; this is delta x and
the numerator is delta y. So, as we bring x i plus 1 closer and closer
to x i, we will start approaching - the numerical derivative - will start approaching the analytical
or the actual derivative d y by d x. We cannot take x i plus 1 very close to x i, because
the round of errors will start dominating. This particular method is just the first order
method to find a numerical differentiation; we will use Taylor series expansion in order
to get higher order and more accurate methods for numerical differentiation.
So that is the overall general set up and if we compare from the slope of the tangent,
the actual tangent to this with the numerical approximation of the tangent. So, in this
particular figure, when we look at that as you can compare the two red lines, the slope
is different in those two cases.
So, what is happening is that, numerical approximation is not going to be an exact representation
of the differentiation, but it is going to be an approximate representation of the differentiation.
Let us now talk about integration; in integration, again we are given the function y equal to
f of x or some data x i, y i between the values a and b, and we are interested in finding
out the integral from a to b of f x d x. Integration is nothing but obtaining the area.
This is the same curve, integration is obtaining the area under that curve between points x
equal to a to point x equal to b. This shaded area that we see over here is the integral
from a to b f x d x. And geometrically what it means is, we will
draw the various grid points as shown over here and integration is nothing but the summation
of the total number of rectangles that we have over here. Clearly, if we take smaller
and smaller gaps in this particular gridding, that means, if we grid this in a much more
finer mesh, we will get more accurate value of the integral when we do this numerical
integration. And those concepts are something that we will we will try to understand when
we do numerical integrations sorry we will when we do numerical integration using various
methods for integration.
Now, the next question, of course that comes to mind is where is differentiation- numerical
differentiation - and numerical integration going to be used. And the application of numerical
differentiation is one application is in Newton Raphson's method, what if f of x is obtained
such that it is very difficult to find f dash of x? In in such cases, in Newton Raphson's
method, we will use numerical differentiation. If f dash is not available, we can then use
a numerical value of f dash, remember the numerical differentiation of f dash was x
i plus 1 minus x i. We will write x i plus 1 is nothing but x
i plus delta. So, this is going to be f of x i plus delta minus f of x i divided by x
i plus delta minus x i. So, the denominator for f dash is nothing but delta, because f
dash is itself is in the denominator that delta becomes a numerator in this Newton Raphson's
scheme.
So, the Newton Raphson's scheme, when the analytical derivative f dash of x is not available
becomes x i minus delta of f divided by f of x minus x plus delta minus f of x that
is the value that we will get for the Newton Raphson's method. Couple of examples of numerical
integration, is in order to calculate the mean; in the mean that we obtain was nothing
but summation of x divided by the number of data points. But if we want to calculate the
mean of an independent variable related to the dependent variable at the mean of the
dependent variable f of x related to the independent variable x, the mean is calculated using an
integral of this sort, 1 divide by b minus a integral from a to b f of x d x. So, this
is one place where integration will be required. Another example, where integration is required
is the mass flux calculation. So, let us say we have a tube through which
some kind of reactors of some kind of fluid is flowing. In that particular case, the mass
flux of any species in the fluid is going to be represented as the area integral with
respect to x and y coordinates of the overall flow flux, which is row multiplied by u multiplied
by w k, w k is nothing but the mass fraction of this species k in in this particular system.
Another example is to calculate the net heat loss through happening through this particular
surface. And the net heat loss through the surface is the surface integral of flux multiplied
by the surface the differential surface d s will integrated over entire surface s. So
that is going to be the flux that exists from any infinite area in this overall body. This
is how we will calculate the flux.
Another example of integration is the design equation of plug flow reactor. So, if you
have done your reaction engineering course already, you will recognize this design equation
for plug flow reactor and you will also be able to recognize this Levenspiel plots in
order to find out the volume of the p f r and volume of c s t r's that we are going
to use. And this particular case what we do is, we
plot 1 divided by r A as the y axis and conversion X on the x axis and this is the curve that
we get. The area under the curve is nothing but the volume of the c s t r that that is
going to be required v by f for that c s t r.
So, this is the curve we get for a first order reaction kinetics for example, and this is
the curve that we will get for biological reactors.
So, what are we going to cover in this module? The overview that we are going to cover in
this module - we will first cover numerical differentiation perhaps in about one and half
to two lectures, and then we will cover numerical integration, which will be covered perhaps
in the above three and half four lectures. In numerical differentiation, we will look
at forward, backward and central difference schemes, and then we will look at multi point
method, and then we will do the error analysis. As i had mentioned in the passing previously,
what we find is that we take x i plus 1 closer and closer to x i in numerical differentiation
scheme, we find the error reducing. But we cannot bring x i plus 1 too close to
x i, because then although the truncation error reduces, the round of error is going
to increase, that is what we will cover overall in the numerical differentiation. In numerical
integration, we will cover various methods to do numerical integrations, specifically
the trapezoidal rule, Simpson's one third and three eights rule, then we will talk about
Newton's extrapolation how we can use sorry Richardson's extrapolation how we can use
Richardson's extrapolation to improve Simpson's one third, three eight's rule or trapezoidal
rule, and finally, we will talk about Gauss quadrature method. The first two methods come
under the more general title of Newton cotes formulae, whereas Gauss quadrature method
is kind of an open method. We will talk of all these methods in the numerical
differentiation and integration that will cover in the current module.
Start off with numerical differentiation over here. We have, So, at any point x i, we want
to find d y by d x. Say y equal to sum function f of x at x equal to sum x i, we want to compute
d y by d x that is the question that we are trying to ask ourselves. d y by d x is nothing
but the slope of the curve f x versus x at value x i.
So, let us make the curve in this form; let us consider this as point i; let us consider
this as point i plus 1 and let this be point i minus 1. So, we are interested in finding
out the slope of this particular curve. The slope of this curve is the slope of the tangent
to this curve, at point i. So, I will just draw the tangent segment over here; so the
yellow represents the true derivative d y by d x. We are plotting x versus y; x as the
abscissa, y as the ordinate. So, at x equal to x i, we can write d y by
d x, at i as approximately equal to y i plus 1 minus y i divided by x i plus 1 minus x
i. This is the forward difference form and this can be represented as a line - the slope
of the line - joining the points x i y i with the point x i plus 1 y i plus 1.
So, the red line that I am showing over here is the forward difference approximation and alternatively, we can write d y by d x
at i as y of i minus y of i minus 1 divided by x i minus x i minus 1. Just the way we
have written it in this form, we can write it alternatively in this form. This becomes
our central difference formula and the central difference formula, in this particular case is going to be nothing but
the line joining x i minus 1, y i minus 1 to x i y i.
So, I will have this; join with a dotted line and this I will call as backward difference.
And the third possibility, again the third possibility that you would had considered
previously is what is known as the central differences. And in the central differences,
we will have d y by d x written approximately equal to y i plus 1 minus y i minus 1 divided
by x i plus 1 minus x i minus 1. What that is, is nothing but the slope of the curve
that joins the point x i minus 1 y i minus 1 with the point x i plus 1 y i plus 1. So,
its slope of this particular dotted line, I have not drawn it too well; so I will just
join it with another yellow dotted line over here and this is the central difference.
So, the yellows solid line is the true d y by d x, the true derivatives of the function
y equal to f of x with respect to x, at point i; the red solid line is the forward difference
approximation. We can clearly see over here that the forward difference approximation
of the d y by d x is, there is a fair amount of error associated with it; likewise, there
is a backward difference approximation shown by this particular dash line, there is a fair
amount of error even in the backward difference approximation for this particular system.
Slope of the dash line in the central difference approximation turns out to be much closer
to the slope d y by d x compared to either of those two red line segments that I have
shown. So that is the whole idea behind using some
of the forward and backward and central differences in order to get the numerical derivatives
of the approximations of the numerical derivatives in given a function either given a functional
form f of x or there has to be some mechanism to generate the values of y, given the values
of x using some kind of a function y equal to f of x.
So, let us analyze what are the various truncation errors associated with these numerical derivatives.
Truncation errors in numerical differentiation y of i plus 1 is nothing but f of x of i plus
1. So, f of x of i plus 1, we will write that approximately equal to we will take a Taylor
series expansion around x i. So that is approximately equal to f of x i plus x i minus x i minus
1, we will write that as delta x f dash of x i plus delta x squared by 2 factorial f
double dash of x i plus dot dot dot that is what our y i plus 1 is going going to be.
So, likewise, we can write y i minus 1 also. So, I will I will just write y i plus 1 again
in the short hand notation, y i plus 1 is equal to y i plus delta x multiplied by y
dash i plus delta x squared by two factorial multiplied by y double dash i plus delta x
cube by 3 factorial multiplied by, in this particular case we will write f triple dash
of zeta, where zeta is sum point lying between x i and x i plus 1; we get this using the
mean value theorem; we are able to obtain this.
Likewise, we will be able to write as y i minus 1 as y i minus delta x times y dash
i plus delta x squared by 2 factorial y double dash i minus delta x cubed by 3 factorial
f triple dash of zeta. Now, what we will do is subtract these two equations; if we subtract
these two equations, we will get y i plus 1 minus y i minus 1 is going to be equal to
y i and y i will get cancelled; we will get x delta x plus delta x multiplied by y dash.
So, it is going to be 2 times delta x multiplied by y i dash. These terms are again going to
get cancelled and this will be plus 2 times delta x cube by 3 factorial multiplied by
f triple dash of zeta.
We divide throughout by 2 delta x and we take this particular term on to the left hand side,
rearranging we will we will get the final result, that is, y i dash is going to be equal
to y i plus 1 minus y i minus 1 divided by 2 delta x, we have divided throughout; we
have taken this 2 delta x and divided throughout. So, this 2 and this 2 will get cancelled,
instead of delta x cubed, we will have delta x squared, and because we have taken this
term to the other side, it will get a negative sign.
So, we will have this as minus delta x squared by 3 factorial f triple dash of zeta; this
part is the central difference approximation
and this represents the truncation error. And in the central difference approximation,
the truncation error is proportional to delta x squared. So, that means, if you make the
delta x one tenth, the truncation error is going to reduce by one hundredth; if you double
the delta x, you are going to make the make the error - truncation error - in d y by d
x 4 times greater. So that is what this this particular thing
means. So, in conclusion y i dash, that is the first derivative of y i using the central
difference approximation is, y i plus 1 minus y i divided by root wise delta x and the truncation
error in the central difference is of the order of delta x squared.
Now, let us look at the forward difference approximation. In forward difference approximation,
let us go back to what we had written over here. What we will do is, we will take y i
on to the left hand side and divide throughout by delta x.
When we do that, what we will get is y i plus 1 minus y i divided by delta x is going to
be equal to y i dash plus delta x by 2 factorial f double dash of i plus bunch of other terms.
This is the leading term over here. based on another mean Again applying mean value
theorem, this term will become delta x divided by 2 factorial f double dash of sum value
sum other values zeta; we will just call it zeta bar, because this zeta is different may
be different from this particular zeta. So, in this particular case, this becomes
our forward difference approximation and this represents the truncation error; and truncation error in forward difference
approximation is proportional to delta x to the power 1 or its proportional to delta x.
And going back to the geometrical interpretation that we had of Newton's forward difference
and backward difference and central difference formulae, this is what we had seen with forward,
backward and central difference. Forward backward and central difference and what we had stated
at that time is from this particular cartoon, it looks as if central difference approximation
does a better job of approximating the actual derivative numerically compared to the forward
difference and the backward difference. The derivation that we have obtained using
the Taylor series approximation over here verifies that particular geometric intuition
or the geometric claim that we had made in the in the previous part of this lecture that,
truncation error reduces as delta x squared for central difference, where as it reduces
as delta x to the power 1 for the forward difference approximation. So, at this stage
we will end the module 1 sorry lecture 1 of module 6. What we have covered so far is forward
and central difference approximation for the first derivative of any function f of x. What
we will cover in the next lecture is to look at the higher derivatives, that is, f double
dash, f triple dash of x so on and so forth, as well as higher order accurate formulae.
We will use another different method called method of undetermined coefficients in order
to determine the higher order formulae also and finally, we will finish off with talking
about truncation versus round of errors. So, what we have seen so far is how to get
the first derivative of that is d y by d x given some kind of function f of x either
a function f of x are discrete value of f of f x at certain given points of of x. We
have looked at how we will get the first differential with that. Now, let us look at how to get
the second derivative from this.
So, what we want to get actually is d squared y by d x squared at x equal to x i. So, this
what we are interested in getting, where y equal to f of x, so that is the overall function
that we have. As we have done before, what I will do is, I will write down the same expressions
all over again is f of x i plus 1 is f of x i plus delta x times f dash of x i plus
delta x squared times f double dash of x i plus delta x cube time f triple dash of zeta
and I forgot, divided by 2 factorial and divided by 3 factorial over here.
So, this is the overall expression that we get on expanding f of x i plus 1. Likewise,
we will expand f of x i minus 1 and that is going to be f of x i minus delta x times f
dash of x i plus delta x squared by 3 factorial 2 factorial f double dash of x i plus sorry
minus delta x cube by 3 factorial f triple dash of x i plus dot dot dot, in fact i will
change this to f triple dash of x i plus dot dot dot. Now, i will add these two equations.
So, when I add these two equations, we will get f of x i plus 1 plus f of x i minus 1
is going to be equal to twice f of x i this term and this term will get cancelled; this
term will be retained. So, its 2 times delta x square multiplied by f double dash divided
by 2. So, we will have plus delta x squared f double
dash of x i this term and this term will get cancelled, the leading term that will remain
is going to be 2 times delta x to the power 4 divided by 4 factorial f 4 dashes of x i
plus dot dot dot. So, this is the leading error term that we
have. And for this part of the equation, we will apply the overall mean value theorem
and we will convert from x i to zeta, where zeta is going to be any point that lies between
x i minus 1 and x i plus 1. So, we will what we will do is, we will take this 2 twice f
of x i on to so all the terms, rather except delta square f double dash, all other terms
will take on to the left hand side and divide throughout by delta x squared.
So, when we do that, we will have f of x i plus 1 plus f of x i minus 1 minus 2 times
f of x i minus, so 4 factorial is going to be 4 multiplied by 3 multiplied by 2 multiplied
by 1 that guy divided by 2 is going to be 4 multiplied by 3, which is essentially 12.
So, minus delta x to the power 4 by 12 f 1 2 3 4 of zeta is going to be equal to delta
x square f double dash of x i. And we divide delta x square throughout and we will get
our final result is f double dash of x i is going to be equal to f of x i plus 1 minus
twice f of x i plus f of x i minus 1 divided by delta x squared.
So, if you look at this particular expression its f of x i plus 1 plus f of x i minus 1
minus twice f of x i divided by delta x squared, and this is the residual term, which would
be delta x squared by 12 multiplied by f 4 dash of zeta. So, minus delta x squared by
twelve f 1 2 3 4 of zeta; so this is the central difference formula and this is the error in the numerical derivative. So, what we have seen so far is that for the
central difference formula either whether we are going to use the central difference
formula for finding f double dash or we are going to use the central difference formula
for finding f dash, we observe that the error is proportional to delta x squared. So, as
we reduce our delta x to smaller and smaller values, the error- the truncation error- in
fact reduces as the delta x reduces. And in the forward difference method or the
backward difference method for getting f dash that reduction is directly proportional to
delta x, whereas in the central difference method its proportional to delta x squared.
As a result of this, the central difference methods are going to be more accurate than
the forward or the backward difference methods. So, in order to summarize the other f dash
x values that we have gotten f dash of x i was equal to f of x i minus f of x i minus
1 divided by delta x plus error was of the order of delta. x f dash of x i that we wrote
as the central difference formula was f of x i plus 1 minus f of x i minus 1 divided
by twice delta x plus order of delta x squared and like this, we had also we could also write
the forward difference method, where f dash of x i was equal to f of x i plus 1 minus
f of x i divided by delta x. So, these are the derivations based on the
Taylor series expansion. What I will do next is, do one more derivation again of the same
formula. The purpose of doing this derivation is to introduce a new method called method
of undetermined coefficients. We will use this method, because this method is more general
and you can apply to get higher order formulae more accurate formulae so on and so forth
ok.
So, this method is called method of undetermined coefficients. So, we will go back to what
we had written as our Taylor series expansions. We had written our Taylor series expansions
for f x i plus 1; we had written our Taylor series expansion of our f x i minus 1, and
then we could pick and choose which data points do we want to use in order to get the first
differential or the second differential or higher order differentials of f.
So, I will demonstrate that method, again we will try to find f dash of x. So, I will
write our f dash of x as sum a 1 multiplied by f of x i minus 1 plus a 2 multiplied by
f of x i plus a 3 multiplied by f of x i plus 1.
So, our undetermined coefficients are a 1, a 2 and a 3. What we are trying to do is,
we are trying to get a three point difference formula
for differs derivative f dash of x at x equal to x i. So, we are trying to get a three point
difference formula, why three point difference formula, because we are going to use point
x i minus 1 x i and x i plus 1 in order to get to derive that particular formula.
So, what is the three point difference formula for f dash of x i? Three point different formulas
for f dash of x i is nothing but the central difference. So, what we expect is really our
a 1 over here; if we compare it to this particular equation what we expect our a 1 to be is minus
1 by 2 delta x. We expect our a 2 to be equal to 0 and we
expect our a 3 over here to be equal to 1 plus 1 divided by 2 delta x. So, we have three
undetermined coefficients; so we require three equations - three linearly independent equations
- in order to obtain unique values of a 1 a 2 and a 3.
So, we will substitute the Taylor series expansion over here and Taylor series expansion over
here and the Taylor series expansion over here. So, we can write down f dash of x i
is going to be equal to a 1 times f of x i minus 1, which is f of x i plus delta x i
am sorry not plus, it should be minus delta times f dash of x i plus delta x square by 2 factorial f double dash of x i plus delta
x cube by 3 or sorry again minus delta x cube by 3 factorial f triple dash of x i plus dot
dot dot plus a 2 times f of x i plus a 3 times f of x i plus delta x f dash, I will just
use short hand f dash of i plus delta x squared by 2 factorial f double dash of i plus delta
x cube by 3 factorial f triple dash of i. Now, we will collect the terms in f dash,
f double dash, f triple dash and so on so forth. So, what we will get is f of x i multiplied
by a 1 plus a 2 plus a 3. So, f i multiplied by a 1 plus a 2 plus a 3 plus f dash of x
i multiplied by a 1 multiplied by minus delta x, a 2 multiplied by 0, because there is no
f dash term over here and a 3 multiplied by plus delta x plus f double dash of i and the
terms in f double dash of i are going to be a 1 multiplied by delta x square by 2.
So, a 1 delta x squared by 2 plus a 2 multiplied by 0 plus a 3 multiplied by delta x square
by 2 and then, we will have other terms, which is f triple dash of i, and there we will have
minus a 1 delta x cube by 6 plus a 3 delta x cube by 6 and so on and so forth plus dot
dot dot. So, now, what we have? we have On the right
hand, right hand side we have and f dash of i term; on the left hand side, we have terms
in f dash f i f dash of i, f double dash of i so on and so forth. So, what we will do
is, we will identify each individual term with different colors f dash of i and we have
this as f dash of i. So, what this means is that the coefficient
of f dash of i is nothing but 1 multiplied by f dash of i and that coefficient should
be equal to this particular guy over here. So, we will equate that; we will equate the
red box term in this particular- on the right hand side with the red number over here. All
the other terms appearing should be equal to 0, keep in mind that because we do not
know a 1 a 2 and a 3, we require three equations.
So, the first equation is going to be a 1 plus a 2 plus a 3 equal to 0; the second equation
is going to be minus a 1 delta x plus a 3 delta x equal to 1 minus a 1 plus a 3 multiplied
by delta x is going to be equal to 1, and the third equation is going to be a 1 delta
x squared by 2 plus a 3 delta x squared by 2 equal to 0.
So, a 1 plus a 3 multiplied by delta x squared by 2 equal to 0 that is going to be our third
equation. So, based on this we will be we will write a 3 equal to minus a 1; based on
this equation substitute it over here; so, we will have 2 a 3 equal to 2 a 3 delta x
is going to be equal to 1 or a 3 is going to be equal to 1 by 2 delta x. Based on this
equation, we will have a 1 is going to be equal to minus 1 by 2 delta x and a 2. Based
on this particular equation, is going to be minus of a 1 plus a 3, which will be 0, because
a 1 is minus 1 by 2 delta x and a 3 is equal to 1 by 2 delta x. So, the value of a 1 is
this; value of a 2 is 0 value of a 3 is 1 by 2 delta x.
So that is the overall equation that we get using the method of undetermined coefficient.
So, we substitute a 1 over here, a 2 over here, a 3 over here and this is the result
that we will get; essentially it is going to be the central difference formula.
Now, the question is what about the error term? And the error term to figure out what
we have to do is substitute the value of a 1 a 2 and a 3 in this particular term. The
terms that we have neglected, keep in mind that this has become zero; this term has become
0 this term has become 1, all the above all these terms are actually non zero, but we
are neglecting it. So, error is going to be equal to minus a
1 by 6 plus a 3 by 6 multiplied by delta x cubed multiplied by f triple dash of x i plus
we have other terms as well. Now, if we substitute a 1 and a 3 in this particular equation, and
this term turns out to be 0; then we will have to look at the next term; if this term
does not turn out to be 0, this becomes the leading error term and we stop our error analysis
at this point. So, let us substitute a 1 equal to minus 1 by 2 delta x and a 3 is equal to
1 by 2 delta x. So, error is going to be equal to minus a
sorry it is going to be equal to minus 1 by 2 delta x multiplied by minus 1 by 6. So,
it is going to be 1 by 12 delta x plus 1 by 12 delta x multiplied by delta x cube f triple
dash plus dot dot dot. And this becomes equal to 1 by 6 multiplied by delta x squared; this
is delta x and 1 of the delta x is over here will get cancelled multiplied by f f triple
dash. As a result of this, the error that we write over here is going to be equal to
1 by 6 delta x cube f triple dash of x i. So, this is the error in central difference
of f central difference f dash of x i. So, this is the overall derivation using the method
of undetermined coefficients. Now, sometimes what we need is, we need either a higher order
method using forward difference formula or higher order method using backward difference
formula so on and so forth. So, what I am going to do is, I am going to show you one
more result using what is known as three point difference formulae.
So, we are going to use the method of undetermined coefficients to get three point forward difference
formulae for f dash of x i. We will write f dash of x i equal to a 1 f of x i plus a
2 f of x i plus 1 plus a 3 f of x i plus 2. Why is it called the three point forward difference
formula, is because in order to get the derivative at this point x i, we are going to use the
values at x i plus 1 and x i plus 2. So, we are using for getting the derivative
at this point; we are using this point, this point and this point. So, we are using three
points ahead or forward of x i that is why it is called a three point forward difference
formula for f dash of x i. So, we substitute f of x i plus 1 and f of
x i plus 2 in this particular equation. So, we will have a 1 f i plus a 2 multiplied by
f i plus delta x f dash of i plus delta x squared f double dash of i by 2 factorial
plus delta x cube divided by 3 factorial f triple dash of x i plus dot dot dot plus a
3 multiplied by f i plus. Now, we in this particular case x the difference between x
i plus 1 and sorry the difference between x i and x i plus 2 is 2 times delta x.
So, it will be 2 times delta x multiplied by f dash of i plus 2 delta x whole squared
divided by 2 factorial f double dash of i plus 2 times delta x the whole cube by 3 factorial
f triple dash of i plus dot dot dot. Now, we collect the terms in f i, f dash i, f double
dash i so on and so forth together. So, we will write f dash of x i is going to be equal
to f of x i multiplied by a 1 plus a 2 plus a 3 plus f dash of x i; f dash of x i multiplied
by a 2 times delta x plus 2 a 3 times delta x
plus f double dash of x i; f double dash of x i multiplied by a 2 delta x squared by 2
factorial, I will take delta x squared by 2 factorial outside the bracket.
So, we will have a 2 multiplied by delta x square f double dash by 2 factorial; so that
multiplied by a 2 plus a 3 multiplied by 4 delta x squared by 2 factorial multiplied
by f double dash. So, 4 a multiplied by delta x square by 2 factorial plus 4 a 3 is what
we get for f double dash plus terms in f triple dash. So, our three equations are going to
be a 1 plus a 2 plus a 3 equal to 0; a 2 delta x plus a 2 2 a 3 delta x equal to 1; and a
2 plus 4 a 3 equal to 0. So, I will write down the three equation over
here; a 1 plus a 2 plus a 3 equal to 0; a 2 plus 2 a 3 times delta x equal to 1; and
a 2 plus 4 a 3 times delta x squared plus 2 factorial equal to 0; this particular term
gets cancelled, a 2 equal to minus 4 a 3 substitute this over here, we will get minus 4 a 3 plus
2 a 3 equal to 1 by delta x. So, a 3 is going to be equal to minus 1 by 2 delta x; a 2 is
going to be equal to 4 by 2 delta x; and a 1 is negative of a 2 plus a 3, which is going
to be equal to negative of 1 by 2 delta x, a 4 minus 1, which is equal to minus 3 by
2 delta x. So, we substitute these values in this particular
expression and the result that we will get for a three point forward difference formula
is f dash of x i is going to be approximately equal to minus 3 by 2 delta x f of x i minus
3 by 2 delta x f of x i plus 2 divided by delta x f of x i plus 1 minus 1 by 2 delta
x f of x i plus 2.
And this is our three point forward difference formula and if we substitute the value of
a a 1 a 2 and a 3 in the f triple dash term, we will realize that the error of the leading
term is of the order of delta x squared. So, a three point forward difference formula has
an error which without derivation I am just stating, error is proportional to delta x
square. So, we now have a forward difference formula,
which is more accurate than our traditional two point forward difference formula for f
dash x i.
This we have obtained using the method of undetermined coefficients. To summarize what
we have done in this particular lecture until now is, we started off with an introduction
to numerical differentiation and integration. We motivated the numerical differentiation
and integration part saying, where exactly numerical differentiation and integration
will be useful and then, we started covering some of the methods for doing getting the
numerical differentiation using the forward difference method, backward difference method,
central difference method for getting f dash of x; then we talked about the method of undetermined
coefficients, where we write our f dash of x as a linear function of f computed at various
different points. And then, we used a method in order to compute
this particular or these particular coefficients and finally, we talked about higher order
formulae, for example, three point forward difference formula in order to get f dash
of x i. So, that is essentially what we have covered
in this particular lecture. In the lecture, I will briefly recap all these formulae and
then, I will go on to taking a couple of numerical examples to show what we have derived in these
particular equations. Thank you.