# Taylor series for $\cos^2(x)$

1. Jul 3, 2015

### SYoungblood

1. The problem statement, all variables and given/known data

Write cos^2(x) as a Taylor series

2. Relevant equations
f(x) = cos^2(x)

3. The attempt at a solution
I am stumped.

The cosine function as a Taylor series is 1 - (x^2/2!) + (x^4/4!) - (x^6/6!) + (x^8/8!) - (x^10/10!) + …

I have to express it as cos^2(x) and I am making a pig's ear out of it. This problem is to evaluate the integral between an upper and lower limit, that I will work at finding on my own, but I can't even seem to get the Taylor series right.

I tried 1^2 - (x^2/2!)^2 + (x^4/4!)^2 - (x^6/6!)^2 + (x^8/8!)^2 - (x^10/10!)^2 + …

and turned this into a total mess.

SY

2. Jul 3, 2015

### SYoungblood

I should add, this is one of those problems where you find a value up to a given error of magnitude, so I still have to evaluate the definite integral. The lower limit of the problem at hand is zero, so I am essentially just evaluating one limit after I integrate the series that is kicking my posterior. I didn't want to ask the forum to do my probe;em for me, but i really am coming up with nothing for what I posted above.

SY

3. Jul 3, 2015

### epenguin

Er - isn't that just wherever you have written x you write (2x) ? (In brackets to avoid later mistakes of interpretation.)
The very meaning of algebraic symbolism.

4. Jul 3, 2015

### SYoungblood

It would be cos squared of x -- cos2x

My apologies.

5. Jul 3, 2015

### epenguin

Oh well that is.more difficult, but it was a lucky mistake because it reminds that there is a relation between cos(2x) and cos2x, though I think it can be done without that and for any function.

Last edited: Jul 3, 2015
6. Jul 3, 2015

### SYoungblood

Got it, I get what you are saying and will drive on.

7. Jul 3, 2015

### SammyS

Staff Emeritus
It can't be 1^2 - (x^2/2!)^2 + (x^4/4!)^2 - (x^6/6!)^2 + (x^8/8!)^2 - (x^10/10!)^2 + … . I assume you got that by squaring each term but kept the sign for each.

Is (a + b + c)2 = a2 + b2 + c2 ? - - - or Is (a - b + c)2 = a2 - b2 + c2 ?

Of course the answer is NO to each.

How do you multiply: (1 - (x2/2!) + (x4/4!) - (x6/6!) + (x8/8!) - (x10/10!) + … ) × (1 - (x2/2!) + (x4/4!) - (x6/6!) + (x8/8!) - (x10/10!) + … ) ?

This idea works for the square of any function.

For $\displaystyle \ \cos^2(x) \,,\$ you may want to use $\displaystyle \ \cos^2(x)=\frac{1+\cos(2x)}{2} \ .$

Last edited: Jul 3, 2015
8. Jul 3, 2015

### Zondrina

It would be helpful if you told us what $a$ is in the Taylor series formula:

$$f(x) = \sum_{n = 0}^{\infty} \frac{f^{(n)}(a)}{n!} (x - a)^n$$

If $a = 0$ in the problem statement, and you happen to know the Maclaurin series for $\text{cos}(x)$, then you can square it:

$$\text{cos}(x) = \sum_{n = 0}^{\infty} (-1)^n \frac{x^{2n}}{(2n)!}$$
$$\text{cos}^2(x) = \left(\sum_{n = 0}^{\infty} (-1)^{n} \frac{x^{2n}}{(2n)!^2} \right)^2$$

Last edited: Jul 3, 2015
9. Jul 3, 2015

### vela

Staff Emeritus
This is incorrect. You should read what @SammyS said in the post right before yours.

10. Jul 3, 2015

### Zondrina

I got jumbled in the latex there for a moment. I fixed my post.

I was proposing a trivial solution, assuming $a$ was given.

11. Jul 3, 2015

### Dazed&Confused

It's probably easiest to use the double angle formula and replace $x$ in the Taylor expansion of $\cos$ with $2x$, then add and multiply any factors as per the double angle formula.

12. Jul 3, 2015

### Noctisdark

That is the easiest way to do it, if you want to complicate things like I do, you lay seyset f(x) = cos(x)^2, f'(x) = -sin(2x), f''(x) = -2cos(2x), f'''(x) = 4sin(2x), and expand it that way, but if course that is useless :p so you go with cos(x)^2 = (1+cos(2x))/2

13. Jul 4, 2015

### Dr. Courtney

Follow the usual recipe rather than trying to use the Taylor expansion of cos(x).

Compute f'(x), f''(x), etc.

Evaluate each at x = 0.

Plug into Taylor expansion formula.

14. Jul 4, 2015

### SammyS

Staff Emeritus
In my experience, the usual way to approach a problem like this, with a composition of a function having a well-known Taylor expansion and a simple algebraic function, is to use that well-known Taylor expansion and do some basic algebra to get the desired result, rather than generating all those derivatives, etc.

However, for the function here, what Dr. Courtney suggests works very nicely. It will work using f(x) = cos2(x) just like it is. It will give you some practice with the product rule & chain rule. It also works well (maybe even a little better) using the double angle version of f(x) .

15. Jul 4, 2015

### Dr. Courtney

When I taught Calculus, we tried to steer students towards approaches that were most likely to give them more practice in skills they were more likely to need downstream. The technical core at the Air Force Academy used the product and chain rules a lot more than the double angle formulas, and we got a lot more feedback from engineering departments when their majors stumbled using the chain rule in later classes than we got regarding double angle formulas.

I also like to help students realize that when the approach they've originally selected to work a problem isn't working, it can be useful to zoom back out and try another approach. A big part of mathematical maturity is being able to start over with a fresh approach when one gets stuck rather than stubbornly sticking with the initial choice of approach. Just because a problem _can_ be solved with a given method doesn't mean that it's the only method that can be used. Students need to learn to back out of blind alleys and take a different path. A shot cut isn't a short cut if it doesn't yield the right answer quickly.

16. Jul 5, 2015

### Staff: Mentor

I agree that it is important for calculus students to be well-practiced in using the product and chain rules, but that should not come at the expense of useful trig identities, such as the double-angle identities, which come into play again in integration problems such as $\int \cos^2(x) dx$ and $\int \sin^2(x) dx$. While the approach you suggested for this problem is a good one (after all, it uses the definition of Taylor's series), the approach suggested by @SammyS is a better one IMO.

17. Jul 5, 2015

### Dr. Courtney

There may be time for all that in a 4 or 5 hr calculus class, but not so much in a 3 hour class. The faculty made a conscious choice to only teach one trig identity (cos^2(x) + sin^2(x) = 1) and focus on the material that was most needed in subsequent courses.

$\int \cos^2(x) dx$ and $\int \sin^2(x) dx$ can both be worked without any trig identities by using integration by parts twice, so we taught them that way to reinforce integration by parts.