Numerical Analysis Fundamentals Guide
Numerical Analysis Fundamentals Guide
1 Definition
2 Significant digits
3 Accuracy and Precision
4 Rounding and Chopping
5 Absolute and Relative Errors
6 Review of Calculus
7 Taylor and Maclaurin Series
Definition
Definition
Numerical analysis and method is the area of mathematics and computer science
that creates, analyses, and implements algorithms for solving numerically the
problems of continuous mathematics.
Definition
Example
Analytically we can find the roots of
x2 − 1 = 0
as
x = ±1
It will be very difficult to find analytical (exact) solution to this problem, hence it
would require that we find the approximate solution to the polynomial function
using numerical methods.
Dr. Gabby Introduction To Numerical Analysis 6 / 40
Definition
Not all numerical procedures give satisfactory output for arbitrarily chosen input.
As a consequence, a stopping technique independent of the numerical technique
is incorporated into each algorithm to avoid infinite loops.
Numerical focus
People who employ numerical methods for solving problems have the following concerns:
Accuracy
Very few of our computations will yield the exact answer to a problem, so we will have to
understand how much error is made, and how to control (or even diminish) that error. That
is the difference between the approximate and exact solutions.
Efficiency
How fast and cheap (memory) can we compute a solution? Does the algorithm take
an excessive amount of computer time? This might seem to be an odd question to
concern ourselves with. The numerical analyst prefers algorithms that has faster rate
of convergence.
Completeness
Is the solution unique or do other solutions exist excluding your obtained approximate
solution.
Dr. Gabby Introduction To Numerical Analysis 8 / 40
Definition
Numerical focus
Stability
1 Does the method produce similar results for similar data?
2 We are interested in choosing methods that will produce dependably accurate
results for a wide range of problems.
3 One criterion we will impose on an algorithm whenever possible is that small
changes in the initial data produce correspondingly small changes in the final
results. An algorithm that satisfies this property is called stable;
4 otherwise the method is unstable, and unstable methods tend to produce
unreliable results.
5 Some algorithms are stable only for certain choices of initial data. These are
called conditionally stable.
Significant Digits
Definition
There are digits beginning with the leftmost non-zero digit and ending with the
rightmost correct digit, including final zeros that are exact.
1 All non-zero digits are considered significant. For example 91 has two
significant figures, likewise 123.45 has five significant figures.
2 Zeros appearing anywhere between two non-zero digits are significant.
Example 101.1203 has seven significant figures.
3 Leading zeros are not significant. Example 0.00053 has two significant
figures.
4 Trailing zeros in a number containing a decimal point are significant. Example
12.2300 has six significant figures.
5 Again 0.0001200 has four significant figures (the zeros before 1 are not
significant).
Dr. Gabby Introduction To Numerical Analysis 11 / 40
Accuracy and Precision
Definition
Accurate to n decimal places means that you can trust n digits to the right of the
decimal place.
Accurate to n significant digits means that you can trust a total of n digits as being
meaningful beginning with the leftmost nonzero digit.
Example
12.356 has three decimal places but five significant figures.
Definition
We say that a number x is chopped to n digits or figures when all digits that follow
the nt h digit are discarded and none of the remaining n digits are changed.
Conversely, x is rounded to n digits or figures when x is replaced by an n -digit
number that approximates x with minimum error.
Example
The results of rounding some three-decimal numbers to two digits are
0.217 ≈ 0.22, 0.365 ≈ 0.36, 0.475 ≈ 0.48, 0.592 ≈ 0.59, (1)
while chopping them gives
0.217 ≈ 0.21, 0.365 ≈ 0.36, 0.475 ≈ 0.47, 0.592 ≈ 0.59. (2)
Definition
The absolute error of β as an approximation to α is
|α − β| (4)
The relative error of β as an approximation to α is
|α − β|
(5)
|α|
Generally
absolute error = |exact value - approximate value| (6)
and
|exact value - approximate value|
relative error = (7)
|exact value|
For practical reasons, the relative error is usually more meaningful than the
absolute error.
Example
If x = 0.00347 is rounded to x̃ = 0.0035, what is its number of significant digits. Again
find the absolute error, and relative error. Interpret the results.
Solution
x̃ = 0.0035 has two significant digits.
Differentiable Functions
Definition
Assume that f (x) is defined on an open interval containing x 0 . Then f is said to
be differentiable at x 0 if
f (x) − f (x 0 )
lim (13)
x→x 0 x − x0
exists. When this limit exists, it is denoted by f ′ (x 0 ) called the derivative of f at x 0 .
Taylor Series
1 Most students will have encountered infinite series (particularly Taylor series)
in their study of calculus.
2 Consequently, this section is particularly important for numerical analysis, and
deserves careful study.
3 Once students are well grounded with a basic understanding of Taylor series
we can proceed to study the fundamentals of numerical methods with better
comprehension.
Definition
Taylor series is a representation of a function as an infinite sum of terms that are
calculated from the values of the function’s derivatives at a single point.
Example
Use five terms of the Taylor series to approximate ln(1.1).
Solution
Taking x = 0.1, then the first five terms of the series for l n(1 + x) gives us
0.01 0.001 0.0001 0.00001
ln(1.1) ≈ 0.1 − + − + = 0.095310333 . . .
2 3 4 5
Compute ln(1.1) directly on your calculator and compare your answer.
This value is correct to six decimal places of accuracy.
Taylor Series
f ′ , f ′′ , · · · f (n) are the derivatives of the function f . Again the values of these
successive derivatives should exist at the point c .
Maclaurin Series
In the special case where c = 0, then we obtain the Maclaurin series given by:
Example
What is the Taylor series of the function
f (x) = 3x 5 − 2x 4 + 15x 3 + 13x 2 − 12x − 5
at the point c = 2?
Solution
To compute the coefficients in the series, we need the numerical values of f (n) (2)
for n ≥ 0. Here are the details of the computation:
Therefore, we have
f ′′ (c) f ′′′ (c)
f (x) ≈ f (c) + f ′ (c)(x − c) + (x − c)2 + (x − c)3 + (26)
2! 3!
f (4) (c) f (5) (c) f (6) (c)
(x − c)4 + (x − c)5 + (x − c)6
4! 5! 6!
(27)
′′ ′′′
f (2) f (2)
≈ f (2) + f ′ (2)(x − 2) + (x − 2)2 + (x − 2)3 +
2! 3!
f (4) (2) f (5) (2) f (6) (2)
(x − 2)4 + (x − 2)5 + (x − 2)6
4! 5! 6!
(28)
2 3 4 5
≈ 207 + 396(x − 2) + 295(x − 2) + 119(x − 2) + 28(x − 2) + 3(x − 2)
Example
Find the Taylor series and the Maclaurin series of the following function using the
first four terms of the series.
f (x) = e 2x , where c = 1
Solution
i. For the Taylor series we obtain
Definition
If the function f possesses continuous derivatives of order 0, 1, 2, · · · , (n + 1) in a
closed interval I = [a, b], then for any c and x in I ,
n f (k) (x)
(x − c)k + E n+1
X
f (x) = (45)
k=0 k!
where the error term E n+1 can be given in the form
f n+1 (ϵ)
E n+1 = (x − c)n+1 (46)
(n + 1)!
for some ϵ between c and x and depends on both.
Example
Derive the formal Taylor series for f (x) = ln(1 + x) at c = 0
Definition
If the function f possesses continuous derivatives of order 0, 1, 2, · · · , (n + 1) in a
closed interval I = [a, b], then for any x in I ,
n f (k) (x)
h k + E n+1
X
f (x + h) = (55)
k=0 k!
Big O notation
1 The error term E n+1 depends on h in two ways:
1 First, h n+1 is explicitly present;
2 Second, the point ϵ generally depends on h.
2 So as h converges to zero, E n+1 converges to zero with essentially the same
rapidity with which h n+1 converges to zero. quite rapid.
3 To express this qualitative fact, we write
where C is a constant.
Dr. Gabby Introduction To Numerical Analysis 37 / 40
Taylor and Maclaurin Series
Exercise
Find the Taylor series and the Maclaurin series of the following function using the
first four terms of the series.
1