Question: Using the definition of a limit, the program to be written will determine the derivative of a quadratic function (form shown below) at any given

Using the definition of a limit, the program to be written will determine the derivative of a quadratic function (form shown below) at any given value of x with an accuracy of 3 decimal places using an iterative process for increasingly smaller values of delta x until the value determined for the derivative does not vary in the first 3 decimal places. The program will output to the user the equation describing the function, the value of x at which the derivative is found, the numerical value of the derivative, and the number of iterations that were required to get the necessary accuracy in decimal places.

The quadratic function the program is to deal with is: f(x) = c1x2 + c2x + c3 The user must be able to enter whatever values desired for the coefficients {c1, c2, c3} and the value for x at which the derivative is to be determined. The steps to take to find the derivative are: 

1) Store values from user for c1, c2, c3, and x. 

2) Calculate f(x) using the values from the user and retain that value in a variable (name of your choosing).

3) Start with delta x = 0.1 and a variable called test Tolerance = 0.001. 

4) Calculate f(x + delta x) using the value of x given by the user and the current value of delta x. 

5) Calculate f'(x) = (f(x + delta x) – f(x))/ delta x using the value calculated in step 2 and step 4 above and the current value of delta x. 

6) If (f'(x) – test Tolerance) < 0.001 then the value calculated for f'(x) is within three decimal places of the correct value for f'(x) and the work is done. 

7) Otherwise, set the new value for delta x to be the old value divided by 2 and set test tolerance equal to the current value of f'(x) and repeat steps 4 through 6.

Remember this is a C++ program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Copyable Code include using namespace std int main float c1 c2 c3 x float deltax 01f floa... View full answer

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 Accounting Questions!