Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1.7. (a) Write a program to compute an approx- imate value for the derivative of a function using the finite-difference formula Test your program using

image text in transcribed

image text in transcribed

1.7. (a) Write a program to compute an approx- imate value for the derivative of a function using the finite-difference formula Test your program using the function tan(x) for x = 1, Determine the error by comparing with the square of the built-in function sec(x). Plot the magnitude of the error as a function of h, for h = 10-K, k = 0, . . . , 16, You should use log scale for h and for the magnitude of the error. Is there a minimum value for the magnitude of the error? How does the corresponding value for h compare with the rule of thumb h ~ Vmach derived in Example 1.3? (b) Repeat the exercise using the centered differ- ence approximation

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

Write a short note on rancidity and corrosiveness.

Answered: 1 week ago