Results 1 to 5 of 5

Thread: 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
    11,119
    Thanks
    718
    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 $\displaystyle 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:
    $\displaystyle 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:
    $\displaystyle 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 $\displaystyle f(x) = sin(x)$ and let us expand the series about the point $\displaystyle x = \frac{\pi}{4}$.

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

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

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

    $\displaystyle 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:
    $\displaystyle 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
    11,119
    Thanks
    718
    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 $\displaystyle \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
    $\displaystyle sin(x) \approx x - \frac{1}{3!}x^3 + \frac{1}{5!}x^5$

    Gives me
    $\displaystyle sin \left ( \frac{\pi}{4} \right ) \approx 0.707143$
    which is only off by $\displaystyle 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
    10
    Theorem: Let $\displaystyle f(x)$ be an infinitely differenciable function on $\displaystyle (a,b)$ (with $\displaystyle a<0<b$). Let $\displaystyle T_n(x)$ represent the $\displaystyle n$-th degree Taylor polynomial around the origin for the point $\displaystyle x\in (a,b)$ (with $\displaystyle x\not = 0$). And let $\displaystyle R_{n+1}(x) = f(x) - T_{n}(x)$ be the remainder term. Then there exists a number $\displaystyle y$ strictly between $\displaystyle 0$ and $\displaystyle x$ so that,
    $\displaystyle R_{n+1}(x) = \frac{f^{(n+1)}(y)}{(n+1)!}\cdot x^{n+1}$.

    So given $\displaystyle f(x) = \sin x$ let us work on the interval $\displaystyle (a,b)$ where $\displaystyle a=-\infty$ and $\displaystyle b=+\infty$. This function is infinitely differenciable so the above results apply. You can to approximate $\displaystyle T_n \left( \frac{\pi}{4} \right)$. Now by the theorem we know that,
    $\displaystyle 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 $\displaystyle 0<y<\frac{\pi}{4}$.

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

    This means,
    $\displaystyle \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 $\displaystyle (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: Oct 5th 2010, 08:32 AM
  2. Replies: 0
    Last Post: Jan 26th 2010, 08:06 AM
  3. Formal power series & Taylor series
    Posted in the Differential Geometry Forum
    Replies: 2
    Last Post: Apr 19th 2009, 09:01 AM
  4. Taylor Series / Power Series
    Posted in the Calculus Forum
    Replies: 6
    Last Post: Mar 4th 2009, 01:56 PM
  5. Replies: 9
    Last Post: Apr 3rd 2008, 05:50 PM

Search Tags


/mathhelpforum @mathhelpforum