Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Taylor Series Errors All source code is needed in MATLAB In this problem, we approximate f(x) = sin(x) using Taylor series. How many terms in
Taylor Series Errors
All source code is needed in MATLAB
In this problem, we approximate f(x) = sin(x) using Taylor series. How many terms in the Taylor series approximation to f(x) = sin(x) do I need to make sure my error is less than 2 times 10^-8 for x [0, pi/2]? Use the Taylor approximation error, E_n(x) = (x - c)^n + 1/(n + 1)! f^(n + 1) (xi) to derive your answer. If you expand sin(x) around c = 0, then Taylor series will have some zero terms. You should count these terms towards the answer. Write a function called my_sin which takes in two arguments: a number x and a positive integer n. Your function should approximate sin(x) using a Taylor series approximation of order n. The function should return the approximate value. Now we experimentally verify the bound from part (a) in Matlab using your function from part (b). Define a vector x of 100 equally spaced points between [0, pi/2]. For each of these points, compute the error, | sin(x) - my_sin(x, n)|, using two different values of n: n = 3 Value of n that you compute in part (a) Plot the errors for both these values of n against the vector x. Is your error below the bound in part (a) at all these points for the two values of n? In this problem, we approximate f(x) = sin(x) using Taylor series. How many terms in the Taylor series approximation to f(x) = sin(x) do I need to make sure my error is less than 2 times 10^-8 for x [0, pi/2]? Use the Taylor approximation error, E_n(x) = (x - c)^n + 1/(n + 1)! f^(n + 1) (xi) to derive your answer. If you expand sin(x) around c = 0, then Taylor series will have some zero terms. You should count these terms towards the answer. Write a function called my_sin which takes in two arguments: a number x and a positive integer n. Your function should approximate sin(x) using a Taylor series approximation of order n. The function should return the approximate value. Now we experimentally verify the bound from part (a) in Matlab using your function from part (b). Define a vector x of 100 equally spaced points between [0, pi/2]. For each of these points, compute the error, | sin(x) - my_sin(x, n)|, using two different values of n: n = 3 Value of n that you compute in part (a) Plot the errors for both these values of n against the vector x. Is your error below the bound in part (a) at all these points for the two values of nStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started