# Thread: 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

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
$\displaystyle 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 $\displaystyle a=\frac{\pi}{12}$ reevaluate your series as you are missing the $\displaystyle (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

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 \displaystyle \cos{\frac{\pi}{4}} = \frac{1}{\sqrt{2}}$ and $\displaystyle \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
$\displaystyle f(\frac{\pi}{12}) = \frac{1}{\sqrt2}$
$\displaystyle f^{'}(\frac{\pi}{12}) = -\frac{1}{\sqrt2}.3$
$\displaystyle f^{"}(\frac{\pi}{12}) = -\frac{1}{\sqrt2}.3^2$
$\displaystyle f^{'''}(\frac{\pi}{12}) = \frac{1}{\sqrt2}.3^3$
.... so the generalized nth term is $\displaystyle cos(\frac{(n-1)\pi}{2}+\frac{\pi}{4}).3^{n-1}\frac{(x-\frac{\pi}{12})^{n-1}}{(n-1)!}$

$\displaystyle 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.

$\displaystyle \bd{FIRST}$
Lets consider the values contributed by $\displaystyle cos\frac{\pi}{12}$ term in each term
$\displaystyle f(\frac{\pi}{12}) = \frac{1}{\sqrt2}$
$\displaystyle f^{'}(\frac{\pi}{12}) = \bd{-\frac{1}{\sqrt2}}.3$
$\displaystyle f^{"}(\frac{\pi}{12}) = \bd{-\frac{1}{\sqrt2}}.3^2$
$\displaystyle f^{'''}(\frac{\pi}{12}) = \bd{\frac{1}{\sqrt2}}.3^3$
$\displaystyle 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 $\displaystyle \frac{1}{\sqrt2}, \frac{-1}{\sqrt2}, \frac{-1}{\sqrt2}, \frac{1}{\sqrt2},\frac{1}{\sqrt2}, \frac{-1}{\sqrt2}, \frac{-1}{\sqrt2}, \frac{1}{\sqrt2}, .......$

$\displaystyle \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 $\displaystyle cos(\frac{\pi}{4}) = \frac{1}{\sqrt2}$ so I use $\displaystyle \frac{(n-1)\pi}{2}$ to generate the quadrant nature and add $\displaystyle \frac{\pi}{4}$ to it.

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

$\displaystyle \bd{FOURTH}$
Voila!.. As everything is in place you can now generalize it as $\displaystyle 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)!}$.

$\displaystyle \bd{NOTE:}$ That you could have generated a function say $\displaystyle (-1)^{[0.5n]}\frac{1}{\sqrt2}$ where [0.5n] denotes the greatest integer function as $\displaystyle 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 $\displaystyle (-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
$\displaystyle 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
$\displaystyle 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 :

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

11. Originally Posted by iva
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
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:
$\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?

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

Taylor's formula is
$\displaystyle 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 $\displaystyle f(a) = cos(\frac{\pi}{4}) = \frac{1}{\sqrt2}$
Second term is $\displaystyle \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 $\displaystyle \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 $\displaystyle \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 \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

,

,

,

,

,

# malaurin expansion of cos3x

Click on a term to search for related topics.