copyable Code:
%initialize the epsilon value
epsilon=0.5*0.1;
%initialize the x value that is pi/3
x = pi/3;
%assign the approximation value is zero
app= 0;
%set the term, n = 1
n = 1;
%assign the true is cos (x)
t = cos(x);
%print the statement
fprintf(' N True Approximation Abs_Error Approx_Error ')
%check condition in while
while(1)
%assign old approximation is in app
appOld= app;
%find the approximation value
app = app+(-1)^(n-1)*x^(2*n-2)/factorial(2*n-2);
%increment the term
n = n+1;
%formula for find the abs error
ae = abs((t - app)/t)*100;
%formula for find the approx. error
ap_err = abs((app - appOld)/app)*100;
%print the given result in table format
fprintf('%4d %8.4f %8.4f %8.4f %8.4f ',n-1,t,app,ae,ap_err);
%check if appro.error is <= epsilon value
%then it break
if ap_err <= epsilon,
break,
end
end
4.2 The Maclaurin series expansion for cos x is 6 .8 Starting with the simplest version,...
Please show the full steps! 3. Find the MacLaurin series for f(x)cos(). Beginning with the first term of the series, add terms one at a time to estimate cos(.257). a) After adding each term, compute the true and the approximate percent relative errors b) Continue the iterative process of adding one term at a time until the approximate percent relative error falls below an error criterion for 4 significant figures (by hand). 3. Find the MacLaurin series for f(x)cos(). Beginning...
Aer wi rié error and percent relative error. Add terms until the absolute value of the error estimate falls below an error criterion conforming to two significant figures. 3. The following infinite series can be used to approximate ex: e =1+x+ (1.3) 2 3! n! (a) Show that this Maclaurin series expansion is a special case of Taylor expansion with x 0 and h=x (b) Use Taylor series to estimate f(x)=e* at x,=1 for x = 0.20. Employ zero-, first-,...
7. (a) Use the well known Maclaurin series expansion for the cosine function: f (x ) = cos x = 1 x? 2! + 4! х 6! + (-1)" (2n)! . * 8! 0 and a substitution to obtain the Maclaurin series expansion for g(x) = cos (x²). Express your formula using sigma notation. (b) Use the Term-by-Term Integration Theorem to obtain an infinite series which converges to: cos(x) dx . y = cos(x²) (c) Use the remainder theorem associated...
Matlab Help I understand and already did 2a. Need help with the Matlab part (2b). 2. (15 points) The Maclaurin series expansion of sin(x) is given by 3 sin)39 estimate the true value of sin(T/3). Calculate the truncation error (true percent relative error). (error between current and previous estimate) falls below 0.01%. Document the final value, the (a) Use the first three terms in this equation to calculate the value of sin(T/3). Use your calculator to (b) Now write a...
6. If < 1, it is known that Write a function seriesapprox to perform the following tasks. Starting with the simplest approximation 1/ (1-x) 1, add terms one at a time to improve this estimate. After each term is added, compute the absolute error between the approximate and true values. (Use MATLAB to determine the true value.) Continue to add terms until this error is less than 0.0001. Your function must take as the input and must return two output...
can someone help me answer a and b 1 . Use a first through third order Taylor series expansion with starting point, Xi = 0 and h = 1 to estimate the each of the following functions at xi1. Evaluate the error between the true value and the approximate at Xi+-1 for cach expansion. (a) 3x3 +2x2 +x (b) 5x5 + 3x3 + 2x2 + x 1 . Use a first through third order Taylor series expansion with starting point,...
Question 2, non-calculator Question 1, calculator The curve C in the x-y-plane is given parametrically by (x(t), y(t), where dr = t sine) and dv = cos| t The Maclaruin series for a function f is given by r" for 1 sts 6 a) Use the ratio test to find the interval of convergence of the Maclaurin series for f a) Find the slope of the line tangent to the curve C at the point where t 3. b) Let...
Write the Taylor series expansion of cos(x): Use the first three terms to calculate the value of cos(n/4). Use the decimal format with six significant digits (apply rounding at each step). Calculate the truncation error A- B-
π/2 (6 3 cos x) dx 0 (a) Derive the formula for multi-segment (evenly spaced) left-hand rectangles and then use it to approximate the value of the integral with n=1; n-2; n-4 segments. Calculate the true error and relative true error for each (b) Derive the formula for multi-segment (evenly spaced) right-hand rectangles and then use it to approximate the value of the integral with n=1; n=2; n-4 segments. Calculate the true error and relative true error for each (c)...
The cosine function can be evaluated by the following infinite series as (where the angle x is given in radians) cos x =1--+ + 2! 4! 6! Create a second function M-file mycos that takes the angle x (in radians), and returns cos(x) with an absolute iterative error less than 1.0e-18. Test your function to find cosine of ?/2 and 2? Display the Expansion order, and the actual error (absolute error, not the relative one) and iterative error using fprintf...