Write a Matlab script to calculate the following Taylor series expansion: tan^-1
ID: 3011271 • Letter: W
Question
Write a Matlab script to calculate the following Taylor series expansion: tan^-1 x = x - x^3/3 + x^5/5 - x^7/7 + x^9/9 = ... = sigma_n = 1^infinity (-1)^(n - 1) x^2n - 1/2n - 1 sigma_n = 0^infinity (-1)^n x^2n + 1/2n + 1 x [-1, 1] a) The code shall include the calculation of the true relative error, while the format long will be used for calculating tan^-3 (0.5) by Maltab as the true solution. Compare the solution for n = 5 with the solution of n = 10 by calculating the ratio of the two solutions. b) Plot the function y = tan^-1 (x) for -1Explanation / Answer
Ans-
return
which is all the terms up to, but not including, order eight in the Taylor series for f(x):
Technically, T is a Maclaurin series, since its expansion point is a = 0.
The command
prints T in a format resembling typeset mathematics:
These commands
generate the first 12 nonzero terms of the Taylor series for g about x = 2.
t is a large expression; enter
to find that t has about 100,000 characters in its printed form. In order to proceed with using t, first simplify its presentation:
Next, plot these functions together to see how well this Taylor approximation compares to the actual function g:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.