The bisection method was discussed in the lecture. Write a function bisect (f, left, right, tol) which takes four arguments: the function you want to find a root of, the left and right endpoints of the interval at the start, and the tolerance. The function should apply the bisection method until endpoints of the interval are within the given tolerance. Use lambda functions to call bisect with different input functions. Use it to solve the following to some reasonable tolerance: 1. Find three values of x for which f(x) = x³ + 2x² - x - 1 is zero. 2. Find the cube root of 7. 3. Find both solutions to tan-¹(x) = 3 - x². 4. Find all solutions to log(x¹) = x³ – 1. For each of these you may want to first plot the function in order to select sensible initial estimates for the roots. Remember, for the bisection method you must supply initial guesses which bracket the root. Explain what happens when you try to apply bisection method to the function f(x) = 1/x, with initial guesses -2 and 3.

Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
icon
Related questions
Question
The bisection method was discussed in the lecture. Write a function bisect (f, left, right,
tol) which takes four arguments: the function you want to find a root of, the left and right
endpoints of the interval at the start, and the tolerance. The function should apply the bisection
method until endpoints of the interval are within the given tolerance.
Use lambda functions to call bisect with different input functions. Use it to solve the following to
some reasonable tolerance:
1. Find three values of x for which f(x) = x³ + 2x² - x - 1 is zero.
2. Find the cube root of 7.
3. Find both solutions to tan-¹(x) = 3 - x².
4. Find all solutions to log(x¹) = x³ – 1.
For each of these you may want to first plot the function in order to select sensible initial estimates
for the roots. Remember, for the bisection method you must supply initial guesses which bracket
the root.
14
Explain what happens when you try to apply bisection method to the function f(x) = 1/x, with
initial guesses -2 and 3.
CHAPTER 2. ROOT-FINDING
Try to rewrite your function so that it uses a default tolerance of 10-6 if the user does not specify
the tolerance, and check that this works.
Transcribed Image Text:The bisection method was discussed in the lecture. Write a function bisect (f, left, right, tol) which takes four arguments: the function you want to find a root of, the left and right endpoints of the interval at the start, and the tolerance. The function should apply the bisection method until endpoints of the interval are within the given tolerance. Use lambda functions to call bisect with different input functions. Use it to solve the following to some reasonable tolerance: 1. Find three values of x for which f(x) = x³ + 2x² - x - 1 is zero. 2. Find the cube root of 7. 3. Find both solutions to tan-¹(x) = 3 - x². 4. Find all solutions to log(x¹) = x³ – 1. For each of these you may want to first plot the function in order to select sensible initial estimates for the roots. Remember, for the bisection method you must supply initial guesses which bracket the root. 14 Explain what happens when you try to apply bisection method to the function f(x) = 1/x, with initial guesses -2 and 3. CHAPTER 2. ROOT-FINDING Try to rewrite your function so that it uses a default tolerance of 10-6 if the user does not specify the tolerance, and check that this works.
Expert Solution
steps

Step by step

Solved in 9 steps with 17 images

Blurred answer
Similar questions
Recommended textbooks for you
Advanced Engineering Mathematics
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
Numerical Methods for Engineers
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
Introductory Mathematics for Engineering Applicat…
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
Mathematics For Machine Technology
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Basic Technical Mathematics
Basic Technical Mathematics
Advanced Math
ISBN:
9780134437705
Author:
Washington
Publisher:
PEARSON
Topology
Topology
Advanced Math
ISBN:
9780134689517
Author:
Munkres, James R.
Publisher:
Pearson,