hi was wondering how many iterations you had to do:
use method of bisection to solve to 2 d.p. given that a root exists between 1.2 and 1.4
lnx = cosx
cheers
is that correct??As many times as necessary until rounding off the final result to 2 decimal places yields the same answer.
Well since there is no specification of the number of iterations, that seems to be the most logical approach. The number of iterations is dependent on the steepness of the curve about the neighbourhood of the root.is that correct??
you could be there for ages doing that
all the questions i remember told you how many times to apply, and at the end of the number of applications the input that would produce the number closest to zero ( when solving p(x)= lnx-cosx for zeros )would be your answer
k, didnt know that, thanksWell since there is no specification of the number of iterations, that seems to be the most logical approach. The number of iterations is dependent on the steepness of the curve about the neighbourhood of the root.
Let f(x) = ln x - cos x with a root between 1.2 and 1.4
f(1.2) ~ - 0.18
f(1.4) ~ 0.17
Try x = 1.3
f(1.3) ~ - 5.13 x 10-3
so root is between 1.3 and 1.4
Try 1.35
f(1.35) ~ 0.081
so root is between 1.3 and 1.35
Try 1.325
f(1.325) ~ 0.038
so root is between 1.3 and 1.325
Try 1.3125
f(1.3125) ~ 0.016
so root is between 1.3 and 1.3125
Try 1.30625
f(1.30625) ~ 5.69 x 10-3
so root is between 1.3 and 1.30625
Try 1.303125
f(1.303125) ~ 2.79 x 10-4
so root is between 1.3 and 1.303125
Therefore we can conclusively deduce that the root is approximately 1.30 to two decimal places