Question: USE MATLAB TO SOLVE THIS PROBLEM 2. The Taylor Series expansion for cos (x) and the first 6 terms are: r8 f(x) = cos(x) =
USE MATLAB TO SOLVE THIS PROBLEM
2. The Taylor Series expansion for cos (x) and the first 6 terms are: r8 f(x) = cos(x) = { (-1) - x2n (2n)! 1- x2 r4 + 2! 4! + 6! r10 + ... 10! 8! n=0 NOTE: Use help factorial to learn how to calculate terms 2 through 6. HINT: Create separate variables (TScos3, TScos4, TScos5, & TScos) for the equations using 3,4,5, or 6 terms. a. b. In Figure 4, plot () the function cos (x), AND the Taylor Series expansion of cos(x) with 3 terms, AND the Taylor Series expansion of cos(x) with 4 terms between - SxSr. Plot the function cos(x) as a solid black line with a Linewidth of 2. Plot the Taylor Series expansion of cos(x) with 3 terms as a magenta dashed line and the Taylor Series expansion of cos(x) with 4 terms as a red dotted line with Linewidth of 2. Include the following title in bold face: "cos (x) and Taylor Series cos(x) from - sxs it. Include a descriptive legend and axis labels (x as 'x' & y as f (x) '). Add grid lines. All formatting must be coded. (6 Points) In Figure 6, subplot() cos(x), the Taylor Series expansion of cos(x) with 6 terms, and the Taylor Series expansion of cos(x) with 5 terms over the interval 0 sxs 2n in 3 separate subplots arranged in a single column. Include the following title in bold face above the top-most plot: cos (x) and Taylor Series cos(x) from 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
