Question

2. The function fi(xo.h)= sin(xo +h)- sin(xo) can be transformed into another form. f2(xo,h), using the trigonometric formula

(b) Suggest a formula that avoids cancellation errors for computing the approximation (f(xo +h)- f(xo))/h to the derivative o

2. The function fi(xo.h)= sin(xo +h)- sin(xo) can be transformed into another form. f2(xo,h), using the trigonometric formula + sin()-sin() =2cos sin 2 Thus, fi and f have the same values, in exact arithmetic, for any given argument values xo and h.
(b) Suggest a formula that avoids cancellation errors for computing the approximation (f(xo +h)- f(xo))/h to the derivative of f(x) = sin(x ) at x xo. Write a MATLAB pro- gram that implements your formula and computes an approximation of f'(1.2), for h le-20,le-19,...,1
0 0
Add a comment Improve this question Transcribed image text
Answer #1

IF YOU HAVE ANY DOUBTS COMMENT BELOW I WILL BE TTHERE TO HELP YOU..ALL THE BEST..

AS FOR GIVEN DATA..

code:

clc
clear all
close all
x0=1.2;
h=-20:1:0;
h=10.^h;
f2=@(h) 2*cos((x0+h)/2).*sin((x0-h)/2);
v=f2(h);
fprintf('Values of h\t\tValues of f''(1.2)\n');
for i=1:length(v)
fprintf('%e\t%.17f\n',h(i),v(i));
end

I HOPE YOU UNDERSTAND..

PLS RATE THUMBS UP..ITS HELPS ME ALOT..

THANK YOU...!!

Add a comment
Know the answer?
Add Answer to:
2. The function fi(xo.h)= sin(xo +h)- sin(xo) can be transformed into another form. f2(xo,h), using the trigonom...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2. The function fi(xo,h) = sin(xo+h)-sin(xo) can be transformed into another form., f2(xo,h), using the trigonometri...

    2. The function fi(xo,h) = sin(xo+h)-sin(xo) can be transformed into another form., f2(xo,h), using the trigonometric formula sin()-sin() 2 cos sin Thus, fi and f2 have the same values, in exact arithmetic, for any given argument values xO and h. (a) Derive f2(xo,h). (b) Suggest a formula that avoids cancellation errors for computing the approximation (f(xo +h)- f(xo))/h to the derivative of f(x) sin(x) at x xo. Write a MATLAB pro- gram that implements your formula and computes an approximation...

  • Classes and Methods: A class for estimating the derivative of a function f) at the form: takes wh...

    In Python 3.6 Classes and Methods: A class for estimating the derivative of a function f) at the form: takes where h is a small change in x. The goal of this exercise is to use the formula above to differentinte a mat hematical function f(x) implemented as a Python function f(x) Implement class Diff with two special methods. The--init--() method takes in function object and also an optional argument h. The default value of h is le-4. Implement also...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT