Numerical Methods The function x 2 cos52 2 cos42 6 cos3r

Numerical Methods

The function /(x) = 2 cos(52) + 2 cos(42) + 6 cos(3r) + 4 cos(2x) + 10 cos(x) + 3 has two roots on the interval [0,3; one root is near 1 and the other near 2. (i) Use Newton\'s method rn+g) with ro1 and also with zo2 to approximate these two roots. Use the fact that the exact roots are /3 and 2n/3 to compute the error en at each iteration for n 0,1,. , 18 (ii) Use the method xn +1 = h(2n) with 20-1 and again also with 20 2 to approximate these two roots. Again use the fact that the exact roots are /3 and 2n/3 to compute the error en at each iteration for n = 0,1,… , 18 iii) Comment on the rate of convergence and the effects of rounding error in the above two computations

Solution

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
  
if(a[i]>0)
  

if(d[i]>0)
printf(\" + \");
else if(d[i]<0)
printf(\" - \");
else
printf(\" \");
printf(\"%dx^%d\",d[i],i-1);
}
getch();
}
#include <stdio.h>
#include <stdlib.h>

typedef struct polynomial Polynomial;

void init_poly(Polynomial *p)

void print_poly(Polynomial *p)
p->coefficient[p->order--] = 0;
}

void r_print_differential_poly(Polynomial *p)
}

int main(void)

Numerical Methods The function /(x) = 2 cos(52) + 2 cos(42) + 6 cos(3r) + 4 cos(2x) + 10 cos(x) + 3 has two roots on the interval [0,3; one root is near 1 and t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site