Question: Project In the Calculus we study the Newton - Raphson method for solving equations. This technique uses the value of a function and its derivative

Project In the Calculus we study the Newton-Raphson method for solving equations. This technique uses the value of a function and its derivative to estimate where the function crosses the x axis. If necessary it repeats the process until the amount of change in the estimate is smaller than some predetermined amount.
The formula is
xn+1=xn-f(xn)f'(xn)
You will write a program that uses a recursive function to perform this operation estimating where a function crosses the x -axis.
Methodology
Prompt the user for the mathematical function that you want to solve.
Prompt the user for the starting value. Call this 0.
Call the get_zero function. You will pass the function and the starting value for the zero of the function. The function will return a new value for the zero.
In the get_zero function you will set a stopping criteria. Call this eps. It should be a small value, say eps =0.001. This is done first, before the calculations or the selection.
Then calculate a value for x by evaluating the function and an estimate of the derivative at x. Use the derivative function that you wrote for project 6.
Compare |f(x)| to eps. This would be if(abs(f(x)
If |f(x)|> eps then call x= get_zero(f,x from the selection structure. You pass the same function and the same variable, but the current x contains the new predicted value for the intercept.
If If |f(x)| eps the function returns the calculated intercept value.
Call print_results to show the function, the starting value, and the estimated zero. An example of what the output might look like is
\table[[Function,Start,Zero],[x.???2-7,3,2.6459]]
Call the plot function to see the results graphically
You may create any function to integrate that you would like. I suggest that you start with simple curves to allow you to check that your results are accurate. Just be sure to choose a function that does cross the x-axis. As an example, try x2-2. The correct result will be 22. Remember that every program that you submit must include an introduction consisting of your name, the date, and a description of the program as both comments at the beginning of
the program and as text that is printed when you call print_header function. The program must implement top-down design in that you should be using functions through out your code.
Project In the Calculus we study the Newton -

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!