# Math Help - Help working out a Taylor series of cos3x

1. ## 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

2. Taylor's formula is
$f(x) = f(a) + \frac{x-a}{1!}f^{'}(a) + \frac{(x-a)^2}{2!}f^{"}(a) + ......... + \frac{(x-a)^n}{n!}f^{(n)}(a)$ now $a=\frac{\pi}{12}$ reevaluate your series as you are missing the $(x-a)^n$ terms in your expansion.

Kalyan.

3. Originally Posted by iva
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
Note that $\displaystyle \cos{\frac{\pi}{4}} = \frac{1}{\sqrt{2}}$ and $\displaystyle \sin{\frac{\pi}{4}} = \frac{1}{\sqrt{2}}$.

4. Thank you, so the corrected taylor polynomial, where a=pi/12, is
Thank you

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

But how do i go about rewording this into to a series?

5. It IS a series...

6. Sorry i meant, into the summation statement (at least I think that is what its called)

7. I did not understand your doubt but if you are trying to make a concise expression make the following observations
$f(\frac{\pi}{12}) = \frac{1}{\sqrt2}$
$f^{'}(\frac{\pi}{12}) = -\frac{1}{\sqrt2}.3$
$f^{"}(\frac{\pi}{12}) = -\frac{1}{\sqrt2}.3^2$
$f^{'''}(\frac{\pi}{12}) = \frac{1}{\sqrt2}.3^3$
.... so the generalized nth term is $cos(\frac{(n-1)\pi}{2}+\frac{\pi}{4}).3^{n-1}\frac{(x-\frac{\pi}{12})^{n-1}}{(n-1)!}$

$f(x) = \displaystyle\sum_{i=1}^{n}cos(\frac{(i-1)\pi}{2}+\frac{\pi}{4})\frac{(3x-\frac{\pi}{4})^{i-1}}{(i-1)!}$

Kalyan

8. Gosh, maybe i am getting ahead of my course material because i am battling to understand how to generalize it as you have done in the last 2 lines. Thank you so much, I need to read up more on this

9. Originally Posted by iva
Gosh, maybe i am getting ahead of my course material because i am battling to understand how to generalize it as you have done in the last 2 lines. Thank you so much, I need to read up more on this
I am sure that the generalization is within the scope of your of your course material but you have to take note of a some facts before you proceed to the generalized term.

$\bd{FIRST}$
Lets consider the values contributed by $cos\frac{\pi}{12}$ term in each term
$f(\frac{\pi}{12}) = \frac{1}{\sqrt2}$
$f^{'}(\frac{\pi}{12}) = \bd{-\frac{1}{\sqrt2}}.3$
$f^{"}(\frac{\pi}{12}) = \bd{-\frac{1}{\sqrt2}}.3^2$
$f^{'''}(\frac{\pi}{12}) = \bd{\frac{1}{\sqrt2}}.3^3$
$f^{(4)}(\frac{\pi}{12}) = \bd{\frac{1}{\sqrt2}}.3^4$
So you see that the pattern is recursive in the sense that you have $\frac{1}{\sqrt2}, \frac{-1}{\sqrt2}, \frac{-1}{\sqrt2}, \frac{1}{\sqrt2},\frac{1}{\sqrt2}, \frac{-1}{\sqrt2}, \frac{-1}{\sqrt2}, \frac{1}{\sqrt2}, .......$

$\bd{SECOND}$
We need to find a trigonometric function fitting the pattern so all I did was observe that the pattern is recursive over four terms with signs of the terms occurring as +,-,-,+,.... this is the cos pattern i.e cosine function is +ve in first quadrant, -ve in the second, -ve in the third and again +ve in fourth quadrant so I was sure cos would fit in. And $cos(\frac{\pi}{4}) = \frac{1}{\sqrt2}$ so I use $\frac{(n-1)\pi}{2}$ to generate the quadrant nature and add $\frac{\pi}{4}$ to it.

$\bd{THIRD}$
The powers of $3^{n-1}$ occurring due to the derivative can be clubbed with the $\frac{(x-\frac{\pi}{12})^{n-1}}{(n-1)!}$ term to create $\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 $cos(\frac{\pi}{4}) = \frac{1}{\sqrt2}$ it fits in nicely.

$\bd{FOURTH}$
Voila!.. As everything is in place you can now generalize it as $f(x) = \displaystyle\sum_{i=1}^{n}cos(\frac{(i-1)\pi}{2}+\frac{\pi}{4})\frac{(3x-\frac{\pi}{4})^{i-1}}{(i-1)!}$.

$\bd{NOTE:}$ That you could have generated a function say $(-1)^{[0.5n]}\frac{1}{\sqrt2}$ where [0.5n] denotes the greatest integer function as $n \in {1,2,3,4,5,.....}$ also generates the same sign pattern of +,-,-,+,+,-,-,+,.... so I could have said that the generalized nth term is $(-1)^{[0.5n]}\frac{1}{\sqrt2}\frac{(3x-\frac{\pi}{4})^{n-1}}{(n-1)!}$
but I choose the cosine function to give the function a trigonometric touch. As you see the generalization is all about observation and packing things into a nice presentable form and its all about how you want to present your function in the generalized form and there is no one concrete way to say that this is the only way as I have discussed it.

So the Taylor series can be expressed as
$f(x) = \displaystyle\sum_{i=1}^{n}cos(\frac{(i-1)\pi}{2}+\frac{\pi}{4})\frac{(3x-\frac{\pi}{4})^{i-1}}{(i-1)!}$

or as
$f(x) = \displaystyle\sum_{r=1}^{n}(-1)^{[0.5r]}\frac{1}{\sqrt2}\frac{(3x-\frac{\pi}{4})^{r-1}}{(r-1)!}$

which ever way you choose

Hope that helps without confusing much ...
Kalyan

10. ## 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 :

$\bd{THIRD}$
The powers of $3^{n-1}$ occurring due to the derivative can be clubbed with the $\frac{(x-\frac{\pi}{12})^{n-1}}{(n-1)!}$ term to create $\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 $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 $\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 $(3x - \frac{\pi}{12}) \neq 3$ , 3rd term $\frac{(x-\frac{\pi}{12})^{2}}{2} \neq 3^{2}$ etc
I don't understand this. I would have put $3^{n-1}$ but i know that is wrong and also not Taylorish

11. Originally Posted by iva
1st term is ok, but the 2nd onward not, the Taylor definition uses the $\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 $(3x - \frac{\pi}{12}) \neq 3$ , 3rd term $\frac{(x-\frac{\pi}{12})^{2}}{2} \neq 3^{2}$ etc
I don't understand this. I would have put $3^{n-1}$ but i know that is wrong and also not Taylorish
Series seems OK try recalculating the terms and the derivatives.

Kalyan.

12. ## Help working out a Taylor series of cos3x

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

For n=1:
$\frac{1}{\sqrt2}.1$

For n=2:

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

For n=3:

$-\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:

$-\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:
$-\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 $\frac{(x-a)^{(n-1)}}{(n-1)!}$
right?

13. I guess you are confused as to how to apply the formula

Taylor's formula is
$f(x) = f(a) + \frac{x-a}{1!}f^{'}(a) + \frac{(x-a)^2}{2!}f^{"}(a) + ......... + \frac{(x-a)^n}{n!}f^{(n)}(a)$
Now first term is $f(a) = cos(\frac{\pi}{4}) = \frac{1}{\sqrt2}$
Second term is $\frac{x-a}{1!}f^{'}(a) = \frac{x-a}{1!}(-3.sin(\frac{\pi}{4}) = \frac{x-a}{1!}(-3.\frac{1}{\sqrt2})$
Third term is $\frac{(x-a)^2}{2!}f^{"}(a) = \frac{(x-a)^2}{2!}(-3^{2}.cos(\frac{\pi}{4}) = \frac{(x-a)^2}{2!}(-3^2.\frac{1}{\sqrt2})$
Fourth term is $\frac{(x-a)^3}{3!}f^{'''}(a) = \frac{(x-a)^3}{3!}(3^{3}.sin(\frac{\pi}{4}) = \frac{(x-a)^3}{3!}(3^{3}.\frac{1}{\sqrt2})$
....so on....

14. Learn how to find the nth derivatives of trigonometric functions and this will become a LOT easier.

15. BTW, tell whoever has set this question that this is a stupid question.

The point of a Taylor series is to use a particular combination of addition, subtraction, multiplication, division and exponentiation to approximate numbers you normally would not be able to evaluate.

There is no point in centering a Taylor series about $\displaystyle \frac{\pi}{12}$, because it gives surd coefficients (which you can not easily evaluate) around a point that can not be easily evaluated.

Page 1 of 2 12 Last