Question: The derivative of a function, f(x), can be computed using the finite difference method, which can be derived using the first-order terms of the Taylor

 The derivative of a function, f(x), can be computed using the

The derivative of a function, f(x), can be computed using the finite difference method, which can be derived using the first-order terms of the Taylor series expansion of the function, about xo: f(xo +h) = f(xo) + hf'(xo) + zif"(x0) + f"(xa)"(%) ? + 2.1 1 Rearranging terms to solve for f'(xo and ignoring the hig r-order terms, we obtain the first order approximation of derivative f(xo + h) f(xo) f'(x) h 2.2 TT a) Implement the function using the structure given below to compute the derivative of sin(x). Use this function to compute the derivative of the sin(x) at Xo = function der = dydx (x0) % this fucntion computes the derivative of sinx (x) % YOUR CODE GOES HERE. end TT b) In this part, we will implement the code to compute the derivative of sin(x) at Xo = using the divided differences formula shown in equation (2.2). What is the expression for truncation error? Use the provided script (dydx_approx.mlx), implement the divided difference formula and the truncation error. Include plot of the absolute error and the truncation error vs h in your report. Explain the why the error is smooth of the error for large values of h while it is erratic for small values of h. The derivative of a function, f(x), can be computed using the finite difference method, which can be derived using the first-order terms of the Taylor series expansion of the function, about xo: f(xo +h) = f(xo) + hf'(xo) + zif"(x0) + f"(xa)"(%) ? + 2.1 1 Rearranging terms to solve for f'(xo and ignoring the hig r-order terms, we obtain the first order approximation of derivative f(xo + h) f(xo) f'(x) h 2.2 TT a) Implement the function using the structure given below to compute the derivative of sin(x). Use this function to compute the derivative of the sin(x) at Xo = function der = dydx (x0) % this fucntion computes the derivative of sinx (x) % YOUR CODE GOES HERE. end TT b) In this part, we will implement the code to compute the derivative of sin(x) at Xo = using the divided differences formula shown in equation (2.2). What is the expression for truncation error? Use the provided script (dydx_approx.mlx), implement the divided difference formula and the truncation error. Include plot of the absolute error and the truncation error vs h in your report. Explain the why the error is smooth of the error for large values of h while it is erratic for small values of h

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!