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:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>

double f(double x){
  double ret;
  ret=sin(x);
  return(ret);
}

int main(void){
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:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>

double f(double x){
  double ret;
  ret=sin(x);
  return(ret);
}

int main(void){
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:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>

double f(double x){
  double ret;
  ret=sin(x);
  return(ret);
}

double dfdx(double x){
  double ret;
  ret=cos(x);
  return(ret);
}


int main(void){
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
Answers
1.  13
Due on Wednesday October 11th at 16:30. Do Questions #1, #4, and #5 only.
Make PDF
$\pi$