Results 1 to 5 of 5

Math Help - taylor series

  1. #1
    Newbie
    Joined
    Jul 2007
    Posts
    19

    taylor series

    Can anyone help me with how to get the Taylor series of a function(for example sinx)?

    Furthur how to get a value for sin(for example pi/4) with an particular error?
    Thank You
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,939
    Thanks
    338
    Awards
    1
    Quote Originally Posted by Dili View Post
    Can anyone help me with how to get the Taylor series of a function(for example sinx)?

    Furthur how to get a value for sin(for example pi/4) with an particular error?
    Thank You
    The Taylor series for a function f(x) (at least I presume you are talking about a single variable function) to N + 1 terms about a point x = a has the form:
    f(x) \approx f(a) + \frac{1}{1!}f^{\prime}(a)(x - a) +  \frac{1}{2!}f^{\prime \prime}(a)(x - a)^2 + ~ ... ~ + \frac{1}{N!}f^{(N)}(a)(x - a)^N

    or in summation notation:
    f(x) \approx \sum_{k = 0}{N}\frac{1}{k!}f^{(k)}(a)(x - a)^k

    For the error estimate I will refer you here as I have forgotten which one is "standard" (if any.)

    So as an example, let f(x) = sin(x) and let us expand the series about the point x = \frac{\pi}{4}.

    We have:
    f(x) = sin(x) \implies f \left ( \frac{\pi}{4} \right ) = sin \left ( \frac{\pi}{4} \right ) = \frac{\sqrt{2}}{2}

    f^{\prime}(x) = cos(x) \implies f^{\prime} \left ( \frac{\pi}{4} \right ) = cos \left ( \frac{\pi}{4} \right ) = \frac{\sqrt{2}}{2}

    f^{\prime \prime}(x) = -sin(x) \implies f^{\prime \prime} \left ( \frac{\pi}{4} \right ) = -sin \left ( \frac{\pi}{4} \right ) = -\frac{\sqrt{2}}{2}

    f^{\prime \prime \prime}(x) = -cos(x) \implies f^{\prime \prime \prime} \left ( \frac{\pi}{4} \right ) = -cos \left ( \frac{\pi}{4} \right ) = -\frac{\sqrt{2}}{2}

    So the Taylor series to 4 terms looks like:
    sin(x) \approx \frac{\sqrt{2}}{2} + \frac{\sqrt{2}}{2} \left ( x - \frac{\pi}{4} \right ) - \frac{\sqrt{2}}{4} \left ( x - \frac{\pi}{4} \right )^2 - \frac{\sqrt{2}}{12} \left ( x - \frac{\pi}{4} \right )^3

    -Dan
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jul 2007
    Posts
    19

    lagrange's remainder

    Thank you

    But what if we take the point x=0, where you get the familiar Taylor series expansion of sinx? Is it the same as taking any value(pi/4)?
    And can you explain with the Lagrange's remainder?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,939
    Thanks
    338
    Awards
    1
    Quote Originally Posted by Dili View Post
    Thank you

    But what if we take the point x=0, where you get the familiar Taylor series expansion of sinx? Is it the same as taking any value(pi/4)?
    And can you explain with the Lagrange's remainder?
    I'll have to let someone else explain the remainder (I'm just not up on it myself, which is why I posted the link. )

    Yes, you could use the Maclaurin expansion (the Taylor series expansion about the point x = 0), but note that \frac{\pi}{4} \approx 0.785398 is not particularly close to 0. The further x is from 0, the greater the error in the approximation.

    On the other hand using 3 terms in the expansion I get
    sin(x) \approx x - \frac{1}{3!}x^3 + \frac{1}{5!}x^5

    Gives me
    sin \left ( \frac{\pi}{4} \right ) \approx 0.707143
    which is only off by 5.129 \times 10^{-3} %, which is pretty close by most people's judgment.

    -Dan
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Global Moderator

    Joined
    Nov 2005
    From
    New York City
    Posts
    10,616
    Thanks
    9
    Theorem: Let f(x) be an infinitely differenciable function on (a,b) (with a<0<b). Let T_n(x) represent the n-th degree Taylor polynomial around the origin for the point x\in (a,b) (with x\not = 0). And let R_{n+1}(x) = f(x) - T_{n}(x) be the remainder term. Then there exists a number y strictly between 0 and x so that,
    R_{n+1}(x) = \frac{f^{(n+1)}(y)}{(n+1)!}\cdot x^{n+1}.

    So given f(x) = \sin x let us work on the interval (a,b) where a=-\infty and b=+\infty. This function is infinitely differenciable so the above results apply. You can to approximate T_n \left( \frac{\pi}{4} \right). Now by the theorem we know that,
    R_{n+1}\left( \frac{\pi}{4} \right) = \frac{f^{(n+1)} \left( \frac{\pi}{4} \right)}{(n+1)!} \cdot \left( \frac{\pi}{4} \right)^{n+1} for some 0<y<\frac{\pi}{4}.

    Notice that f^{n+1} is one of these: \sin x,\cos x,-\sin x,-\cos x. Thus,  |f^{n+1}|\leq 1. And also notice that \frac{\pi}{4} \leq 1 thus, \left(\frac{\pi}{4}\right)^{n+1} \leq 1.

    This means,
    \left| R_{n+1}\left( \frac{\pi}{4}\right) \right| \leq \frac{1}{(n+1)!}.

    This approximation might be greatly improved all I did was place an approximation that works and furthermore converges rapidply.


    Remark) The theorem applys in more general to (n+1)-differentiable functions but there was no need to use it here.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Getting stuck on series - can't develop Taylor series.
    Posted in the Differential Geometry Forum
    Replies: 6
    Last Post: October 5th 2010, 08:32 AM
  2. Replies: 0
    Last Post: January 26th 2010, 08:06 AM
  3. Formal power series & Taylor series
    Posted in the Differential Geometry Forum
    Replies: 2
    Last Post: April 19th 2009, 09:01 AM
  4. Taylor Series / Power Series
    Posted in the Calculus Forum
    Replies: 6
    Last Post: March 4th 2009, 01:56 PM
  5. Replies: 9
    Last Post: April 3rd 2008, 05:50 PM

Search Tags


/mathhelpforum @mathhelpforum