/*
MAE 9:
Homework #6, Fall 2006
Due on Thursday, November 2nd, before 9:00 pm
Print a blank (empty) line, a line with the message:"Homework 6:", and a
blank line.
In order to find roots for f(x) = x*x*x  x*x 9.0*x + 8.9 in the interval
1.0 <= x <= 5.0, create a table for x and f(x) from x=1.0 to x=5.0 with
an increment of del_x=0.25. Mark the intervals with 'Y' where f(x) changes
sign. In the table, use %8.2f and %12.4f for printing values of x and
f(x).
In each interval where f(x) changes sign, use the midpoint value of x as
an initial guess x0 for the NewtonRaphson method, obtain refined roots
and print each root with %12.6e. Use double Newton_Raphson(double x0)
that gives a refined root for an initial guess of x0. (You are not allowed
to modify double Newton_Raphson().)
You need to write the following functions:
double func1(double x)
for f(x)
= x*x*x  x*x 9.0*x + 8.9;
double func1_d(double x) for f'(x) = 3.0*x*x  2.0*x  9.0;
.......................................................................
Your output for the quiz should look like this:
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '07
 Lubarda
 ........., Rootfinding algorithm

Click to edit the document details