{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Fall2011-HW2-soln - [4 6 Table Approximation p n and...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 2 Solutions Math 371, Fall 2011 Page numbers in the International Edition are +12. Here is an example of two MATLAB scripts which, together, allow you to pass a pass a function into your code. This allows you to reuse your code for other functions. Program 1 function p=myfun(x), p=1/x-cos(x); return Program 2 function p=bisection(myfun, a, b, nmax), for n = 1 : nmax, p(n) = (a+b)/2; if(feval(myfun,p(n))*feval(myfun,a) < 0 ), b=p(n); else a=p(n); end end 1. (Rootfinding and Optimization) (a) Suppose f ( x ) is differentiable on [ a, b ] . Discuss how you might use a rootfinding method to identify a local extremum of f ( x ) inside [ a, b ] . Roots of the derivative give possible locations of local extrema. (b) Let f ( x ) = log x - sin x . Prove that f ( x ) has a unique maximum in the interval [4 , 6] . (Note that log means natural logarithm.) f (4) > 0 , f (6) < 0 , and the continuity of f ( x ) give the existence of at least one maximum. f ( x ) < 0 for x [4 , 6] shows the maximum is unique. (c) Approximate this local maximum using six iterations of the Bisection method with starting interval
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: [4 , 6] . Table: Approximation p n and absolute error | p n-p | versus iteration number n in Bisection method 1 n p n | p n-p | 5.0000000 0.0828141 1 4.5000000 0.4171859 2 4.7500000 0.1671859 3 4.8750000 0.0421859 4 4.9375000 0.0203141 5 4.9062500 0.0109359 6 4.9218750 0.0046891 2. (Order of Convergence) Apply the theorems on pp. 90-91 to the following problems: (a) Section 2.3 #8 g ( √ a ) = √ a . The conditions of the theorem on page 91 hold. g Í ( √ a ) = 0 but g Í ( √ a ) Ó = 0, so α = 2 and the asymptotic error constant is 1 / 2 √ a . (b) Section 2.3 #9 g ( √ a ) = √ a . The conditions of the theorem on page 91 hold. g Í ( √ a ) = g Í ( √ a ) = 0, but g Í ( √ a ) Ó = 0. Thus α = 3 and the asymptotic error constant is 1 / 4 a . 2...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern