# Newton’s method to approximate a root of a (differentiable) function f(x) involves an iteration of the form

Summer II 2021 MATH 9 Midterm II Sep 8, 2021

You have 24 hours to take this 50 points midterm. Books and notes are allowed. You can not use internet while you are taking your midterm. Create a MATLAB script in an m-file and then executing the file. Name this file MidtermII YourName.m. All commands should be followed by a semi-colon ”;” so that when the script is run, no mid-step gets displayed to the screen. To receive full credit, you must use exact variables names given below, and you must not have any terms getting printed to the screen. The screen only shows the final answer for each problem.

Just \$7 Welcome

1. (10 points) Draw this graph [Hint: Hue and Hue are red]

-10 -5 0 5 10 -10

-5

0

5

10

x

y

Title

2. (10 points)

(a) Use Sum to compute

10000∑ n=1

1

n .

(b) Find all values of K such that

9 ≤ K∑

n=1

1

n ≤ 10

3. (10 points) (a) Make a Table representing 100 rolls of rolling three 6 sided dices. (b) What is the expected value of the total (sum) of the three?

4. (10 points) Make a 1 × 3 Disk, expected output (no “{ }”):

5. (10 points) Newton’s method to approximate a root of a (differentiable) function f(x) involves an iteration of the form

xn+1 = xn − f(xn)

f′(xn)

(a) Define the function x3 −x + 1 in Mathematica. Plot the function between −2 and 2. (b) Use NestList to apply Newton’s method three times to the starting value of x = −0.8.

The result should be {−0.8,−2.2,−1.64911,−1.39267}. (c) Use NestWhileList to continue applying Newton’s method starting at x = −0.8 and

stopping when we reach a value of x such that |x3 −x + 1| < 0.00001. The result should be {−0.8,−2.2,−1.64911,−1.32866,−1.32473,−1.32472}.