Numerical Analysis Assignment 2 — Root Finding
 Question #1
Consider the function $f=\sin(x)$ with $x$ in radians. Find the root $f=0$ for the initial interval $\frac{1}{2}\pi \le x \le \frac{3}{2} \pi$ using the bisection method. Do so in two different ways:
(a)  By hand, with enough iterations to yield a root accurate to at least 4 significant digits. How many iterations are needed to find a root accurate to at least 4 significant digits?
(b)  With a C code that starts as follows:
 08.30.16
 Question #2
Consider the function $f=\sin(x)$ with $x$ in radians. Find the root $f=0$ for the initial condition $x_0=2.8$ using the secant method. Do so in two different ways:
(a)  By hand, with enough iterations to yield a root accurate to at least 4 significant digits. How many iterations are needed to find a root accurate to at least 4 significant digits?
(b)  With a C code that starts as follows:
 Question #3
Consider the function $f=\sin(x)$ with $x$ in radians. Find the root $f=0$ for the initial condition $x_0=2.8$ using the Newton method. Do so in two different ways:
(a)  By hand, with enough iterations to yield a root accurate to at least 4 significant digits. How many iterations are needed to find a root accurate to at least 4 significant digits?
(b)  With a C code that starts as follows:
 Question #4
 (a) Prove that the order of convergence $p$ of the secant method is 1.618. (b) Verify that the results obtained in Question #2 with the secant method do exhibit an order of convergence of 1.618. Explain why there are discrepancies if applicable.
 Question #5
Knowing that $$|\epsilon_{n+1}|_{\rm Newton}=\left|\frac{1}{2} \frac{f^{\prime\prime}(r)}{f'(r)} \right| |\epsilon_n|^2$$ and $$|\epsilon_{n+1}|_{\rm secant}=\left|\frac{1}{2} \frac{f^{\prime\prime}(r)}{f'(r)} \right|^{1/1.618} |\epsilon_n|^{1.618}$$ Do the following:
 1. Prove that $$\frac{|\epsilon_n|_{\rm Newton}}{|\epsilon_n|_{\rm secant}}=\left( \left|\frac{1}{2} \frac{f^{\prime\prime}(r)}{f'(r)} \right| |\epsilon_0|\right)^{\left(2^n-1.618^n \right)}$$ Note: the latter should be proven fully without skipping steps or making an assumption/simplification. 2. For $|0.5f^{\prime\prime}(r)/f'(r)||\epsilon_0|$ set to 0.3 and 0.03, tabulate the error for $n$ set to 2, 4, and 6. What do you deduce from this?
 10.02.17
 Question #6
Consider the function $f=\sin(x)$ with $x$ in radians. Find the root $f=0$ for the initial condition $x_0=2.8$ using the following iterative method: $$x^{n+1}=x^n - 0.05\frac{f(x^n)}{f'(x^n)} - 0.95\frac{f(x^n)(x^{n-1}-x^{n-2})}{f(x^{n-1})-f(x^{n-2})}$$ Do so in two different ways:
(a)  By hand, with enough iterations to yield a root accurate to at least 4 significant digits. How many iterations are needed to find a root accurate to at least 4 significant digits?
(b)  With a C code that starts as follows:
 10.04.18
 $\pi$