#include #include #include using namespace std; double f(double x){ return (6435.0*pow(x,8)-12012.0*pow(x,6)+6930.0*pow(x,4)-1260.0*pow(x,2)+35)/128.0; //return x*x-2.0*x-2.0; } double fp(double x){ return (6435.0*8.0*pow(x,7)-12012.0*6.0*pow(x,5)+6930.0*4.0*pow(x,3)-1260.0*2.0*x)/128.0; //return 2.0*x-2.0; } int main(int argc, char** argv) { double xOld,xNew,xL,xR; double Tol,Error,LT,RT; int i; cout<<"Enter xL:"<>xL; xOld=xL; cout<<"Enter xR:"<>xR; cout<<"Enter Tolerance:"<>Tol; i=0; do{ LT=(xOld-xL)*fp(xOld)-f(xOld); RT=(xOld-xR)*fp(xOld)-f(xOld); i++; if((LT*RT)<0.0){ //We do Newton-Raphson xNew=xOld-(f(xOld)/fp(xOld)); cout<<"Newton-Raphson i= "<