0% found this document useful (0 votes)
56 views52 pages

MH411 - 03a BODY

This document describes an activity to calculate and quantify errors in numerical methods. It defines true error, relative true error, approximate error, and relative approximate error. Students are asked to use a spreadsheet to calculate the derivative of f(x) = sin 3x^2 at various values of h to determine the true and approximate errors. By analyzing how the errors change as h approaches 0, students can evaluate their understanding of differential calculus concepts. Quantifying errors is important for accuracy in numerical computations.

Uploaded by

Harvey Mclain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views52 pages

MH411 - 03a BODY

This document describes an activity to calculate and quantify errors in numerical methods. It defines true error, relative true error, approximate error, and relative approximate error. Students are asked to use a spreadsheet to calculate the derivative of f(x) = sin 3x^2 at various values of h to determine the true and approximate errors. By analyzing how the errors change as h approaches 0, students can evaluate their understanding of differential calculus concepts. Quantifying errors is important for accuracy in numerical computations.

Uploaded by

Harvey Mclain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Imus Institute

College Department

Department of Engineering

Name: _____________________ Date: ________________


Yr/Course: _____________________ Score: ________________

Activity no. 1

Preliminaries

Objectives:

• Be reminded of the basic and essential theorems of Calculus

• Recall the concepts of significant digits

• Be prepared of using foundational and higher Mathematics in the

study of numerical methods

Abstract:

Numerical methods require not just the use of fundamental properties of

numbers but the deepest properties and theorems in Calculus because the

formulas and strategies developed in this stage of Mathematics require

accuracy beyond mere trial and error.

1
There is always a tendency for students to forget acquired knowledge as they

step to new grounds of Mathematics; moreover—and very unfortunate—the

failure to follow through the chain of Mathematical progress is visible to

today's learners. It is indeed an added task both to the students and the

instructors to be responsible in maintaining and enhancing what is being

taught and learned.

Instruments/Materials Needed:

• -- textbooks, notes, and any materials about Calculus and

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

graphs and examples if you prefer.

REMEMBER that the aim of this activity is for you to recall the

fundamental theorems of Calculus and be reminded of the essential concepts

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

is useful for reference. TO THE INSTRUCTOR: please monitor the

compilation of each student to avoid immature handling of research.

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

7. Fundamental Theorem of Algebra

6
8. Significant Digits

Exercises

1. Write p(x) = 4 + 2x – 3x2 + 4x3 – 7x4 + 8x5 in nested multiplication.

2. Find a Taylor-series expansion around x = 0 for f(x) = cos x.

7
3. Find a Maclaurin-series expansion for f(x) = e –4x

4. Determine the number of significant digits in the following numbers:

(a) 5.34645 ____________

(b) 2.00000001 ____________

(c) 5.0000000000 ____________

(d) 0.0004500 ____________

(e) 42 000.0 ____________

(f) 2.701 x 10 –9 ____________

(g) 0.000034 ____________

(h) 47 200 000 ____________

(i) 20000044 ____________

(j) 0.00001 ____________

8
Imus Institute
College Department

Department of Engineering

Name: _____________________ Date: ________________


Yr/Course: _____________________ Score: ________________

Activity no. 2

Measuring Errors

Objectives:

• Define true, approximate, relative and absolute errors

• Learn how to quantify errors

• Determine how to minimize errors

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

qualitatively mark them simply as “incorrect”. But we hardly spot errors

with magnitude between one and zero. Caring less keeps some students

wondering why there are differences in final answers, arguing that each

solution is faithfully done.

9
The source of error must be identified. Numerical computations must not be

simply labeled as “correct” and “incorrect” but must be quantified to see

how significant differences in values are. Errors must be dealt so as to be

minimized.

True error is defined as the difference between the true or exact value and

the approximate value; that is,

true error = true value – approximate value.

The relative true error is the ratio of the true error and the true value:

relative true error = true error / true value.

The absolute relative true error is simply the absolute value, or the

unsigned magnitude, of the relative true error:

absolute relative true error = | relative true error | .

10
Approximate error is the difference between the present approximation and

the previous approximation:

approximate error = present approximation – previous approximation.

The relative approximate error is the ratio between the approximate error

and the present approximation:

relative approximate error = approximate error/present approximation.

Lastly, the absolute relative approximate error, as you may guess, is

absolute relative approximate error = | relative approximate error | .

True error is useful in checking various computations where true values are

defined. It is important in running parts of computations so as to remain

accurate in the final output. Approximate error is useful in the absence of an

exact value. Quantifying this error goes beyond the procedure of mere

checking deviations from known true values. Standard formulas for

computing just every single complex problem simply do not exist.

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

viewed with precise approximations.

Instruments/Materials Needed:

• 1 Computer unit with installed spreadsheet application software

Procedure:

Computing True Error

Using the definition of the derivative, we are to find approximate values for

the derivative of f(x) = sin 3x2 at x = π/18 for various values of h.

• Prepare initially two columns, the first one for h and the other for

f'(π/18). Note Table 2.1.

• On the first row of h, write the value 0.00100.

• On the second row of h, write the formula

= [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

simple use of the spreadsheet works.

___________________________________________________

___________________________________________________

12
___________________________________________________

___________________________________________________

Table 2.1. True and Approximate Errors

• On the cells of the second column, set the decimal digits to nine and

write the formula

= (SIN(3*(pi()/18 + h)^2) – SIN(3*(pi()/18)^2) ) / h

where h denotes the corresponding cell on the first column.

Q2. Write the given equation as a standard formula. What basic

formula in differential calculus do you see? Explain.

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

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

the 21st row second column. IMPORTANT: compute the value

directly on the spreadsheet to avoid losing significant values. Note

this value as the true value.

Q3. Write your solution in solving f'(x) on the space provided.

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

digits for the third (and the following) columns.

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

quotient on each corresponding row.

Q5. What can you say on the entries of the third and fourth

columns as the value of h changes? What does this imply? You

may explain briefly using what you have learned from differential

calculus.

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

15
Computing Approximate Error

Though we have access to the true value, it is in our purpose of

demonstrating how to obtain the value of approximate error that we are to

conduct the next procedures.

• Prepare a fifth column that computes the difference between two

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,

[ f'(3) for h = 2 ] – [ f'(3) for h = 1 ].

• 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

expected to be blank. Each following row must display the ratio

between each entry of the fifth column and the corresponding entry of

the second column; that is,

[nth row of 5th column] / [nth row of 2nd column] .

Q6. What can you say on the entries of the fifth and sixth columns

as the value of h changes?

___________________________________________________

___________________________________________________

___________________________________________________

16
___________________________________________________

Q6. What is the implication of computing relative errors?

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

Data Analyses:

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

17
Conclusion:

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

18
Imus Institute
College Department

Department of Engineering

Name: _____________________ Date: ________________


Yr/Course: _____________________ Score: ________________

Activity no. 3

Round-Off and Truncation Errors

Objectives:

• Define round-off and truncation errors

• Determine how these errors are minimized

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

the greatest of all computers cannot represent all numerical quantities

exactly. Thus, some digits are “cropped” or omitted. Be mindful, however,

that such deviations are not caused by immature handling of computational

procedures, but from the fact that no one can simply give the numerical

values of infinite sequence of numbers.

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

the end digits.

If we consider rounding-off the value of pi, π = 3.1415926535... into eight

significant digits,

π = 3.1415927

The round-off error is simply the difference between the exact and the

round-off values,

round-off error = -0.0000000464...

Truncation error is the result of approximating an infinite process by a

procedure that handles finite mathematical computations.

Say, if we express f(x) = cos x using the Maclaurin series,

cos x = 1 – x2/2! + x4/4! – x6/6! + x8/8! – x10/10! + …

Truncating into four terms,

cos x ≈ 1 – x2/2! + x4/4! – x6/6!

20
Thus the truncation error is

x8/8! – x10/10! + …

Truncation errors may also occur as we replace h = ∆x → 0 with a finite

value, say, h = 0.001, as we compute derivatives.

Instruments/Materials Needed:

• 1 Computer unit with installed spreadsheet application software

Procedure:

Round-off Error

We are to compute round-off errors for the decimal equivalent of 3/14 for

different significant digits. Practically, we represent the exact value as 3/14

= 0.2142857 which simply means that is consists of non-terminating, infinite

sequence of numbers, 0.2142857142857142857142857142857...

• Prepare three columns, each with ten entry cells. The first column

denotes the number of significant digits to be considered in rounding-

off the decimal equivalent of 3/14. Start with 1 up to 10.

21
• For the second column, give the round-off value of 3/14 according to

the corresponding significant digits denoted in the first column. Note

the round-off function of the spreadsheet. Set the decimal digits to 12.

• Obtain the entries of the third column, also at 12 decimal digits, by

subtracting each entry of the second column from the exact value,

3/14. That is,

= 3/14 – [entry of 2nd column]

Q1. Compare the entries of the third column. Are the results

fairly obvious? What does this remind us?

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

Q2. Think about this: does the number of decimal digits indicate

the accuracy of obtained values?

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

22
Truncation Error

Let us express f(x) = ln x at x = 1 using Taylor-series expansion and

compute truncation errors for f(1.2) = ln (1.2).

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

denotes the number of terms to be considered in truncating the Taylor-

series equivalent. Start with n = 1 to n = 15.

• For the second column, give the truncated value of ln (1.2) according

to the corresponding terms denoted in the first column. Set the

decimal digits to twelve (and so with the third column).

23
Q4. Describe how you create the formula(s) for the second

column. Do you have to write a new formula for each cell?

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

• Obtain the entries of the third column by subtracting each entry of the

second column from the exact value, ln (1.2). That is,

= LN(1.2) – [entry of 2nd column]

Q5. Compare the entries of the third column. What does excessive

truncation do to the exact value?

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

• Create a new table and try for some constants a and b for f(x) = ln x at

x = a and approximate f(b) = ln b. Describe the results.

24
Q6. Suppose we would like to find f'(3) for f(x) = ex cos x3. If we

use the definition of the derivative f'(x) = [ f(x + h) – f(x) ] / h and

truncate by using h = 0.01, what will be the truncation error?

Show your solution.

25
Data Analyses:

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

Conclusion:

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

26
Imus Institute
College Department

Department of Engineering

Name: _____________________ Date: ________________


Yr/Course: _____________________ Score: ________________

Activity no. 4

Fixed-Point Iteration

Objectives:

• Define what fixed-point iteration is

• Learn how to obtain solution of one-variable equations using fixed-

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

for the function f, f(p) = p.

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

interval (a,b), then the fixed point in [a,b] is unique.

To approximate the fixed point p, we choose an initial approximation p0 and

generate the sequence {pn}, n is from zero to infinity, by letting pn = f(pn – 1).

If the sequence converging to p and f is continuous,

p = lim pn, n→∞

p = lim f(pn – 1), n→∞

p = f (lim pn – 1, n→∞)

p = f(p).

Figure 4.1 Fixed-Point Iteration

28
We can solve equations in one variable using the iteration process:

1. For the equation f(x) = 0, regroup the terms to form x = g(x).

2. Choose a number x0 belonging to the interval [a,b] where there exists a

fixed point for g(x). Take note of the theorem stated.

3. Use your iteration formula to generate the sequence {xn} using xn + 1 =

g(xn), n from 0 to some number m when xm + 1 ≈ g(xm).

Instruments/Materials Needed:

• 1 Computer unit with installed spreadsheet application software

• 1 standard calculator with ANS (answer) function

Procedure:

We will solve the equation x2 – 3x + 1 = 0 by iteration.

• Derive an iteration formula from the equation by expressing it as x =

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

sake of learning, to show your solution below.

30
Q2. Among those listed, have you found inapplicable formulas?

Explain mathematically why each formula can or cannot be used.

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

• 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

number, say 20.

• The second column is for xn. Write your chosen number x0 in the first

cell, corresponding to n = 0 on the first column. Set the decimal digits

to fifteen both for the second and third columns.

• Compute g(xn) on the third column. Take note of your formula.

• The first entry under g(xn) is g(x0). This value will serve as your xn + 1

= x0 + 1 = x1, or the second entry in your second column, corresponding

to n = 1. Then the third column will compute g(xn) = g(x1). This value

will then be x1 + 1 = x2, and so on. YOUR INSTRUCTOR EXPECTS

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

g(xn). Show your instructor how you do it.

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

they are numerically equal.

a = xn = g(xn) = ___________________________.

• Now take note of the constant term of your equation, x2 – 3x + 1 = 0.

Divide the constant term by your obtained value. Note your answer on

the spreadsheet and on the space provided.

b = 1 / xn = ___________________________.

• Solve the solution of the equation x2 – 3x + 1 = 0 using the quadratic

formula (do it on the spreadsheet) and take note of the values.

Q3. What can you say about the roots that you have just obtained

and the values a and b that you have generated earlier?

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

Q4. Is it clear to you why we divide the constant term by the value

a = xn to obtain b? Explain why we did it. Is it then applicable in

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 a simple calculator with a function key ANS (answer).

• Find the root(s) of the equation x3 – 2x2 – 5 = 0 in the interval [2,3]

using the iteration method. Then try other intervals. Are you obtaining

different roots or the same real root? Explain through Calculus the

number of solutions that you obtained.

• Find the roots of x2 + x – 1 = 0 by iteration. Which of the forms x =

g(x) is not an applicable iteration formula? Explain and show your

computation.

33
Data Analyses:

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

Conclusion:

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

34
Imus Institute
College Department

Department of Engineering

Name: _____________________ Date: ________________


Yr/Course: _____________________ Score: ________________

Activity no. 5

Bisection Method

Objectives:

• Know the principles behind the bisection method

• Learn how the bisection method is used in solving single-variable

equations

Abstract:

Let f(x) be continuous on the interval [a,b], where f(a) and f(b) have

opposite signs. Noting the Intermediate Value Theorem, there exists p in

[a,b] where f(p) = 0, which defines p as a root of f(x). The bisection method

works by continuously dividing the subintervals of [a,b] into two, locating

the portion that contains p, until p itself is approximately located.

35
The method works as follows:

1. We are to define three variables, an, bn and pn = (an + pn) / 2. Then [an,bn]

are the subintervals of [a,b].

2. We begin with a1 = a and b1 = b, and thus p1 = (a1 + b1) / 2.

3. If f(p1) = 0, then p1 = p, or the root of the equation f(x) = 0 in the interval

[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)

have opposite signs.

4. If f(p1) and f(a1) have the same sign, then p belongs to the subinterval

(p1,b1) and we will set a2 = p1 and b2 = b1 to define the new (sub)interval

[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

(a1,p1) and we will set a2 = a1 and b2 = p1 to define the new (sub)interval

[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

process. In the figure, p3 assumes the value of p.

Figure 5.1 The Bisection Method

37
Instruments/Materials Needed:

• 1 Computer unit with installed spreadsheet application software

Procedure:

We will solve the equation f(x) = x2 – 3x + 1 = 0 by the bisection method.

• Determine an interval [a,b] where f(a) and f(b) have opposite signs.

To control the output, define an interval [a,b] where a and b are

integers and the difference between the intervals is one.

Q1. Define the possible intervals [a,b] where a,b ∊ ℤ and b – a = 1

___________________________________________________

• Prepare five columns. The first column is for n, with entries 1,2,3, …

to some finite number, say 40 (preferably more). The next columns

are for an, bn, pn, and f(pn). Set the decimal digits to twelve (or up to,

but not more than, fifteen; and use n = 1 to n = 50).

• Note that pn = (an + bn) /2. Fix the formula for all cell entries of the

fourth column.

• Since the column f(pn) is defined by f(x) = x2 – 3x + 1 and thus f(pn) =

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

the formulas for those columns.

• Using your knowledge of the spreadsheet, define conditions for the

cell entries of an and bn. Note that in the bisection method:

** 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

simply run the value again in your new activity).

• Return to your answers in Q1. Run the sequence again, this time

choosing the other possible interval. Note the results.

39
Supplementary activities

• Find the root(s) of the equation x3 – 2x2 – 5 = 0 in the interval [2,3]

and the roots of x2 + x – 1 = 0 using the bisection method. Compare

the results to the previous activity.

• In solving quadratic equations like in the main activity, i.e., f(x) = x2 –

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]

from [M2,N2]? Explain how this works.

40
Data Analyses:

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

Conclusion:

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

41
Imus Institute
College Department

Department of Engineering

Name: _____________________ Date: ________________


Yr/Course: _____________________ Score: ________________

Activity no. 6

Newton-Raphson Method

Objectives:

• Define the mathematical principles applied in the derivation of the

Newton-Raphson method

• Learn how the method is used in solving equations in one variable

Abstract:

For a continuous function f on the interval [a,b], let m on the interval be

chosen such that f(m) ≠ 0 and |m – p| is considerably small, and f(p) = 0.

Then, with Taylor's polynomial for f(x),

f(x) = f(m) + (x – m) f'(m) + (x – m)2 f''(ε(x))/ 2!

where ε falls between m and x. For x = p and noting that f(p) = 0,

0 = f(m) + (p – m) f'(m) + (p – m)2 f''(ε(x))/ 2!

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).

The Newton-Raphson method is defined by generating the sequence {pn}

using the equation

pn = pn – 1 – f(pn – 1)/f'(pn – 1),

starting with an initial approximation, p0.

Figure 6.1 The Newton-Raphson Method

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,

f(pn – 1)). Writing the equation of the tangent line,

y – f(pn – 1) = f' (pn – 1)(x – pn – 1).

When y = 0, x is the x-intercept. Thus,

0 – f(pn – 1) = f' (pn – 1)(x – pn – 1)

x = pn – 1 – f(pn – 1)/f'(pn – 1)

Since pn = 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:

• 1 Computer unit with installed spreadsheet application software

44
Procedure:

We will solve the equation f(x) = x2 – 3x + 1 = 0 by the Newton-Raphson

method.

• Prepare three columns. The first one is for n, with entries 1,2,3, ... , k.

• The second column is for pn – 1. The first entry, corresponding to n = 1,

is obviously p1 – 1 = p0. Choose an initial approximation p0.

• The third column is for pn. Note that in our equation

pn = pn – 1 – f(pn – 1)/f'(pn – 1),

the second term is the quotient of the function and its derivative. Since

we have f(x) = x2 – 3x + 1, and f'(x) = 2x – 3, we have

pn = pn – 1 – [ (pn – 1)2 – 3(pn – 1) + 1] / [2(pn – 1) – 3].

Write this formula for the entries of the third column.

• 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

second column, and so on. Do these on your current spreadsheet as

you have done in an earlier activity.

• Note the value when pn – 1 is practically equal to pn. Compare this

value to the roots obtained using the quadratic formula.

45
Q2. Noting an earlier activity, how will you obtain the other root?

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

Supplementary activities

• Find the root(s) of the equation x3 – 2x2 – 5 = 0 in the interval [2,3]

and the roots of x2 + x – 1 = 0 using the Newton-Raphson method.

Compare the results to the previous activities.

• Run the sequence using a standard calculator with an ANS function

key.

• Refer to the previous supplementary activity (in Activity 5) where you

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

Name: _____________________ Date: ________________


Yr/Course: _____________________ Score: ________________

Activity no. 7

Secant Method

Objectives:

• Demonstrate how the secant method finds the solution of equations in

one variable

• Learn the mathematical principle behind the secant method

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.

The sequence {pn} is defined by the equation

pn = pn – 1 – [ f(pn – 1) (pn – 1 – pn – 2) ] / [ f(pn – 1) – f(pn – 2) ].

48
Figure 7.1 The Secant Method

Instruments/Materials Needed:

• 1 Computer unit with installed spreadsheet application software

Procedure:

We will solve the equation f(x) = x2 – 3x + 1 = 0 by the secant method.

• Prepare three columns. The first one is for n, with entries 1,2,3, ... , k.

• The second column is for pn – 1. The first two entries, corresponding to

n = 1 and n = 2, are p1 – 1 = p0 and p2 – 1 = p1 . Choose initial

approximations p0 and p1.

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.

• Note our equation

pn = pn – 1 – [ f(pn – 1) (pn – 1 – pn – 2) ] / [ f(pn – 1) – f(pn – 2) ],

and our function, f(x) = x2 – 3x + 1. Write the needed formula for the

rest of the entries of the second column, carefully considering which

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

holds for the rest of pn.

• Note the value of pn when f(pn) is practically equal to zero. Compare

this value to the roots obtained using the quadratic formula.

Q1. Show that in our equation

pn = pn – 1 – [ f(pn – 1) (pn – 1 – pn – 2) ] / [ f(pn – 1) – f(pn – 2) ],

the value pn is the x-intercept of each of the secant lines.

50
Supplementary activity

• Find the root(s) of the equation x3 – 2x2 – 5 = 0 in the interval [2,3]

and the roots of x2 + x – 1 = 0 using the secant method. Compare the

results to the previous activities.

51
Data Analyses:

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

Conclusion:

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

52

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy