3. Problem 3: Find two roots of the equation cos(x)e-2sin(3 In (x²)) = 0, on the interval [4, 10]. Explain how many decimal places you believe you have correct, and how many steps of the bisection method it took. Also include timing results for your calculations.
3. Problem 3: Find two roots of the equation cos(x)e-2sin(3 In (x²)) = 0, on the interval [4, 10]. Explain how many decimal places you believe you have correct, and how many steps of the bisection method it took. Also include timing results for your calculations.
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter14: Numerical Methods
Section14.3: Refinements To The Bisection Method
Problem 4E
Related questions
Question
Please use python and show codes. The second picture is a different example we did
![import math
import time
#Want a root of f(x) = cos(x) x^2/2
def f(x):
return math.cos(x)
tol=10**-15
a
= 0.5
b = 1.5
Error =
c = math.nan
count = 0
(b-a)/2
tic time.time()
if f(a) f(b) < 0:
while (Error > tol) and (count < 1000):
X
c = (a+b)/2
if f(a) f(c) < 0:
b = c
elif f(b) f(c) < 0:
a = c
Error = (b-a)/2
count = count + 1
toc = time.time()
runTime = toc - tic
print ()
print (c)
print (Error)
print (f(c))
print (runTime)
print (count)
print()](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe15a76cd-09c8-49fc-a97e-76e9013c0a32%2F5662de11-252e-4713-9c6e-efa763568ff4%2Fs3hfw0p_processed.jpeg&w=3840&q=75)
Transcribed Image Text:import math
import time
#Want a root of f(x) = cos(x) x^2/2
def f(x):
return math.cos(x)
tol=10**-15
a
= 0.5
b = 1.5
Error =
c = math.nan
count = 0
(b-a)/2
tic time.time()
if f(a) f(b) < 0:
while (Error > tol) and (count < 1000):
X
c = (a+b)/2
if f(a) f(c) < 0:
b = c
elif f(b) f(c) < 0:
a = c
Error = (b-a)/2
count = count + 1
toc = time.time()
runTime = toc - tic
print ()
print (c)
print (Error)
print (f(c))
print (runTime)
print (count)
print()
![3. Problem 3: Find two roots of the equation
cos(x)e-2sin (3 ln(x²)) = 0,
on the interval [4, 10]. Explain how many decimal places you believe
you have correct, and how many steps of the bisection method it took.
Also include timing results for your calculations.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe15a76cd-09c8-49fc-a97e-76e9013c0a32%2F5662de11-252e-4713-9c6e-efa763568ff4%2Fcjaeiqa_processed.jpeg&w=3840&q=75)
Transcribed Image Text:3. Problem 3: Find two roots of the equation
cos(x)e-2sin (3 ln(x²)) = 0,
on the interval [4, 10]. Explain how many decimal places you believe
you have correct, and how many steps of the bisection method it took.
Also include timing results for your calculations.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr