Question

4.2 The Maclaurin series expansion for cos x is 6 .8 Starting with the simplest version, cos -I, add terms one at a time to e

0 1
Add a comment Improve this question Transcribed image text
Answer #1

Solution Code: alize the epsilon value %initialize the x value that is pi/3 x = pi/3; %assign the approximation value is zero%check if appro. error is <-epsilon value %then it break If ap err <= epsilon, break, end end Sample Output: $octave -qf no-w

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

Add a comment
Know the answer?
Add Answer to:
4.2 The Maclaurin series expansion for cos x is 6 .8 Starting with the simplest version,...
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
  • 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...

    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...

    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 )...

    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....

    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...

    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...

  • 1 . Use a first through third order Taylor series expansion with starting point, Xi = 0 and h = 1...

    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 give...

    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...

    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 rectangle...

    π/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)...

  • Matlab Question Only do parts c, d, and g. Parts a and b are for reference....

    Matlab Question Only do parts c, d, and g. Parts a and b are for reference. This is a Matlab Question (Multipart-I already got someone to do a and b but they said I need to use another one of my questions to get c,d and g answered). The Maclaurin series expansion for e^x is e^x=1 + x/1! + x^2/2! + x^3/3! +x^4/4!... and it can be expressed in summation form as e^x = x^(k-1)/((k-1)!) The MATLAB function [exVal]=findEX(x,n) shown...

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