# What is the Taylor series for cosx centered around x = pi?

Apr 6, 2017

The general formula for a Taylor series is:

f(x) = sum_(n=0)^(oo) (f^((n))(a))/(n!)(x-a)^n

where ${f}^{\left(n\right)} \left(a\right)$ is the $n$th derivative of $f$ defined at $x = a$. Thus, it makes sense to take some derivatives when finding the Taylor series.

${f}^{\left(0\right)} \left(x\right) = f \left(x\right) = \cos x$

$f ' \left(x\right) = - \sin x$

$f ' ' \left(x\right) = - \cos x$

$f ' ' ' \left(x\right) = \sin x$

$f ' ' ' ' \left(x\right) = \cos x$

etc.

Therefore, the Taylor series centered at $x = a$ is:

= (f(a))/(0!)(x-a)^0 + (f'(a))/(1!)(x-a)^1 + (f''(a))/(2!)(x-a)^2 + (f'''(a))/(3!)(x-a)^3 + (f''''(a))/(4!)(x-a)^4 + ...

But $\sin \left(\pi\right) = 0$, so for all odd derivatives, the term vanishes. Thus, we get:

= cospi + cancel((f'(a))/(1!)(x-a)^1)^(0) + (-cospi)/(2!)(x-pi)^2 + cancel((f'''(a))/(3!)(x-a)^3)^(0) + (cospi)/(4!)(x-pi)^4 + ...

$= \textcolor{b l u e}{- 1 + \frac{1}{2} {\left(x - \pi\right)}^{2} - \frac{1}{24} {\left(x - \pi\right)}^{4} + . . .}$

Generalizing this...

• We have that the series alternates sign, so we include a ${\left(- 1\right)}^{n}$ term somewhere...
• We also have the ${\left(x - \pi\right)}^{n}$ term, obviously, but we specify even $n$ to ignore the odd terms (which are zero), so we can use $2 n$.
• We have a negative sign out front, since the first term in a Taylor series tends to be $1$.
• We would have to specify even $n$ for the factorial terms, so the factorial terms go as (2n)!, i.e. 0!, 2!, 4!, etc.

So, our instinct gives us a series representation as:

sum_(n=0)^(oo) -((-1)^(n)(x-pi)^(2n))/((2n)!)

= color(blue)(sum_(n=0)^(oo) ((-1)^(n+1)(x-pi)^(2n))/((2n)!))

= ((-1)^(0+1)(x-pi)^(2*0))/((2*0)!) + ((-1)^(1+1)(x-pi)^(2*1))/((2*1)!) + ((-1)^(2+1)(x-pi)^(2*2))/((2*2)!) + ((-1)^(3+1)(x-pi)^(2*3))/((2*3)!) + . . .

$= \textcolor{b l u e}{- 1 + \frac{1}{2} {\left(x - \pi\right)}^{2} - \frac{1}{24} {\left(x - \pi\right)}^{4} + \frac{1}{720} {\left(x - \pi\right)}^{6} - . . .}$