Help working out a Taylor series of cos3x

I've just covered Taylor polynomials and series theory, but there are precious few examples so i'm trying to do the following exercise:

Compute Taylor series of f(x) = cos 3x at pi/12

My attempted answer:

f(x)= cos3x = cos pi/4

f'(x) = -3 sin 3x = -3 sin pi/4

f''(x) = -9 cos 3x = -9 cos pi/4

etc

so Tn cos3x = cos3x + (-3 sin 3x) x/2! + (-9 cos pi/4) x^2/ 3!...

I can't figure how I should go about formulating a series formula for this , especially as trig functions are involved. I'm also not even sure I'm doing the Taylor formula right as i've seen some wierd trig series. Any advice on how to start would be much appreciated

Thanks

Help working out a Taylor series of cos3x

Wow that makes alot more sense now. but the part where you fit in the 3 to the power term doesn't though ie :

Quote:

$\displaystyle \bd{THIRD}$

The powers of $\displaystyle 3^{n-1}$ occurring due to the derivative can be clubbed with the $\displaystyle \frac{(x-\frac{\pi}{12})^{n-1}}{(n-1)!}$ term to create $\displaystyle \frac{(3x-\frac{\pi}{4})^{n-1}}{(n-1)!}$ term. When n=1 this term is in fact 1 (I hope you can observe that) so just leaving you with $\displaystyle cos(\frac{\pi}{4}) = \frac{1}{\sqrt2}$ it fits in nicely.

1st term is ok, but the 2nd onward not, the Taylor definition uses the $\displaystyle \frac{(x-a)^{n-1}}{(n-1)!}$ and you slotted in the 3 there but when i try calculate the 2nd term from this i get $\displaystyle (3x - \frac{\pi}{12}) \neq 3$ , 3rd term $\displaystyle \frac{(x-\frac{\pi}{12})^{2}}{2} \neq 3^{2}$ etc

I don't understand this. I would have put $\displaystyle 3^{n-1}$ but i know that is wrong and also not Taylorish

Help working out a Taylor series of cos3x

Ok but I'm still going wrong, sorry please bear with me:

For n=1:

$\displaystyle \frac{1}{\sqrt2}.1$

For n=2:

$\displaystyle -\frac{1}{\sqrt2}.{(3x-\frac{\pi}{4})} \neq -\frac{3}{\sqrt2} $

For n=3:

$\displaystyle -\frac{1}{\sqrt2}.\frac{(3x^{2}-\frac{\pi}{2}+\frac{\pi^{2}}{16}) }{2} \neq -\frac{9}{\sqrt2} $

But i can now see that i could get the answer if i take the derivative of what is in brackets to get at least some of what I want eg:

For n=2 it works out:

$\displaystyle -\frac{1}{\sqrt2}.f'{(3x-\frac{\pi}{4})} = -\frac{3}{\sqrt2} $

But for n=3 it doesn't as I still have the x in my result:

$\displaystyle -\frac{1}{\sqrt2}.f'{(3x-\frac{\pi}{4})} = -\frac{9x}{\sqrt2} \neq -\frac{9}{\sqrt2} $

But besides, why would i differentiate these terms, if indeed this was the way to go about it? From the Taylor polynomial we only differentiate the function part cos3x as we did already, not the $\displaystyle \frac{(x-a)^{(n-1)}}{(n-1)!}$

right?