Skip to main content
Mathematics LibreTexts

Taylor Polys

  • Page ID
    219491
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Review of the Tangent Line

    Recall that if f(x) is a function, then f '(a) is the slope of the tangent line at x = a.  Hence

            y - f(a) = f '(a) (x - a)  

    or

            P1(x)  =  y  =  f(a) + f '(a) (x - a) 

    is the equation of the tangent line.  We can say that this is the best linear approximation to f(x) near a.

    Note:      P1'(a) = f '(a).
     


    Quadratic Approximations

    Example

    Let 

            f(x) = e2x

    Find the best quadratic approximation at  x = 0.

    Solution  

    Note 

            f '(x) = 2e2x  

    and 

            f ''(x) = 4e2x

    Let 

            P2(x)  =  a0 + a1x + a2x2  

    Take derivatives we obtain 

            P'2(x) = a1 + 2a2x  

    and 

            P''2(x) = 2a2

    We want the derivatives of f and P to match up.  We have

            P2(0)  =  a0  =  f(0)  =  1 

    Hence 

            a0 = 1
            
    Next

            P2'(0)   =  a =  f '(0)  =  2 

    Hence

            a1 = 2

    Finally


            P2''(0) = 2a2 = f ''(0) = 4 

    Hence  

            a2 = 2

    So

            P2(x) = 1 + 2x + 2x2

            Graph of y=e^(2x), y=1, y=1+2x, and y=1+2x+2x^2, all touching at (0,1) and a better approximation as the power increases.
            

    Notice that the tangent line approximates the curve well for values near x = 0, however the quadratic approximation is a better fit near this point.  This leads us to the idea of using higher degree polynomials to get even better fitting curves.

     


    The Taylor Polynomial


    Suppose that we want the best nth degree approximation to f(x) at x = a.  We compare f(x) to

            Pn(x) =  a0 + a1(x - a) + a2(x - a)2  + a3(x - a)3 + ... + an(x - a)n

    We make the following observations:

            f(a)  =  Pn(a)  =  a0  

    so that  

            a0  =  f(a)

    Now we investigate the first derivative.

            f '(a)  =  P'n(a)  =   a1 + 2a2(x - a)  + 3a3(x - a)2 + ... + nan(x - a)n-1 at x = a 

    so that 

            a1 = f '(a)

    Taking second derivatives gives

            f ''(a) = P''n(a) =   2a2 + (3)(2)a3(x - a)+ ... + n(n - 1)an(x - a)n-2 at x = a 

    so that 

                        1
            a2 =           f ''(a)
                        2

    Note Each time we take a derivative we pick up the next integer in other words
            
                         1
            a3 =              f '''(a)
                      (2)(3)


    If we define f(k)(a) to mean the kth derivative of evaluated at a  then

                         1
            ak  =              f (k) (a)
                         k!

    We now have the key ingredient for our main result.


     

                             The Taylor Polynomial
    The nth degree Taylor polynomial at x = a is

                                                f ''(a)                      f (3)(a)                         f (n)(a)    
    Pn(x) =  f(a) + f '(a)(x - a) +              (x - a)2  +              (x - a)3 + ... +              (x - a)n
                                                 2!                          3!                                  n!

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



    The special case when a = 0 is called the McLaurin Series


     

              The McLaurin Polynomial

    The McLaurin Polynomial of a differentiable function f(x) is 

              \[  \displaystyle\sum_{k=0}^{n} \frac{f^{(k)}(0)}{k!}x^k  \]

     


    Examples:

    Find the fifth degree McLaurin Polynomial for sin x.  

    Solution

    We construct the following table to assist in finding the derivatives.

            

    k (k)(x) (k)(0)
    0 sin x 0
    1 cos x 1
    2 -sin x 0
    3 -cos x -1
    4 sin x 0
    5 cos x 1

    Now put this into the formula to get 

                                   1              0               -1                0               1
            P5(x) = 0  +          x  +           x2  +          x3  +          x4  +          x5  
                                  1!             2!               3!               4!              5!

                          x3           x5     
            =  x  -            +           
                          6          120

    Notice how well the McLaurin polynomial  (in green) approximates y = sin x (in red) for on period.
            undefinedGraph of y=sin(x) and y=x-1/6 x^3 + 1/20 x^5.  The graphs are very close near the origin, but move away from each other to the left of x=-2 and to the right of x = 2.

     


    Taylor's Remainder

    Taylor's Remainder Theorem says that any smooth function can be written as an nth degree Taylor polynomial plus a function that is of order n + 1 near x = c.


     

              Taylor's Remainder Theorem

    If f is smooth from a to b, let Pn(x)  be the nth degree Taylor polynomial at x = c, then for every x there is a z between x and c with

                                       f (n+1)(z)       
              f(x) = Pn(x) +                     (x - c)n+1   
                                       (n + 1)!

     


    Example

    We have
     

                                       (0.1)3     (0.1)5     sin z
            sin(0.1)  =  0.1  -            +           -           (0.1)6  =  .099833416667 + E
                                          6          120         6!

      Where 

                       1
            E  <          (.1)6  = .0000000014
                      6!

    We see that the error quite small.

     



    Back to the Sequences and Series Page


    Taylor Polys is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?