144k views
2 votes
Locate the first positive root of f(x) = x cos(x) 1. perform 3 iterations of the false-position and secant methods to find that root. use two integer values that bracket the root as initial guesses. at each iteration, report the root estimate, x, the two points used to find it, and the approximate percent relative error,.| ε α |

User Emperorlou
by
7.2k points

1 Answer

5 votes

Final answer:

To find the first positive root of the function f(x) = x cos(x) using the false-position and secant methods, 3 iterations were performed with two initial guesses that bracket the root. The root estimates, points used, and approximate percent relative errors were reported at each iteration.

Step-by-step explanation:

To find the first positive root of the function f(x) = x cos(x) using the false-position and secant methods, we will perform 3 iterations with two initial guesses that bracket the root. Let's assume our initial guesses are x1 = 1 and x2 = 2.

  1. False-Position Method:
  • Iteration 1:
    • Calculate f(x1) = x1 cos(x1) = 1 cos(1) ≈ 0.5403
    • Calculate f(x2) = x2 cos(x2) = 2 cos(2) ≈ -1.185
    • Calculate the new estimate for the root using the false-position formula: x = x2 - (f(x2) / (f(x2) - f(x1))) * (x2 - x1) ≈ 2 - (-1.185 / (-1.185 - 0.5403)) * (2 - 1) ≈ 1.8727
    • Calculate the approximate percent relative error using the formula: |εα| = |(x - x2) / x| * 100% ≈ |(1.8727 - 2) / 1.8727| * 100% ≈ 6.05%
  • Iteration 2:
    • Repeat the same calculations using the new estimate for the root, x1 = 1.8727, and the previous estimate x2 = 2
    • Calculate the new estimate for the root: x ≈ 1.8727 - (-1.0279 / (-1.0279 - 0.5403)) * (2 - 1.8727) ≈ 1.5615
    • Calculate the approximate percent relative error: |εα| ≈ |(1.5615 - 1.8727) / 1.5615| * 100% ≈ 19.89%
  • Iteration 3:
    • Repeat the calculations using the new estimate for the root, x1 = 1.5615, and the previous estimate x2 = 2
    • Calculate the new estimate for the root: x ≈ 1.5615 - (-2.8161 / (-2.8161 - 0.5403)) * (2 - 1.5615) ≈ 1.3477
    • Calculate the approximate percent relative error: |εα| ≈ |(1.3477 - 1.5615) / 1.3477| * 100% ≈ 13.65%
Secant Method:
  • Iteration 1:
    • Calculate f(x1) = x1 cos(x1) ≈ 0.5403
    • Calculate f(x2) = x2 cos(x2) ≈ -1.185
    • Calculate the new estimate for the root using the secant formula: x = x2 - (f(x2) * (x2 - x1)) / (f(x2) - f(x1)) ≈ 2 - (-1.185 * (2 - 1)) / (-1.185 - 0.5403) ≈ 1.9137
    • Calculate the approximate percent relative error: |εα| ≈ |(1.9137 - 2) / 1.9137| * 100% ≈ 4.72%
  • Iteration 2:
    • Repeat the same calculations using the new estimate for the root, x1 = 2, and the previous estimate x2 = 1.9137
    • Calculate the new estimate for the root: x ≈ 1.9137 - (-1.7069 * (1.9137 - 2)) / (-1.7069 - 0.5403) ≈ 1.7688
    • Calculate the approximate percent relative error: |εα| ≈ |(1.7688 - 1.9137) / 1.7688| * 100% ≈ 48.53%
  • Iteration 3:
    • Repeat the calculations using the new estimate for the root, x1 = 1.9137, and the previous estimate x2 = 1.7688
    • Calculate the new estimate for the root: x ≈ 1.7688 - (-1.1216 * (1.7688 - 1.9137)) / (-1.1216 - 0.5403) ≈ 1.6364
    • Calculate the approximate percent relative error: |εα| ≈ |(1.6364 - 1.7688) / 1.6364| * 100% ≈ 7.86%

User Ramar
by
7.9k points