Home /
Expert Answers /
Computer Science /
help-with-qb-in-python-4-the-n-th-order-taylor-series-approximation-to-cosine-is-given-by-pa819
(Solved): help with Qb in python
4. The \( n \)-th order Taylor-series approximation to cosine is given by \[ ...
help with Qb in python
4. The \( n \)-th order Taylor-series approximation to cosine is given by \[ T_{n}=\sum_{k=0}^{n} \frac{(-1)^{k}}{(2 k) !} x^{2 k} \] 2 because \( \cos (x)=\lim _{n \rightarrow \infty} T_{n} \). In this problem you will calculate the third-order Taylor-series approximation, i.e., \[ T_{3}=\sum_{k=0}^{3} \frac{(-1)^{k}}{(2 k) !} x^{2 k}=1-\frac{x^{2}}{2}+\frac{x^{4}}{4 !}-\frac{x^{6}}{6 !} \] (a) Create the array \( \mathrm{x} \) with 100 equally spaced points in the interval \( [-\pi, \pi] \). Save that array to the variable A13. (b) Use a for loop to calculate the third-order Taylor-series approximation to cosine using the sum formula above. You should not be writing each term, instead use a for loop to calculate the sum! Save the result, an array with 100 elements, to the variable A14.