06.09.2021 Views

First Semester in Numerical Analysis with Julia, 2020a

First Semester in Numerical Analysis with Julia, 2020a

First Semester in Numerical Analysis with Julia, 2020a

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 2. SOLUTIONS OF EQUATIONS: ROOT-FINDING 58<br />

In [3]: x=1.319671630859375;<br />

x^5+2x^3-5x-2<br />

Out[3]: 0.000627945623044468<br />

Let’s see what happens if N is set too small and the method does not converge.<br />

In [4]: bisection(x -> x^5+2x^3-5x-2,0,2,10^(-4.),5)<br />

Method did not converge. The last iteration gives 1.3125 <strong>with</strong><br />

function value -0.14562511444091797<br />

Theorem 28. Suppose that f ∈ C 0 [a, b] and f(a)f(b) < 0. The bisection method generates<br />

a sequence {p n } approximat<strong>in</strong>g a zero p of f(x) <strong>with</strong><br />

|p n − p| ≤ b − a ,n≥ 1.<br />

2n Proof. Let the sequences {a n } and {b n } denote the left-end and right-end po<strong>in</strong>ts of the<br />

sub<strong>in</strong>tervals generated by the bisection method. S<strong>in</strong>ce at each step the <strong>in</strong>terval is halved, we<br />

have<br />

b n − a n = 1 2 (b n−1 − a n−1 ).<br />

By mathematical <strong>in</strong>duction, we get<br />

b n − a n = 1 2 (b n−1 − a n−1 )= 1 2 2 (b n−2 − a n−2 )=... = 1<br />

2 n−1 (b 1 − a 1 ).<br />

Therefore b n − a n = 1<br />

2 n−1 (b − a). Observe that<br />

and thus |p n − p| →0 as n →∞.<br />

|p n − p| ≤ 1 2 (b n − a n )= 1 (b − a) (2.3)<br />

2n Corollary 29. The bisection method has l<strong>in</strong>ear convergence.<br />

Proof. The bisection method does not satisfy (2.1) for any C

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!