MH411 - 03a BODY
MH411 - 03a BODY
College Department
Department of Engineering
Activity no. 1
Preliminaries
Objectives:
Abstract:
numbers but the deepest properties and theorems in Calculus because the
1
There is always a tendency for students to forget acquired knowledge as they
today's learners. It is indeed an added task both to the students and the
Instruments/Materials Needed:
significant digits
• -- stored knowledge
Activity:
Definition of terms
Give a summary to the following topics. You may use the library, books,
lecture notes and stored knowledge in compiling the topics. You may use
REMEMBER that the aim of this activity is for you to recall the
2
of Mathematics that will be useful as you study numerical methods. So
NEVER just walk through the doors of the library and merely copy what is
written in the books, but see to it that the materials that you will be gathering
1. Intermediate-Value Theorem
3
2. Mean Value Theorem
3. Rolle's Theorem
4
4. Extreme Value Theorem
5. Taylor's Formula
5
6. Alternating Series Theorem
6
8. Significant Digits
Exercises
7
3. Find a Maclaurin-series expansion for f(x) = e –4x
8
Imus Institute
College Department
Department of Engineering
Activity no. 2
Measuring Errors
Objectives:
Abstract:
Deviation from the true and exact value is encountered even in the early
stages of learning. We often notice relevant and highly significant errors and
with magnitude between one and zero. Caring less keeps some students
wondering why there are differences in final answers, arguing that each
9
The source of error must be identified. Numerical computations must not be
minimized.
True error is defined as the difference between the true or exact value and
The relative true error is the ratio of the true error and the true value:
The absolute relative true error is simply the absolute value, or the
10
Approximate error is the difference between the present approximation and
The relative approximate error is the ratio between the approximate error
True error is useful in checking various computations where true values are
exact value. Quantifying this error goes beyond the procedure of mere
Numerical methods come into play as we seek solutions where some parts of
11
the problems are fragments of simpler problems but the whole picture is
Instruments/Materials Needed:
Procedure:
Using the definition of the derivative, we are to find approximate values for
• Prepare initially two columns, the first one for h and the other for
= [cell index of the first row, first column, e.g., C3] – 0.00005
• Copy the formula for the next 18 rows, starting from the third row.
Q1. Did you expect the output? Briefly explain how this fairly
___________________________________________________
___________________________________________________
12
___________________________________________________
___________________________________________________
• On the cells of the second column, set the decimal digits to nine and
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
13
• Add a 21st row and write under the first column “h → 0”. See Table
2.1.
• Compute the value of f'(π/18) using Calculus and write the value on
14
• Prepare a third column that computes the differences between each
value of f'(3) for various h from the true value. Use nine decimal
Q4. Briefly explain how you encode the simple formula for the
third column.
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
• For the fourth column, compute for the relative true error by dividing
each entry on the third column by the true value, writing each
Q5. What can you say on the entries of the third and fourth
may explain briefly using what you have learned from differential
calculus.
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
15
Computing Approximate Error
successive entries of the second column, f'(3). Leave the first row
blank. On the second row, compute the difference between the second
row and first row entries of the second column, that is,
• Prepare a sixth column that computes the ratio between the entries of
the fifth column and the entries of the second column. The first row is
between each entry of the fifth column and the corresponding entry of
Q6. What can you say on the entries of the fifth and sixth columns
___________________________________________________
___________________________________________________
___________________________________________________
16
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
Data Analyses:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
17
Conclusion:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
18
Imus Institute
College Department
Department of Engineering
Activity no. 3
Objectives:
Abstract:
It is simply impossible for us to write the exact numerical values of, say,
irrational numbers because of the basic fact that they do not terminate. Even
procedures, but from the fact that no one can simply give the numerical
19
Round-off errors occur even with the use of high-speed computing devices
because they have limits in their ability to represent numbers and that there
are certain computations that are highly sensitive to such types of cropping
significant digits,
π = 3.1415927
The round-off error is simply the difference between the exact and the
round-off values,
20
Thus the truncation error is
x8/8! – x10/10! + …
Instruments/Materials Needed:
Procedure:
Round-off Error
We are to compute round-off errors for the decimal equivalent of 3/14 for
• Prepare three columns, each with ten entry cells. The first column
21
• For the second column, give the round-off value of 3/14 according to
the round-off function of the spreadsheet. Set the decimal digits to 12.
subtracting each entry of the second column from the exact value,
Q1. Compare the entries of the third column. Are the results
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
Q2. Think about this: does the number of decimal digits indicate
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
22
Truncation Error
Q3. Use the space below to show the Taylor series expansion of
f(x) = ln x at x = 1.
• Prepare three columns, each with fifteen entry cells. The first column
• For the second column, give the truncated value of ln (1.2) according
23
Q4. Describe how you create the formula(s) for the second
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
• Obtain the entries of the third column by subtracting each entry of the
Q5. Compare the entries of the third column. What does excessive
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
• Create a new table and try for some constants a and b for f(x) = ln x at
24
Q6. Suppose we would like to find f'(3) for f(x) = ex cos x3. If we
25
Data Analyses:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
Conclusion:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
26
Imus Institute
College Department
Department of Engineering
Activity no. 4
Fixed-Point Iteration
Objectives:
point iteration
Abstract:
A fixed point for a function f is a number p for which the point (p, p)
belongs to the sets of points defined by the function f. We can thus say that
A fixed point p exists for the interval [a,b] if the function f(x) is continuous
on the interval [a,b] for all x in the interval. Moreover, if f'(x) exists on (a,b),
27
and some constant k, 0 < k < 1, exists with | f'(x) | ≤ k < 1 for all x on the
generate the sequence {pn}, n is from zero to infinity, by letting pn = f(pn – 1).
p = f (lim pn – 1, n→∞)
p = f(p).
28
We can solve equations in one variable using the iteration process:
Instruments/Materials Needed:
Procedure:
g(x).
29
Q1. List all possibilities of the form x = g(x).
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
• Let your instructor check first if you have derived the right equations.
• Choose one of the forms and see if you can find a number x0
belonging to some interval [a,b] where there exists a fixed point for
g(x). TAKE NOTE of the theorem stated earlier. Trial and error
actually works in this simple problem, but it will do us well, for the
30
Q2. Among those listed, have you found inapplicable formulas?
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
• Let us now generate the sequence. Prepare three columns. The first
one is for n. Write in each cell the numbers from 0 to some definite
• The second column is for xn. Write your chosen number x0 in the first
• The first entry under g(xn) is g(x0). This value will serve as your xn + 1
to n = 1. Then the third column will compute g(xn) = g(x1). This value
that you know how to do this simple task in the spreadsheet and
believe that you will not manually copy each entry as you generate
31
• You will notice that the values of xn and g(xn) will approach each
other. Note the value, a, on the space below when xn ≈ g(xn), or when
a = xn = g(xn) = ___________________________.
Divide the constant term by your obtained value. Note your answer on
b = 1 / xn = ___________________________.
Q3. What can you say about the roots that you have just obtained
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
Q4. Is it clear to you why we divide the constant term by the value
all cases?
___________________________________________________
32
___________________________________________________
___________________________________________________
___________________________________________________
• Generate the sequence for the other g(xn) and do the same analysis.
Supplementary activities
• Without the use of the spreadsheet, show how the roots are obtained
using the iteration method. Then try other intervals. Are you obtaining
different roots or the same real root? Explain through Calculus the
computation.
33
Data Analyses:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
Conclusion:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
34
Imus Institute
College Department
Department of Engineering
Activity no. 5
Bisection Method
Objectives:
equations
Abstract:
Let f(x) be continuous on the interval [a,b], where f(a) and f(b) have
[a,b] where f(p) = 0, which defines p as a root of f(x). The bisection method
35
The method works as follows:
1. We are to define three variables, an, bn and pn = (an + pn) / 2. Then [an,bn]
[a,b]. If not, then either f(p1) > 0 or f(p1) < 0, and f(p1) has the same sign as
either f(a1) or f(b1). Remember that a and b are chosen so that f(a) and f(b)
4. If f(p1) and f(a1) have the same sign, then p belongs to the subinterval
[a2,b2] = [p1,b1]. Otherwise (i.e., if f(p1) and f(a1) have opposite signs and
thus f(p1) and f(b1) have the same sign), then p belongs to the subinterval
[a2,b2] = [a1,p1].
5. The process is repeated to the new interval, [a2,b2], then to [ak,bk], until p
is approximated.
36
The figure shows how this continuous halving approaches the root, p. At
first we define the interval [a1,b1], where f(a1) > 0 or simply positive, while
f(b1) < 0 or negative. Next we obtain p1 = (a1 + b1) / 2. We can see from the
graph that f(p1) > 0, and thus have the same sign as a1. Since both a1 and p1
are positive and thus on the same side (in the figure, they are both on the left
of p and f(p) = 0) then we can see that p belongs to the other half, (p1,b1).
We will now focus on the subinterval [a2,b2] = [p1,b1] and do the same
37
Instruments/Materials Needed:
Procedure:
• Determine an interval [a,b] where f(a) and f(b) have opposite signs.
___________________________________________________
• Prepare five columns. The first column is for n, with entries 1,2,3, …
are for an, bn, pn, and f(pn). Set the decimal digits to twelve (or up to,
• Note that pn = (an + bn) /2. Fix the formula for all cell entries of the
fourth column.
pn2 – 3pn + 1, you may now fix the formula for all cell entries of the
fifth column.
38
• Let a1 = a and b1 = b from your chosen interval [a,b]. Now p1 and f(p1)
will have entries based on these values since you have already written
** If f(p1) and f(a1) have the same sign, set a2 = p1 and b2 = b1.
Otherwise, set a2 = a1 and b2 = p1. The process is then repeated for the
new intervals [a2,b2] then [a3,b3] until [ak,bk] when f(pk) ≈ 0.**
Q2. Define the spreadsheet function that you used to satisfy the
above condition.
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
• Note pn when f(pn) is practically zero. Compare this pn with the roots
you obtained using the quadratic formula in the previous activity (or
• Return to your answers in Q1. Run the sequence again, this time
39
Supplementary activities
3x + 1 = 0, can you define the two intervals [M1,N1] and [M2,N2] such
that if you will select the interval [a,b] from [M1,N1] (i.e., [a,b] is a
subset of [M1,N1]), satisfying the criterion that f(a) and f(b) have
opposite signs, and use the bisection method, you will obtain one of
the two solutions of f(x), and the other solution if you select [a,b]
40
Data Analyses:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
Conclusion:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
41
Imus Institute
College Department
Department of Engineering
Activity no. 6
Newton-Raphson Method
Objectives:
Newton-Raphson method
Abstract:
42
Since |m – p| is small, (p – m)2 is practically very small and thus,
0 ≈ f(m) + (p – m) f'(m)
Solving for p,
p ≈ m – f(m)/f'(m).
43
In the figure, each pn is the x-intercept of the tangent line at (pn – 1, f(pn – 1)).
We know that f'(pn – 1) is the slope of the tangent line to the graph at (pn – 1,
x = pn – 1 – f(pn – 1)/f'(pn – 1)
x = pn.
We can see in the figure how the points of tangency approaches the point
(p,0). Thus, upon generating the sequence {pn}, the root of f(x) is pn when pn
≈ pn – 1.
Instruments/Materials Needed:
44
Procedure:
method.
• Prepare three columns. The first one is for n, with entries 1,2,3, ... , k.
the second term is the quotient of the function and its derivative. Since
• The other entries of the second column depend on the entries of the
third column in such a way that the first entry of the third column, p1,
is the second entry of the second column. The spreadsheet will then
compute p2 on the third column, and this will be the third entry of the
45
Q2. Noting an earlier activity, how will you obtain the other root?
___________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
Supplementary activities
key.
obtain the interval [M1,N1] and [M2,N2]. For our function f(x) = x2 –
3x + 1, choose p0 first from [M1,N1] and then from [M2,N2]. What can
you say about the solutions you obtained? Did you expect such
answers?
46
Data Analyses:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
Conclusion:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
47
Imus Institute
College Department
Department of Engineering
Activity no. 7
Secant Method
Objectives:
one variable
Abstract:
Figure 7.1 shows how the secant method works. Starting with two points, p0
and p1, the x-intercepts of the secant lines p2, p3, … , pk approaches the
desired point p.
48
Figure 7.1 The Secant Method
Instruments/Materials Needed:
Procedure:
• Prepare three columns. The first one is for n, with entries 1,2,3, ... , k.
49
• The third column is for f(pn). Note our function, f(x) = x2 – 3x + 1 and
write the corresponding formula in all the cells of the third column.
and our function, f(x) = x2 – 3x + 1. Write the needed formula for the
cells correspond to each variable. Note that the third entry, p2,
depends on the values of the two cells just above it and the
corresponding two cells in the third column (or just the two cells
above it if you will expand f(pn – 1) and f(pn – 2) in your formula). This
50
Supplementary activity
51
Data Analyses:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
Conclusion:
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
52