Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. (20 pts.) Let f(x) = sin(x) cos(x). (a) Construct MATLAB functions to approximate the derivative of f(x) using the following three formulae: h Di

image text in transcribed
2. (20 pts.) Let f(x) = sin(x) cos(x). (a) Construct MATLAB functions to approximate the derivative of f(x) using the following three formulae: h Di [f(x)) = f(x+h) f(x) D2 [F()) f(x + h) f (x h) 2h _ -f(x + 2h) + 4f(x + h) 3f (:) 2h Each of your MATLAB functions should accept 2 and h as arguments and produce an approximate derivative as output. Also construct a separate MATLAB function to evaluate the exact derivative f'(x). (b) Using your MATLAB functions, calculate the relative errors for the approximate deriva- tives at the points x = 0 and x = 0.6. Use values of h given by h = 10-d where d = 1, 2, ..., 10. For each value of x, create a table of results with the headings h, D1error, D2error, and D3error. (c) Provide an explanation of the various behaviors that you observe. Hint, look at the values of h where each approximation yields the most accurate result

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The World Wide Web And Databases International Workshop Webdb 98 Valencia Spain March 27 28 1998 Selected Papers Lncs 1590

Authors: Paolo Atzeni ,Alberto Mendelzon ,Giansalvatore Mecca

1st Edition

3540658904, 978-3540658900

More Books

Students also viewed these Databases questions

Question

5-8 What are the advantages and disadvantages of the BYOD movement?

Answered: 1 week ago