Question: We use f ( x ) = 1 - x 2 2 to approximate the function c o s ( x ) . [ MATH

We use
f(x)=1-x22
to approximate the function cos(x).[MATH3800W24A1-10189572]
a.(2 points) Use MATLAB to plot f(x) and cos(x) over xin[0,0.5135] in the same plot.
b.(2 points) Use MATLAB to estimate
max{|f(x)-cos(x)|:xin[0,0.5135]}
by computing the maximum over x in a grid of 245 equidistant points in the given interval.
c.(3 points) Compute in MATLAB both the forward error and backward error at x=0.2452. Use sprintf to format your output string so that they look like the following with at least 8 decimal places:
Forward error is -0.00002342
Backward error is 0.00013492
 We use f(x)=1-x22 to approximate the function cos(x).[MATH3800W24A1-10189572] a.(2 points) Use

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!