PROBLEM 1. Find root of 3 y = x - x - 1 to 3 decimals or more. 2 y' = 3 x - 1 Initial plot: y(-2) = -7, y(-1) = y(0) = y(1) = -1, y(2) = 5 so it looks like the root is somewhere between x=1 and x=2 (since y changes sign from -1 to +5, so must cross 0 somewhere in there). So, try x=1.5 as initial guess in NEWTON'S UPDATE RULE: 3 y(x) x - x - 1 x = x - ----- = x - --------- New y'(x) 2 3 x - 1 First try: x=1.5. y(x)=y(1.5)=0.875. y'(x)=3*1.5*1.5-1=3*2.25-1=5.75. Next: x=1.5 - 0.875/5.75 = 1.347826087. y(x) = 0.10068. y'(x)=4.4499. Next: x=1.347826087 - 0.10068/4.4499. y(x) = 0.0020584. y'(x)=4.26847. =1.325200399 = ANSWER (good enough for 3 decimals) Next: x=1.325200399 - 0.0020584/4.26847 y(x) = 0.000000924 =1.324718174 = BETTER ANSWER (good enough for 6 decimals) Next: x=1.324717957245 = even better answer, all 12 decimals correct. PROBLEM 2. -2 -1/2 A. The root of y = b - x is x = b = 1 / SquareRoot(b). 3 B. Newton's update rule is x = x - y(x)/y'(x) = 1.5 x - 0.5 b x New where I have simplified the initial formula -2 b - x 3 3 x = x - ------- = x - (b/2) x + x/2 = 1.5 x - 0.5 b x New -3 2 x 2 = x + 0.5 [1 - b x ] x to forms in which NO DIVISIONS are used. SANITY CHECK: If x=1/SquareRoot(b), then Newton update stays there! C. Using this Newton formula repeatedly to improve an initial guess, you will compute Q = 1/SquareRoot(b) (if b>0) very accurately. Now you can compute a division via a/b = a Q Q (via 2 more multiplications) without ever doing a division! Also you can compute SquareRoot(b) = Q b (via 1 more multiplication) without ever doing a division! PROBLEM 3. 2 The volume of a cone of height H and base-radius r (base area B = Pi r ) is 2 V = B H / 3 = Pi r H / 3 (book, frontspiece). If V=1, then 2 H = 3 / (Pi r ) by solving for H. The cone's surface area is 2 2 1/2 S = 2 Pi r (r + H ). THE GOAL IS TO MINIMIZE S BY CHOICE OF r. If we substitute our expression for H into S, we get a formula for S in terms of r ONLY (hope you like my artful parentheses...) / 2 9 \1/2 S(r) = 2 Pi r |r + ------| | 2 4| \ Pi r / which is good since now we can try to MINIMIZE S by choice of r. The best r has to be a critical point, meaning somewhere where S'(r)=0 or at an endpoint (r=infinity or r=0). Because S(0)=S(infinity)=infinity, these endpoints are not best, they are worst. So the answer to be where S'(r)=0. So we differentiate using product rule and power-1/2 rule and chain rule to get / 36 \ Pi r |2 r - ------| | 2 5| / 2 9 \1/2 \ Pi r / S'(r) = 2 Pi |r + ------| + ------------------- | 2 4| / 2 9 \1/2 \ Pi r / |r + ------| | 2 4| \ Pi r / which we can simplify by putting it over a common denominator and multiplying both top and bottom by powers of Pi and r... 6 2 2 r Pi - 9 S'(r) = 2 ------------------ 2 6 2 1/2 r (r Pi + 9) Now this can be 0 if and only if the top is 0, which happens when 6 2 6 2 1/3 (-1/6) 2 r Pi = 9 so r = 9 / (2 Pi ) so r = (3/Pi) 2 = 0.8773. THIS IS THE ANSWER(r). 2 Now since we know (from before) that H = 3 / (Pi r ) we have 1/3 H = (6/Pi) = 1.2407. THIS IS THE ANSWER(H). SANITY CHECK: compute the surface area S(r) with this r = 0.8773. We get: S(.8773) = 8.376155900 <-- supposed to be the MIN S(.8776) = 8.376157756 slightly larger r ==> S larger S(.8770) = 8.376157960 slightly smaller r ==> S larger [If S had gotten smaller than the "min," we'd know min was insane! Even if you were clueless you could plot S(r) and try to locate the min approximately...] PROBLEM 3 (A LOT EASIER SOLUTION): A trick which makes it a lot easier is, do not minimize surface area S(r), instead minimize the SQUARE of the surface area, which I will call SS(r) = S(r) S(r). You are going to get the same magic r either way, but it is easier to do it with SS(r) than with S(r). Because: 2 2 / 2 9 \ 2 4 36 SS(r) = 4 Pi r |r + ------| = 4 Pi r + ---- | 2 4| 2 \ Pi r / r is easy to differentiate: 2 3 -72 SS'(r) = 16 Pi r + ------ 3 3 -3 r (I have used 1/r = r , then done the power rule for differentiation with the power being -3.) Next step: find the critical point r, where SS'(r)=0. 2 2 -72 SS'(r) = 16 Pi r + ------ = 0 4 r 4 means (after multiplying by r on both sides) 2 6 16 Pi r = 72 2 1/6 -2 1/6 so r = (72 / [16 Pi ]) = (9 Pi /2 ) = 0.8773 and now we find H as before. PROBLEM 4. sin(x)= 1 so tan(x) always runs faster than x and they both start at 0 since tan(0)=0. This only works in (0, Pi/2) since tan(x) has a jump discontinuity (infinity to -infinity) at x=Pi/2.