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.
Answers
1.  13
08.29.17
Make PDF
$\pi$