Question: You are given the following function: And its derivative: f(x) = log10 (x0) dx f(x) x 30 10 X In(10) * x 15 1.
You are given the following function: And its derivative: f(x) = log10 (x0) dx f(x) x 30 10 X In(10) * x 15 1. Define a python function that will return the above f(x) for a given value of x. Show that your function correctly calculates f(x) by comparing with results from your calculator for your own choice of examples. Do the same for the derivative. 2. Plot f(x) and its derivative along the range between and including 0.5 and 20.5. Label both your axes, add a meaningful legend, and use a black continuous line for the f(x), and a dashed red line for its derivative. 3. Use Python to find both of the two roots of this function using Newton's method with an initial reasonable guess and tolerance of your choosing. Explain your choice of initial guesses for each root, and your choice of tolerance. Suggest I value of x which would have been a poor starting guess, and explain why this x value would have been a bad choice. 4. Using Python and your own code, integrate f(x) between x = 1.00783 and x = 19.70761 using the trapezoidal rule with 10, 100, and 1000 segments. Compare your results with the correct solution of 88.8595 and discuss the effect of number of segments on accuracy.
Step by Step Solution
There are 3 Steps involved in it
Heres a Python solution for the tasks you described Task 1 Define Python Functions def fx return 35 ... View full answer
Get step-by-step solutions from verified subject matter experts
