Question
PYTHON Evaluating a more complex function. In your own code, come up with four more complex functions (not a polynomial e.g. use sin/cos/tan/exp/log/powers/etc.), that you
PYTHON
Evaluating a more complex function.
In your own code, come up with four more complex functions (not a polynomial e.g. use sin/cos/tan/exp/log/powers/etc.), that you do not know how to compute the derivative for analytically, but that you can evaluate. For each function, using the same process as in part (b), calculate the derivative of that function at some value. Write a line of output describing each function, and stating what the computed derivative for it is, along with the number of steps needed to compute the derivative.
Here is My code from the previous part, if there are any corrections needed please tell me.
A = float(input('A: ')) B = float(input('B: ')) C = float(input('C: ')) D = float(input('D: ')) count = 2 x = float(input()) a = .1 fx = ((A*(x + a)**3 + B*(x+a)**2 + C*(x+a) + D) - (A*(x)**3 + B*(x)**2) + C*x + D ) / a a = a/2 fx2 = ((A*(x + a)**3 + B*(x+a)**2 + C*(x+a) + D) - (A*(x)**3 + B*(x)**2) + C*x + D ) / a while (fx - fx2) > 10**-6: fx = fx2 a = a/2 fx2 = ((A*(x + a)**3 + B*(x+a)**2 + C*(x+a) + D) - (A*(x)**3 + B*(x)**2) + C*x + D ) / a count += 1 print(fx2) print(count) print(fx - fx2)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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