numerical analysis 9
Consider the function f1(x) = 3 cos(2x) cos(4x) − 2 cos(6x) cos(3x) − 6 cos(2x)(sin(2x))2 − 5 cos(3x) + 5/2. This function has exactly one root in the interval 0 ≤ x ≤ 1. Your assignment is to find this root accurately to 10 decimal places, if possible. Use MATLAB, which does all calculations in double precision, equivalent to about 16 decimal digits. You should use the Bisection Method as described below to determine the root, and then try to assess whether all 10 places are correct. 1. Begin by applying the Bisection Method three times, using three different starting intervals [a, b], each time continue bisecting until you reach 10 correct digits. Your three starting intervals should all contain the same root, for example, instead of [0, 1] you could try [0.1, 1]. Be sure to check that the Intermediate Value Theorem guarantees a solution before you start. If you are using the textbook’s code, choose a tolerance TOL that will guarantee 10 correct digits. Report your three solutions, rounded to 10 digits after the decimal point. Do they agree? 2. Let’s try to check your computed root r (or roots, if you got more than one). What is the “checking error†f1(r)? Make a table of 11 nearby numbers (including your r) and their checking errors: x f1(x) r − 5 × 10−10 r − 4 × 10−10 . . . r + 5 × 10−10 When writing down the checking errors, you only need to report a few significant digits in the right side of the table, but be sure to list the exponent. Does the table change your opinion about your best guess of the root? Report your best guess for the root of f1(x) up to 10 decimal places, and underline or highlight the digits you are confident are correct. 3. Repeat Step 1 for the function f2(x) that is obtained by replacing the 5/2 in the function by 7/2. Just as for f1(x), the revised function f2(x) has exactly one root in the interval 0 ≤ x ≤ 1. 4. Repeat Step 2 with f2(x). 5. Summarize any differences between the two cases, f1 and f2. Do you believe you found the root to 10 correct places in both cases? In theory, the Bisection Method gives as much precision as you ask it for. Can you explain any difficulties the Bisection Method is having in practice? Begin your report by stating your conclusions about the five questions above. Save the Matlab code used and your Matlab session, and include these with your report. Save your report as a .pdf file.