# How do I derive the resultcos x=1-x^2/2!+x^4/4...+(-1)^nx^2n/(2n)!+R(x) ?Please if possible provide as many details as you can cause i don't understand a lot of math

*print*Print*list*Cite

### 1 Answer

This is a Taylor series expansion of the cosine function cos(x).

Taylor's Theorem tells us that we can expand a function about a value `x=a` by writing it as an infinite series (infinite sum of terms). It says that

`f(x) = f(a) + (x-a)f'(a) + (x-a)^2/(2!) f''(a) + ... + (x-a)^(2n)/(2n!)f^(2n)(a) + R(x)`

where `f'(x)` is the derivative of `f(x)` and `f''(x)` is the second derivative of `f(x)` and so on. `R(x)` is also an infinite sum of terms.

A special case of the Taylor series is when we expand about `x=0`, This is called the Maclaurin series. Then

`f(x) = f(0) + xf'(0) + x^2/(2!)f''(0) + x^3/(3!)f'''(0) + x^4/(4!)f''''(0) + ... + x^(2n)/(2n!) f^(2n)(0)`

`+ R(x)`

For the cosine function `f(x) = cos(x)`

`f'(x) = -sin(x)` , `f''(x) = -cos(x)`, `f'''(x) = sin(x)`, `f''''(x) = cos(x)` (this forms a cycle)

And `f(0) = 1`, `f'(0) = 0`, `f''(0) = -1`,` ` `f'''(0) = 0`, `f''''(0) = 1`

(pattern is 1,0,-1,0,1,0,-1,0,1 ...)

Now we have that

`f(x) = 1 + 0.x + (-1)x^2/(2!) + 0.x^3/(3!) + (1)x^4/(4!) + ... + x^(2n)/(n!)f^(2n)(0) + R(x)`

`= 1 - x^2/(2!) + x^4/(4!) + ... + x^(2n)/(n!)f^(2n)(0) + R(x)`

Now, `2n` is always even, and on the even terms of the series (involving even powers of x)`f^(2n)` is -1 if n is odd and 1 if n is even. So `f^(2n) = (-1)^n` . For odd terms of the series `f^(2n+1) = 0` so all terms in odd powers of x are zero.

Writing functions in this way is useful because we can approximate them by only the first few terms of the sum. This can give very good approximations and is used widely in practical maths.

**Expand the function cos(x) as a Maclaurin series**