Finding Maclaurin series for trig function

In summary: I think I'll go with that.In summary, this problem asks you to find the Maclaurin series for (tanx)2. This series is infinite, so you will need to use a computer to find the answer. The derivative of (tanx)2 is 2tanxsec2x, then the derivative of that is -2(cos2x-2)sec4x, then the derivative of that is -2(sin3x-11sinx)sec5x. Going up to only the third derivative is pretty difficult, but just going that far doesn't give me much information about the series. It only gives me x2, because the other terms are 0. The only way to find the
  • #1
leroyjenkens
616
49

Homework Statement



Find the Maclaurin series for (tanx)2

Homework Equations


[tex]f(0)+\frac{f'(0)}{1!}x+\frac{f''(0)}{2!}x^{2}+...[/tex]

The Attempt at a Solution



I don't see how it's reasonable to do this problem without using a computer.
The derivative of (tanx)2 is 2tanxsec2x, then the derivative of that is -2(cos2x-2)sec4x, then the derivative of that is -2(sin3x-11sinx)sec5x.

Going up to only the third derivative is pretty difficult, but just going that far doesn't give me much information about the series. It only gives me x2, because the other terms are 0.

So is there another way of doing this, or is deriving these long expressions the only way?

Thanks.
 
Physics news on Phys.org
  • #2
Typically for a problem like this you only want to write down the first few terms. Since it is an infinite series you don't really have to go too far with it.

Taking those first three terms and using them appropriately should be enough. You could also look for some patterns, a lot of your terms end up being zero.
 
  • #3
I can see a pretty easy way to accomplish this question if you know the Mclaurin series for ##sin(x)## and ##cos(x)##.

By using long division you can derive the series you want.
 
  • #4
leroyjenkens said:

Homework Statement



Find the Maclaurin series for (tanx)2

Homework Equations


[tex]f(0)+\frac{f'(0)}{1!}x+\frac{f''(0)}{2!}x^{2}+...[/tex]

The Attempt at a Solution



I don't see how it's reasonable to do this problem without using a computer.
The derivative of (tanx)2 is 2tanxsec2x, then the derivative of that is -2(cos2x-2)sec4x, then the derivative of that is -2(sin3x-11sinx)sec5x.

Going up to only the third derivative is pretty difficult, but just going that far doesn't give me much information about the series. It only gives me x2, because the other terms are 0.

So is there another way of doing this, or is deriving these long expressions the only way?

Thanks.
What class is this for? Are you comfortable with complex analysis? I think a Laurent series and a limit works.
 
  • #5
You could find the series for tan x and then square it.
 
  • #6
Well I used the method of taking the derivative of tanx, and then the derivative of that, and the derivative of that. I did that 4 times. The 4th time I did it, I already have a ridiculous trig function: 8tanx(secx)^4+8(secx)^4tanx+8(tanx)^3(secx)^2. I'd have to take the derivative of that to get the value of the 5th coefficient. But the problem with this is a0 = 0, a1 = 1, a2 = 0, a3 = 1/3, a4 = 0. So I only get 2 values out of that. I then multiply them together to get the series for (tanx)^2 and it's inaccurate. I get x^2 + 2/3 x^4 + 1/9 x^6. I need more terms for it to be accurate even to the 3rd term.
 
  • #7
leroyjenkens said:
Well I used the method of taking the derivative of tanx, and then the derivative of that, and the derivative of that. I did that 4 times. The 4th time I did it, I already have a ridiculous trig function: 8tanx(secx)^4+8(secx)^4tanx+8(tanx)^3(secx)^2. I'd have to take the derivative of that to get the value of the 5th coefficient. But the problem with this is a0 = 0, a1 = 1, a2 = 0, a3 = 1/3, a4 = 0. So I only get 2 values out of that. I then multiply them together to get the series for (tanx)^2 and it's inaccurate. I get x^2 + 2/3 x^4 + 1/9 x^6. I need more terms for it to be accurate even to the 3rd term.

That's because doing this problem with derivatives is going to take you forever. There's no real pattern in the derivatives.

This problem is designed to make use of the fact that :

$$sin(x) = \sum_{n=0}^{∞} (-1)^n \frac{x^{2n+1}}{(2n+1)!}$$

$$cos(x) = \sum_{n=0}^{∞} (-1)^n \frac{x^{2n}}{(2n)!}$$

$$tan(x) = \frac{sin(x)}{cos(x)}$$

Write out the first few terms for each series and see what happens when you divide them.
 
Last edited:
  • #8
Zondrina said:
That's because doing this problem with derivatives is going to take you forever. There's no real pattern in the derivatives.
Sure there is. I just got the first 5 derivatives in just a few minutes. Just keep everything in terms of tan x so you don't have to keep using the product rule.
\begin{align*}
f(x) &= \tan x \\
f'(x) &= \sec^2 x = 1 + \tan^2 x \\
f''(x) &= 2\tan x\sec^2 x = 2 \tan x (1+\tan^2 x) = 2 (\tan x + \tan^3 x) \\
f'''(x) &= 2(\sec^2 x+3\tan^2 x \sec^2 x) = 2(1+3\tan^2 x)\sec^2 x = 2(1+4\tan^2 x+3 \tan^4 x)
\end{align*} and so on.
 
  • #9
vela said:
Sure there is. I just got the first 5 derivatives in just a few minutes. Just keep everything in terms of tan x so you don't have to keep using the product rule.
\begin{align*}
f(x) &= \tan x \\
f'(x) &= \sec^2 x = 1 + \tan^2 x \\
f''(x) &= 2\tan x\sec^2 x = 2 \tan x (1+\tan^2 x) = 2 (\tan x + \tan^3 x) \\
f'''(x) &= 2(\sec^2 x+3\tan^2 x \sec^2 x) = 2(1+3\tan^2 x)\sec^2 x = 2(1+4\tan^2 x+3 \tan^4 x)
\end{align*} and so on.

That definitely looks much nicer, so I tried it this way and got the same answer. I was truthfully going with the derivative wolfram outputted due to my laziness.
 
  • #10
Dividing the sine series and cosine series can get you in some hot water, even if you only take the first few terms it isn't accurate (since it neglects a majority of the series). Squaring it leads to a similar issue

It may be annoying to take derivatives but go for it, get the first 6 if you are adventurous. Or just the first four if you want. Since, all the odd derivatives will yield 0 we know what 5 will be without trying to write it explicitly down.

You can also try using some language to help you (i.e. mathematica).
 
  • #11
Thanks for the responses. I'll try vela's way of getting the derivatives. Keeping it in terms of tangent is a good idea.

I tried dividing, but it's been a while since I divided polynomials. When you divide polynomials, don't you normally rearrange the dividend in order from highest to lowest powers? Can you do that with series?

Thanks.
 
  • #12
leroyjenkens said:
Thanks for the responses. I'll try vela's way of getting the derivatives. Keeping it in terms of tangent is a good idea.

I tried dividing, but it's been a while since I divided polynomials. When you divide polynomials, don't you normally rearrange the dividend in order from highest to lowest powers? Can you do that with series?

Thanks.

Writing it out you should get :

$$\frac{sin(x)}{cos(x)} = \frac{x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + ...}{1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!}+ ...}$$

No re-arranging needed.
 
  • #13
Jufro said:
Dividing the sine series and cosine series can get you in some hot water, even if you only take the first few terms it isn't accurate (since it neglects a majority of the series). Squaring it leads to a similar issue.
This is misleading at best. Being able to manipulate series in this way is an important skill to develop. You indeed have to keep track of all the terms that may contribute to the final answer, but you can safely ignore the rest.
 
  • #14
You can also use the fact that ##\frac{1}{1-z} = 1+z+z^2+z^3+\cdots## and turn it into a series multiplication problem:
\begin{align*}
\frac{\sin(x)}{\cos(x)} &= \frac{x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots}{1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots}
= \frac{x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots}{1 - \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right)} \\
&= \left(x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots\right) \left[1 + \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right) + \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right)^2 + \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right)^3 + \cdots\right]
\end{align*} The key here is to keep track of only the terms that will contribute to your final answer and neglect the rest.
 
  • #15
leroyjenkens said:

So is there another way of doing this, or is deriving these long expressions the only way?


Well, you know [itex]\frac{d}{dx} \tan(x)=\sec^2(x)[/itex] and [itex]\tan^2(x)=\sec^2(x)-1[/itex] so that:

[tex]\frac{d}{dx}\left(\tan(x)-x\right)=\sec^2(x)-1=\tan^2(x)[/tex]

The power series for [itex]\tan(x)[/itex] is a bear and not easy to derive but you can look it up in Mathworld for example. Let's just say:

[tex]\tan(x)=\sum_{n=1}^{\infty} a_n x^{2n-1}[/tex]

Now, using the power series for [itex]\tan(x)[/itex], can you now derive a power series for [itex]\tan^2(x)[/itex]?

Edit: And here's a nice derivation of the series for tan(z):

http://mathhelpforum.com/math-challenge-problems/108861-power-series-tangent-function.html
 
Last edited:
  • #16
vela said:
You can also use the fact that ##\frac{1}{1-z} = 1+z+z^2+z^3+\cdots## and turn it into a series multiplication problem:
\begin{align*}
\frac{\sin(x)}{\cos(x)} &= \frac{x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots}{1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots}
= \frac{x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots}{1 - \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right)} \\
&= \left(x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots\right) \left[1 + \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right) + \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right)^2 + \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right)^3 + \cdots\right]
\end{align*} The key here is to keep track of only the terms that will contribute to your final answer and neglect the rest.

For what it's worth, ##\tan(x)## is expandable in terms of Bernoulli numbers:
[tex] \tan x = \sum_{n=1}^{\infty} \frac{(-4)^n (1-4^n)B_{2n}}{(2n)!} x^{2n-1} [/tex]
(see http://en.wikipedia.org/wiki/Taylor_series#List_of_Maclaurin_series_of_some_common_functions )
Here ##B_k## is the ##k##th Bernoulli number; see http://en.wikipedia.org/wiki/Bernoulli_number

So, squaring the series gives something in terms of a convolution involving Bernoulli numbers.
 
  • #17
vela said:
You can also use the fact that ##\frac{1}{1-z} = 1+z+z^2+z^3+\cdots## and turn it into a series multiplication problem:
\begin{align*}
\frac{\sin(x)}{\cos(x)} &= \frac{x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots}{1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots}
= \frac{x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots}{1 - \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right)} \\
&= \left(x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots\right) \left[1 + \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right) + \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right)^2 + \left(\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots\right)^3 + \cdots\right]
\end{align*} The key here is to keep track of only the terms that will contribute to your final answer and neglect the rest.

This is only true when we are dealing with small z, |z|<1. There is no such restriction like that in the problem. If we self impose that criteria we might as well use,

Tan(x) ≈ Sin(x) ≈ x for small values of x


Series manipulation is great and crucial in many problems, but only if it brings us close to a value. Larger terms are non-negligible because we allow x→∞, atleast up to 2∏.

Try your method and see if you generate the proper values:
the first 8 terms are 0,0,1,0, 2/3, 0, 17/5, 0 (this comes from the actual derivatives)
 
  • #18
Jufro said:
This is only true when we are dealing with small z, |z|<1. There is no such restriction like that in the problem.
Fair point, but there's no problem here. Since we're expanding about x=0, the series for ##\tan^2 x## you obtain is only valid for ##|x|<\pi/2## because ##\tan^2 x## has a singularity at ##x=\pi/2##. In this range, you have that ##0 \lt \cos x \le 1##, which implies ##z=\frac{x^2}{2!} - \frac{x^4}{4!} + \cdots = 1-\cos x## is positive and strictly less than 1.

If we self impose that criteria we might as well use,

Tan(x) ≈ Sin(x) ≈ x for small values of x
Except that you know (or should know) this means your answer result would only be valid for terms up to order x1. You're either being disingenuous here or revealing why you've had trouble manipulating series.

Series manipulation is great and crucial in many problems, but only if it brings us close to a value. Larger terms are non-negligible because we allow x→∞, atleast up to 2∏.
The last time I looked, ##2\pi## was smaller than infinity. :wink:

For larger values of x, yes, you have to include more terms to obtain the desired accuracy, but it doesn't change the series. In this problem, for instance, you won't get one series for x≈0 and a different one for x≈1.5. In deriving the series, you don't need to worry about terms of order x7 or higher if all you want to write down is terms up to order x6.

Try your method and see if you generate the proper values:
the first 8 terms are 0,0,1,0, 2/3, 0, 17/5, 0 (this comes from the actual derivatives)
I have, and it does. I suggest you try figure out why you can't get it to work for yourself — or at least quit claiming a method won't work if you haven't tried it yourself.
 
  • #19
Ok, I'll bite, let's try it your way:

(x-x3/3!+x5/5!-...)*(1+(x2/2!-x4/4!+...)+(1+(x2/2!-x4/4!+...)2+...)

The lowest term we can end with is when we multiply x *1. Well, that means that the a0 coefficient is 0: good.

The a1 coefficient is 1: wrong.

Do you really think this approach is a better approach to taking a few derivatives? Just because you are capable of doing something doesn't mean it is always beneficial.
 
  • #20
Here's another cool way to express it :

##(tan(x))^2 = (sec(x))^2 - 1 = \frac{1}{(cos(x))^2} - 1##

##= \frac{1}{(\sum_{n=0}^{∞} (-1)^n \frac{x^{2n}}{(2n)!})^2} - 1##

##( \sum_{n=0}^{∞} (-1)^n \frac{x^{2n}}{(2n)!} )^{-2} - 1##

More work than is necessary, but it shows that there's more than one way to represent a function as a series.
 
  • #21
Jufro said:
Ok, I'll bite, let's try it your way:

(x-x3/3!+x5/5!-...)*(1+(x2/2!-x4/4!+...)+(1+(x2/2!-x4/4!+...)2+...)

The lowest term we can end with is when we multiply x *1. Well, that means that the a0 coefficient is 0: good.

The a1 coefficient is 1: wrong.
The leading term for tan x, which is the series you're calculating here, is indeed x.

Do you really think this approach is a better approach to taking a few derivatives? Just because you are capable of doing something doesn't mean it is always beneficial.
Yes.

I'm being a bit flippant here. Obviously, some methods will be easier to apply than others, but just because you can get the answer using one method doesn't mean you shouldn't try other methods as well.
 
Last edited:
  • #22
Zondrina said:
More work than is necessary, but it shows that there's more than one way to represent a function as a series.
Leroy, we expect you to verify that all of the methods and their variations you've been given in this thread give you the same result. :wink:

EDIT: and to add one more way, you can use the fact that
$$\tan^2 x = \sec^2 x - 1 = \left(\frac{d}{dx}\tan x\right) - 1.$$ Once you have the series for tan x, differentiate it term by term and subtract 1.
 
Last edited:
  • #23
I see what you are getting at Vela, the sequence was only defining Tan(x) not Tan2(x).

So, a1= 1 is for Tan (x) giving the first term in Tan2(x) to be the a2 term, =1. I lost track of which series was being defined.

I just don't see an advantage, particularly when the Maclaurin series is almost always introduced in calc 1. But fortunately we are all entitled to do problems as we see fit.
 

1. What is a Maclaurin series?

A Maclaurin series is a representation of a function as an infinite sum of terms, where each term is a polynomial. It is named after Scottish mathematician Colin Maclaurin.

2. How do you find the Maclaurin series for a trigonometric function?

To find the Maclaurin series for a trigonometric function, you need to use the known Maclaurin series for basic trigonometric functions such as sine, cosine, and tangent, and then use algebraic manipulations to transform the given function into one of these basic functions.

3. What is the general formula for a Maclaurin series?

The general formula for a Maclaurin series is f(x) = f(0) + f'(0)x + f''(0)x^2/2! + f'''(0)x^3/3! + ..., where f'(x), f''(x), f'''(x), etc. are the first, second, third, etc. derivatives of the function evaluated at x = 0.

4. Why is it useful to find the Maclaurin series for a trigonometric function?

Finding the Maclaurin series for a trigonometric function allows us to approximate the function with polynomials, which are typically easier to work with in mathematical calculations. It also helps us understand the behavior of the function near x = 0.

5. Can the Maclaurin series for a trigonometric function be used to find its values at any point?

Yes, the Maclaurin series can be used to find the values of a trigonometric function at any point, as long as the series converges at that point. However, the accuracy of the approximation may decrease as you move further away from x = 0.

Similar threads

  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
10
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
289
  • Calculus and Beyond Homework Help
Replies
1
Views
894
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
  • Calculus and Beyond Homework Help
Replies
16
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
418
  • Calculus and Beyond Homework Help
Replies
7
Views
2K
  • Calculus and Beyond Homework Help
Replies
7
Views
2K
Back
Top