Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Taylor Polynomial for f(x)=sec(x)

  1. Nov 9, 2008 #1
    Hey all, so I need to find 4th degree taylor polynomial of f(x)=sec(x) centered at c=0

    Can I just use substitution to find the answer since sec(x) = 1/cos(x) and I know the taylor series for cos(x). I guess, essentially, can I take the reciprocal of the taylor series of cosx to get sec(x). (in the same way for sin ((x^3)) you can just plug in x^3 wherever there is an x in the taylor series)

    I know if this doesn't work I can keep taking the derivatives of secx and plug everything in and expand it out and all of that jazz. I did start to take the derivatives of sec(x) before I realized that it got excessively complicated and cumbersome.

    So if my original idea doesn't work, what would be a better way to solve the problem without having to differentiate a whole bunch?

  2. jcsd
  3. Nov 9, 2008 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Yes. Of course, that requires you to know how to compute the reciprocal....
  4. Nov 9, 2008 #3
    wait, so there something more to finding the reciprocal than just flipping the numerater and denomenator?

    can I just say since cos(x) = [tex]\Sigma[/tex] ((-1)^n(x^2n))/(2n)!
    then sec(x) = [tex]\Sigma[/tex] (2n)!/((-1)^n(x^2n))

    I'm thinking it has to be more complicated than that so if it is help would be appreciated,
  5. Nov 9, 2008 #4


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Think of a simple example: what is the reciprocal of 1-r?
  6. Nov 9, 2008 #5
    What you wrote for sec(x) is not a power series of the kind you want (positive powers)
  7. Nov 9, 2008 #6
    No that is wrong and also not a Taylor polynomial. The way to do this is with a trick using [tex]\sum_n p^n = \frac{1}{1-p}[/tex] in reverse. Very hard to guess...

    Alternetively you just use the definition of the Taylor series, you know how to derive don't you.
    Last edited: Nov 9, 2008
  8. Nov 9, 2008 #7


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Long division works too.

    So does writing the equation:
    {Given power series} * {indeterminate power series} = 1
    and solving for the coefficients of the indeterminate power series.
  9. Nov 9, 2008 #8
    Didn't know that... you never stop learning. I understand the series multiplication.
    How do you do long division with this. I know how to do it when the order of the polynomial to be divided is higher than that of the polynomial you divide by. But I don't see how you do it when you divide by an infinite polynomial, especially since you normally start with the highest order terms.
  10. Nov 9, 2008 #9


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Reverse the term order. In "normal" polynomial division, you consider larger powers of x be more significant. But here, you do the opposite: consider them to be less significant.
  11. Nov 9, 2008 #10
    ok, so, making a little progress here. I realize why what I mentioned earlier would be wrong with negative exponents and not being a power series and such. But I'm still having all kinds of trouble figuring out this reciprocal stuff. Of course the first thing that comes to mind for 1-r is 1/(1-r) but I know that this can't be correct. Back in pre-calc I remember doing problems where I needed a reciprocal and I remember being surprised at the answer but I have no clue how to get from one to the other. If someone could remind me of how to do the trick that would be great. I have a feeling its something simple but I just don't see it. Thanks again for helping me with this problem!

    Also, I tried playing with some of the other methods mentions but I didn't have any success. And yes I could go through and differentiate and use the definition of a power series but that gets very cumbersome and I would like to know a better way if a similar problem shows up on an exam.
  12. Nov 10, 2008 #11
    One way, pointed out earlier, is to use the equation

    The left hand side is the reciprocal of 1-r, the right hand side a fine power series in r. Can you generalize this to your original problem?
  13. Nov 10, 2008 #12
    At the risk of distracting from main discussion of this thread, I'd like to go back to talk about the calculation of derivatives, especially the OP's orignal concern:

    This does not always have to be so cumbersome if one takes a methodical approach at calculating these derivates. Sometimes, this process can yield some significant benifits.

    This is especially true for simple functions involving sec(x) or tan(x) and even more so when expanding about a "simple" point (eg, sec(0) = 1)

    Consider, for example, your function f(x) = sec(x). Note the first derivative, sec(x) * tan(x), contains f(x) itself. That is, f'(x) = f(x) * tan(x). Using this method, calculating the next three derivatives should not be that bad if we methodically use f(x) and its derivatives in the following derivative calculations.

    For example, note

    \begin {align*}
    f(x) &= \sec(x) \\
    f'(x)&= \sec(x) \cdot \tan(x) \\
    &= f(x) \cdot \tan(x) \\
    f''(x) &= f'(x) \cdot \tan(x) + f(x) \cdot \bigl(\tan(x) \bigr)' \\
    &= f'(x) \cdot \tan(x) + f(x) \cdot \sec^2(x) \\
    &= f'(x) \cdot \tan(x) +f^3(x) \\
    \end {align*}

    Here we used that fact that the derivative of tan(x) is [itex]\sec^2(x) [/itex], which is [itex]f^2(x)[/itex]

    Continuing, expressing higher derivatives in terms of f(x) and the lower derivatives of f(x) yields

    \begin {align*}
    f'''(x) &= f''(x) \cdot \tan(x) + f'(x) \cdot f^2(x) + 3 \cdot f^2(x) \cdot f'(x) \\
    &= f''(x) \cdot \tan(x) + 4 \cdot f'(x) \cdot f^2(x) \\
    f^{(4)}(x) &= f'''(x) \cdot \tan(x) +f''(x) \cdot f^2(x) \\
    &+ 4 \cdot \bigl (2 \cdot f(x) \cdot f'(x) \cdot f'(x) + f^2(x) \cdot f''(x) \bigl) \\
    &= f'''(x) \cdot \tan(x) + 5 \cdot f^2(x) \cdot f''(x) + 8 f(x) \cdot \bigl(f'(x) \bigr)^2
    \end {align*}

    We now compute the various derivatives at zero, starting with f(0), and using the previous calculated results of f(0) and derivatives in the higher expressions

    \begin {align*}
    f(0) &= \sec(0) = 1 \\
    f'(0) &= f(0) \cdot \tan(0) = 0 \\
    f''(0) &= f'(0) \cdot \tan(0) +f^2(0) = 1 \\
    f'''(0) &= f''(0) \cdot \tan(0) + 4 \cdot f^2(0) \cdot f'(0) = 0 \\
    f^{(4)}(0) &= f'''(0) \cdot \tan(0) + 5 \cdot f^2(0) \cdot f''(0) + 8 \cdot f(0) \cdot \bigl(f'(0) \bigr)^2 = 5
    \end {align*}

    Of course, this can become increasingly messy as we go higher with the derivatives, but for small orders, it may not be so bad to calculate these derivatives directly.
    Last edited: Nov 10, 2008
  14. Nov 10, 2008 #13
    hmmm, I do like the way the last method approached differentiating. I ended up solving the problem just by differentiating everything. I had a chance to talk with my calc professor today and he thought the best way to do the problem would be just to differentiate. I'm sure some of the other methods you guys brought up work fine but frankly, I don't have the time to work through it right now especially since I already turned in the assignment. Thanks a lot for all of the help with this problem, I really appreciate it.
  15. Nov 12, 2008 #14
    sec(x) = En x^2n/(2n)! where En are Euler numbers 1, 5, 61, 1358…
  16. Apr 7, 2011 #15
    No, you can't just flip all the terms of the cos x series into (2n)!/((-1)^n(x^2n)) simply because sec x = 1/cos x.

    I'll give you a simple example. 1/((1/2)+(1/3)) does NOT equal 2+3. This is essentially what you're saying when you just flip ((-1)^n(x^2n))/(2n)!
    to be (2n)!/((-1)^n(x^2n)).
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook