Question: Problem asks to calculate the 2nd derivative of a function at x=1, and different values of dx. Compare the results with exact solution, i.e. 28
Problem asks to calculate the 2nd derivative of a function at x=1, and different values of dx. Compare the results with exact solution, i.e. 28
I used the below code to compute the derivative at different values of dx. However, the output is always equal to the exact solution. What am i doing wrong?
MATLAB code
dx = 0.1;
x = 1;
exact = 28;
double f;
f = [(5+10*(x+dx)-4*(x+dx).^2+6*(x+dx).^3)-2*(5+10*x-4*x.^2+6*x.^3)+(5+10*(x-dx)-4*(x-dx).^2+6*(x-dx).^3)]/[dx.^2]
2.13
Determine the effect of varying x on the computed result for
the second derivative, as given in Problem 2.9, for the function
f(x) = 5 + 10x - 4x2 + 6x3. The second derivative is to be determined
at x = 1. Using a computer or a calculator, calculate the second derivative
at x = 1 with x = 0.5, 0.1, 0.05, and 0.01. Compare the results
obtained with the exact value of 28.
2.9
2f/x2 = [ f(x + x) 2f(x) + f(x x)]/(x)2,
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
