
Kenneth S. answered 10/10/16
Tutor
4.8
(62)
Expert Help in Algebra/Trig/(Pre)calculus to Guarantee Success in 2018
This is a programming question. You have to think about how calculate each term, based on the prior term, and you must also think about how to end the series. One way to terminate the series is to just say you'll compute 5 terms. A more sophisticated way might be to compare each partial series sum to the prior series sum, and decide to stop if the difference between successive approximations is < a certain agreed accuracy, i.e. within 0.000001.
Each term can be computed from its prior term by multiplying prior term by -x2 ÷ (n•(n-1)) where your program manages "n" by increasing it by 2 for each successive term.
A further sophistication is that, since the infinite series involved is good for any Real x (measured in radians2, the argument x value can be pre-treated by dividing by by two pi and keeping only the remainder, after taking absolute value of x (since cosine is an EVEN function).