0% found this document useful (0 votes)
661 views5 pages

Problem Set #9: Secant Method: Iteration, The Root of A Given Function Has Found and It Is - 0.65927

This document contains a student's work on solving several problems using the secant method to find roots of functions. The problems involve finding roots of various functions, such as cos(x) + 2sin(x) + x^2, x^4 - 5, and -2x^6 - 1.5x^4 + 10x + 2. For each problem, the student shows the iterations of the secant method, including the approximations for each root at each step and the percentage error, eventually finding the root to within a certain tolerance. The student also provides graphs of the functions.
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)
661 views5 pages

Problem Set #9: Secant Method: Iteration, The Root of A Given Function Has Found and It Is - 0.65927

This document contains a student's work on solving several problems using the secant method to find roots of functions. The problems involve finding roots of various functions, such as cos(x) + 2sin(x) + x^2, x^4 - 5, and -2x^6 - 1.5x^4 + 10x + 2. For each problem, the student shows the iterations of the secant method, including the approximations for each root at each step and the percentage error, eventually finding the root to within a certain tolerance. The student also provides graphs of the functions.
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/ 5

Name: Jo Ann D.

Arranguez
Course, Year and Section: BSIE 2-E
Advance Mathematics
Problem Set #9: Secant Method

EXERCISE 4. Solve the following problems using Secant method and show the graph of a
function.

1.) Find a root of a function (𝑥) = cos(𝑥) + 2 sin(𝑥) + 𝑥2. Use 𝑥0 = 0 𝑎𝑛𝑑 𝑥1 = 0.1 as initial
approximations. Perform a maximum 100 number of iterations.

Iteration Xi-1 Xi Xi+1 f(Xi-1) f(Xi) f(Xi+1) %Error


1 0 0.1 -0.48859 1 1.204671 0.182954 -
2 0.1 -0.48859 -0.59399 1.204671 0.182954 0.062199 120.4671
3 -0.48859 -0.59399 -0.64827 0.182954 0.062199 0.009764 17.74389
4 -0.59399 -0.64827 -0.65838 0.062199 0.009764 0.000774 8.374264
5 -0.64827 -0.65838 -0.65925 0.009764 0.000774 1.16E-05 1.535461
6 -0.65838 -0.65925 -0.65927 0.000774 1.16E-05 1.42E-08 0.132031
7 -0.65925 -0.65927 -0.65927 1.16E-05 1.42E-08 2.62E-13 0.002007
8 -0.65927 -0.65927 -0.65927 1.42E-08 2.62E-13 0 2.47E-06
9 -0.65927 -0.65927 -0.65927 2.62E-13 0 0 4.55E-11

Answer: 100 iterations cannot be performed. After 9th iteration, the root of a given
function has found and it is -0.65927.

Figure 1. Graph of f(x)=cos(x)+2sin(x)+x^2

2.) Find a root of a function (𝑥) = 𝑥4 −5. Choose 𝑥0 = 1 𝑎𝑛𝑑 𝑥1 = 2 as initial


approximations.
Iteration Xi-1 Xi Xi+1 f(Xi-1) f(Xi) f(Xi+1) %Error
1 1 2 1.266667 -4 11 -2.42576 -
2 2 1.266667 1.399165 11 -2.42576 -1.16756 57.89474
3 1.266667 1.399165 1.522118 -2.42576 -1.16756 0.36776 9.469808
4 1.399165 1.522118 1.492666 -1.16756 0.36776 -0.03578 8.077752
5 1.522118 1.492666 1.495278 0.36776 -0.03578 -0.00095 1.973067
6 1.492666 1.495278 1.495349 -0.03578 -0.00095 2.56E-06 0.174632
7 1.495278 1.495349 1.495349 -0.00095 2.56E-06 -1.8E-10 0.004765
8 1.495349 1.495349 1.495349 2.56E-06 -1.8E-10 0 1.28E-05
9 1.495349 1.495349 1.495349 -1.8E-10 0 0 9.13E-10

Answer: With 9th iteration, the root of a given function is 1.495349.

Figure 2. Graph f(x)=x^4-5

3.) Locate the first positive root of (𝑥) = sin 𝑥 + cos(1 + 𝑥2) − 1 where 𝑥 is in radians. Use
four iterations of the secant method with initial guesses of (a) 𝑥𝑖−1 = 1.0 and 𝑥𝑖 = 3.0;
(b) 𝑥𝑖−1 = 1.5 and 𝑥𝑖 = 2.5; and (c) 𝑥𝑖−1 = 1.5 and 𝑥𝑖 = 2.25 to locate the root.

(a) 𝑥𝑖−1 = 1.0 and 𝑥𝑖 = 3.0

Iteration (i) Xi-1 Xi Xi+1 f(Xi-1) f(Xi) f(Xi+1) %Error


1 1 3 -0.02321 -0.57468 -1.69795 -0.48336 -
2 3 -0.02321 -1.22635 -1.69795 -0.48336 -2.74475 13023.08
3 -0.02321 -1.22635 0.233951 -0.48336 -2.74475 -0.27472 98.10704
4 -1.22635 0.233951 0.396366 -2.74475 -0.27472 -0.21194 624.1894
Answer: As shown in the graph below, the initial values are not close enough to the root.
Thus, it does not converge to a root of f(x).

(b) 𝑥𝑖−1 = 1.5 and 𝑥𝑖 = 2.5

Iteration (i) Xi-1 Xi Xi+1 f(Xi-1) f(Xi) f(Xi+1) %Error


1 1.5 2.5 2.356929 -0.99663 0.166396 0.669842 -
2 2.5 2.356929 2.547287 0.166396 0.669842 -0.08283 6.070241
3 2.356929 2.547287 2.526339 0.669842 -0.08283 0.031471 7.472986
4 2.547287 2.526339 2.532107 -0.08283 0.031471 0.00057 0.829187

Answer: With 4th iteration, the positive root of the given function is 2.532107.

(c) 𝑥𝑖−1 = 1.5 and 𝑥𝑖 = 2.25

Iteration (i) Xi-1 Xi Xi+1 f(Xi-1) f(Xi) f(Xi+1) %Error


1 1.5 2.25 1.927018 -0.99663 0.753821 -0.06177 -
2 2.25 1.927018 1.951479 0.753821 -0.06177 0.024147 16.76072
3 1.927018 1.951479 1.944604 -0.06177 0.024147 -1.4E-05 1.253477
4 1.951479 1.944604 1.944608 0.024147 -1.4E-05 1.61E-09 0.353536

Answer: With 4th iteration, the first positive root of the given function is 1.944608.

Figure 3. Graph of f(x)+sin(x)+cos(1+x^2)-1

4.) Determine the root of (𝑥) = 𝑥4.5 −80 using initial approximations 𝑥0 = 0 𝑎𝑛𝑑 𝑥1 = 1 up
to six decimal places.

Iteration Xi-1 Xi Xi+1 f(Xi-1) f(Xi) f(Xi+1) %Error


1 0 1 80.000000 -80 -79 3.66E+08 -
2 1 80 1.000017 -79 3.66E+08 -78.9999 98.75
3 80 1.000017 1.000034 3.66E+08 -78.9999 -78.9998 7899.864
4 1.000017 1.000034 18.553986 -78.9999 -78.9998 510386.8 0.001703
Answer: With 4th iteration, the root of a given function is 18.553986.

Figure 4. Graph of f(x)=x^4.5-80

5.) Find the root of a function (𝑥) = −2𝑥6 − 1.5𝑥4 + 10𝑥 + 2 using initial approximations 𝑥0
= 0.5 𝑎𝑛𝑑 𝑥1 = 1.5 up to six decimal places.

Iteration Xi-1 Xi Xi+1 f(Xi-1) f(Xi) f(Xi+1) %Error


1 0.5 1.5 0.839506 6.875 -13.375 8.949888 -
2 1.5 0.839506 1.104293 -13.375 8.949888 7.185385 78.67647
3 0.839506 1.104293 2.182556 8.949888 7.185385 -226.395 23.97798
4 1.104293 2.182556 1.137463 7.185385 -226.395 6.532017 49.40367
5 2.182556 1.137463 1.166771 -226.395 6.532017 5.841831 91.87934
6 1.137463 1.166771 1.414836 6.532017 5.841831 -5.90449 2.511868
7 1.166771 1.414836 1.290142 5.841831 -5.90449 1.523132 17.53314
8 1.414836 1.290142 1.315712 -5.90449 1.523132 0.286917 9.665154
9 1.290142 1.315712 1.321646 1.523132 0.286917 -0.01936 1.943449
10 1.315712 1.321646 1.321271 0.286917 -0.01936 0.000222 0.449037
11 1.321646 1.321271 1.321275 -0.01936 0.000222 1.69E-07 0.028397
12 1.321271 1.321275 1.321275 0.000222 1.69E-07 -1.5E-12 0.000322
13 1.321275 1.321275 1.321275 1.69E-07 -1.5E-12 -3.6E-15 2.46E-07
14 1.321275 1.321275 1.321275 -1.5E-12 -3.6E-15 -3.6E-15 2.15E-12

Answer: With 14th iteration, the root of a given function is 1.321275.


Figure 5. Graph of f(x)=-2x^6-1.5x^^4+10x+2

29

You might also like