Numerical Analysis and Methods
Numerical Analysis and Methods
(1)
then, f(x) is said to be analytic in the region near x=a, and the series is
unique and it’s called the Taylor series expansion of f(x) in the
neighborhood of x=a.
The following conclusions can be made:
a) all derivatives of f(x) at x=a must exist and be finite
b) If the series exists, then knowing f(a) and all derivatives of f at x=a,
we can find the value of f(x) at some x different from a, as long as
we remain ‘sufficiently close’ to x=a. ‘Sufficiently close’ means
working within the radius of convergence.
Some series converge for all |x-a| and are said to have an infinite radius
of convergence, while others converge only for |x-a| values below a
certain limit.
• A convergent series will be exact only if an infinite number of terms
are taken in the series.
• However, since it is much more useful and interesting to take a few
terms, the practice of error analysis become necessary.
• The approximations resulting from the Taylor series can be
represented graphically as follows:
• Suppose we wish to find f(b), i.e.
(2)
f(x)
f(x) Two Terms
One Term
f(b)
f(b)
f(a)
f(a)
a b x
a b x
f(b)
2
′ (𝑏 −𝑎 ) ′ ′
𝑓 ( 𝑏 ) = 𝑓 ( 𝑎 ) + ( 𝑏 − 𝑎 ) 𝑓 ( 𝑎 )+ 𝑓 (𝑎)
f(a) 2!
a b x
Error Representation
The error in the Taylor series for f(x) when the series is truncated after
the term containing is not greater than
(3)
where the subscript ‘max’ denotes the maximum magnitude of the
derivative on the interval from a to x. The magnitude of the error is
identified with the quantity , since this is the term over which one has
control.
Thus the error is said to be of the order of or designated as O if the
series is truncated as . If a series expression is truncated after the first
three term, we say that f(x) is accurate to O i.e.
(4)
i.e. (5)
or
and (6)
where first backward difference
Higher Order Derivatives
• In this case, we are interested in derivative of derivatives, and so we
need two line segments or three points, i.e.
1st 1st
2nd etc
So, we have expansions for and , we need expansion for .
Now, (7)
and (8)
Subtracting 2 x Eq. (7) from Eq. (8), and solving from , gives
or
Defining the second forward difference of f at j as:
gives
A similar expression can be obtained for the second backward
difference as:
where
In general any forward or backward difference may be obtained by
starting from the first forward and backward differences, and by using
the following recurrence formulas:
For example, the second backward difference of f at j may be found as:
and
Higher Order Forward and Backward Difference Expressions
• If you want to increase the accuracy of an infinite series, what do you
do, in terms of the number of terms? Ans: you increase the number of
terms.
• Consider the series
(1)
• Solving from gives:
(2)
Now, (3)
Substituting for in Eq. (2) gives:
Collecting terms,
i.e. (4)
Central Differences
From (5)
and (6)
Subtracting (6) from (5) gives:
And solving for ,
i.e.
or - central differences
By adding (5) and (6) and solving for gives:
Differences and Polynomials
Difference expressions for derivative (since they reduce to polynomials)
and polynomials in general have a distinct relationship which can be
useful. This arises from the fact that the error term of an nth difference
will involve only derivatives of order n+1 or higher in an nth order
polynomial will all be zero.
Suppose there is an unknown polynomial but known measured values
at ,
𝑓 𝑥 𝑗 𝑓 𝑥 𝑗+ 1 𝑓 𝑥 𝑗+ 2 𝑓 𝑥 𝑗+ 3 𝑓 𝑥 𝑗+ 4
- 𝑓 𝑥𝑗 - 𝑓 𝑥 𝑗+ 1
Now it turns out that the nth differences are constant or zero. What
does it tell you?
Ans: That the required function is a polynomial of order n, i.e. … whose
coefficients need to be determined. For example for the forward
difference expression for f’(x) of O() should be exact for a parabola
since the first error term involves f’’’(x). Thus we should be able to find
this difference expression by fitting the parabola
(x=h)
(x=2h)
Solving for B:
[ (4)]
Homework
Given the following equally spaced data
x 0 1 2 3 4
f(x) 30 33 28 12 -22
Find f’(0), f’(2), f’(4) and f’’(0) using difference representations which
are of O()