Using the definition of a limit, the program to be written will determine the derivative of a
Question:
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.
Intermediate Accounting
ISBN: 978-0324592375
17th Edition
Authors: James D. Stice, Earl K. Stice, Fred Skousen