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
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
Step: 1
Copyable Code include using namespace std int main float c1 c2 c3 x float deltax 01f floa...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started