Question: The first derivative df(x)/dx of a function f(x) at a point x = x0 can be approximated with the two-point central difference formula: df(x)/dx =
df(x)/dx = f(x0 + h)-f(x0 - h)/2h
where h is a small number relative to x0. Write a user-defined function (see Section 7.9) that calculates the derivative of a math function f(x) by using the two-point central difference formula. For the user-defined function name, use dfdx = Funder (Fun, x0), where Fun is a name for the function that is passed into Funder, and x0 is the point where the derivative is calculated. Use h = x0/100 in the two-point central difference formula. Use the user-defined function Funder to calculate the following:
(a) The derivative of f(x) = x3e2x at x0 = 0.6
(b) The derivative of f(x) = 3x/x2 at x0 = 2.5
Step by Step Solution
3.51 Rating (171 Votes )
There are 3 Steps involved in it
Script file disp dispPart a Funcx x3exp2x dxd... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
652-B-F-F-M (759).docx
120 KBs Word File
