Bisection Method for Root Finding: Solving e^x - 2 = cos(e^x - 2)
Finding a Root of e^x - 2 = cos(e^x - 2) Using the Bisection Method
This article demonstrates how to find an approximate solution to the equation e^x - 2 = cos(e^x - 2) within a tolerance of 10^-5 using the Bisection method on the interval [0.5, 1.5].
1. Function Evaluation at Endpoints:
First, we evaluate the function f(x) = e^x - 2 - cos(e^x - 2) at the endpoints of our interval:
- For
x = 0.5:f(0.5) = e^(0.5) - 2 - cos(e^(0.5) - 2) ≈ 0.10669- Forx = 1.5:f(1.5) = e^(1.5) - 2 - cos(e^(1.5) - 2) ≈ -0.53578
The product of f(0.5) and f(1.5) is negative, confirming that a root exists within the interval [0.5, 1.5].
2. Bisection Iteration:
Now, we repeatedly divide the interval in half and select the subinterval where the function changes sign:
- Iteration 1: - Midpoint:
x = (0.5 + 1.5) / 2 = 1-f(1) = e^1 - 2 - cos(e^1 - 2) ≈ -0.21413- New subinterval:[0.5, 1](sincef(0.5)andf(1)have opposite signs)- Iteration 2: - Midpoint:x = (0.5 + 1) / 2 = 0.75-f(0.75) ≈ -0.05247- New subinterval:[0.75, 1]- Iteration 3: - Midpoint:x = (0.75 + 1) / 2 = 0.875-f(0.875) ≈ 0.02641- New subinterval:[0.875, 1]- Iteration 4: - Midpoint:x = (0.875 + 1) / 2 = 0.9375-f(0.9375) ≈ -0.01305- New subinterval:[0.9375, 0.96875]- And so on...
We continue this iterative process until the width of the subinterval (and hence the error in our approximation) is less than 10^-5.
3. Approximate Solution:
After several iterations, the Bisection method will converge to an approximate solution within the desired tolerance. It's important to note that the number of iterations required depends on the desired accuracy and the behavior of the function.
Note: This demonstration uses approximate values for easier understanding. In practice, using a calculator or computer program for higher precision is recommended.
原文地址: https://www.cveoy.top/t/topic/olh 著作权归作者所有。请勿转载和采集!