Skip to main content
Mathematics LibreTexts

11.10: Taylor and Maclaurin Series

  • Page ID
    186271
    • Gilbert Strang & Edwin “Jed” Herman
    • OpenStax

    \( \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}\)
    Learning Objectives
    • Write the terms of the binomial series.
    • Recognize the Taylor series expansions of common functions.
    • Recognize and apply techniques to find the Taylor series for a function.
    • Use Taylor series to solve differential equations.
    • Use Taylor series to evaluate non-elementary integrals.

    Overview of Taylor/Maclaurin Series

    Consider a function \(f\) that has a power series representation at \(x=a\). Then the series has the form

    \[\sum_{n=0}^∞c_n(x−a)^n=c_0+c_1(x−a)+c_2(x−a)^2+ \dots. \label{eq1} \]

    What should the coefficients be? For now, we ignore issues of convergence, but instead focus on what the series should be, if one exists. We return to discuss convergence later in this section. If the series Equation \ref{eq1} is a representation for \(f\) at \(x=a\), we certainly want the series to equal \(f(a)\) at \(x=a\). Evaluating the series at \(x=a\), we see that

    \[\sum_{n=0}^∞c_n(x−a)^n=c_0+c_1(a−a)+c_2(a−a)^2+\dots=c_0.\label{eq2} \]

    Thus, the series equals \(f(a)\) if the coefficient \(c_0=f(a)\). In addition, we would like the first derivative of the power series to equal \(f′(a)\) at \(x=a\). Differentiating Equation \ref{eq2} term-by-term, we see that

    \[\dfrac{d}{dx}\left( \sum_{n=0}^∞c_n(x−a)^n \right)=c_1+2c_2(x−a)+3c_3(x−a)^2+\dots.\label{eq3} \]

    Therefore, at \(x=a,\) the derivative is

    \[ f′(a) =c_1+2c_2(a−a)+3c_3(a−a)^2+\dots=c_1.\label{eq4} \]

    Therefore, the derivative of the series equals \(f′(a)\) if the coefficient \(c_1=f′(a).\) Continuing in this way, we look for coefficients \(c_n\) such that all the derivatives of the power series Equation \ref{eq4} will agree with all the corresponding derivatives of \(f\) at \(x=a\). The second and third derivatives of Equation \ref{eq3} are given by

    \[\dfrac{d^2}{dx^2} \left(\sum_{n=0}^∞c_n(x−a)^n \right)=2c_2+3⋅2c_3(x−a)+4⋅3c_4(x−a)^2+\dots\label{eq5} \]

    and

    \[ \dfrac{d^3}{dx^3} \left( \sum_{n=0}^∞c_n(x−a)^n \right) =3⋅2c_3+4⋅3⋅2c_4(x−a)+5⋅4⋅3c_5(x−a)^2+⋯.\label{eq6} \]

    Therefore, at \(x=a\), the second and third derivatives

    \[ f''(a) =2c_2+3⋅2c_3(a−a)+4⋅3c_4(a−a)^2+\dots=2c_2\label{eq7} \]

    and

    \[ f'''(a)\ =3⋅2c_3+4⋅3⋅2c_4(a−a)+5⋅4⋅3c_5(a−a)^2+\dots =3⋅2c_3\label{eq8} \]

    equal \(f''(a)\) and \(f'''(a)\), respectively, if \(c_2=\dfrac{f''(a)}{2}\) and \(c_3=\dfrac{f'''(a)}{3⋅2}\). More generally, we see that if \(f\) has a power series representation at \(x=a\), then the coefficients should be given by \(c_n=\dfrac{f^{(n)}(a)}{n!}\). That is, the series should be

    \[\sum_{n=0}^∞\dfrac{f^{(n)}(a)}{n!}(x−a)^n=f(a)+f′(a)(x−a)+\dfrac{f''(a)}{2!}(x−a)^2+\dfrac{f'''(a)}{3!}(x−a)^3+⋯ \nonumber \]

    This power series for \(f\) is known as the Taylor series for \(f\) at \(a.\) If \(a=0\), then this series is known as the Maclaurin series for \(f\).

    Definition \(\PageIndex{1}\): Maclaurin and Taylor series

    If \(f\) has derivatives of all orders at \(x=a\), then the Taylor series for the function \(f\) at \(a\) is

    \[\sum_{n=0}^∞\dfrac{f^{(n)}(a)}{n!}(x−a)^n=f(a)+f′(a)(x−a)+\dfrac{f''(a)}{2!}(x−a)^2+⋯+\dfrac{f^{(n)}(a)}{n!}(x−a)^n+⋯ \nonumber \]

    The Taylor series for \(f\) at 0 is known as the Maclaurin series for \(f\).

    Later in this section, we will show examples of finding Taylor series and discuss conditions under which the Taylor series for a function will converge to that function. Here, we state an important result. Recall that power series representations are unique. Therefore, if a function \(f\) has a power series at \(a\), then it must be the Taylor series for \(f\) at \(a\).

    Theorem \(\PageIndex{1}\): Uniqueness of Taylor Series

    If a function \(f\) has a power series at \(a\) that converges to \(f\) on some open interval containing \(a\), then that power series is the Taylor series for \(f\) at \(a\).

    The proof follows directly from that discussed previously.

    To determine if a Taylor series converges, we need to look at its sequence of partial sums. These partial sums are finite polynomials, known as Taylor polynomials.

    Taylor Polynomials

    The \(n^{\text{th}}\) partial sum of the Taylor series for a function \(f\) at \(a\) is known as the \(n^{\text{th}}\)-degree Taylor polynomial. For example, the 0th, 1st, 2nd, and 3rd partial sums of the Taylor series are given by

    \[\begin{align*} p_0(x) &=f(a) \\[4pt] p_1(x) &=f(a)+f′(a)(x−a) \\[4pt]p_2(x) &=f(a)+f′(a)(x−a)+\dfrac{f''(a)}{2!}(x−a)^2\ \\[4pt]p_3(x) &=f(a)+f′(a)(x−a)+\dfrac{f''(a)}{2!}(x−a)^2+\dfrac{f'''(a)}{3!}(x−a)^3 \end{align*}\]

    respectively. These partial sums are known as the 0th, 1st, 2nd, and 3rd degree Taylor polynomials of \(f\) at \(a\), respectively. If \(a=0\), then these polynomials are known as Maclaurin polynomials for \(f\). We now provide a formal definition of Taylor and Maclaurin polynomials for a function \(f\).

    Definition \(\PageIndex{2}\): Maclaurin polynomial

    If \(f\) has \(n\) derivatives at \(x=a\), then the \(n^{\text{th}}\)-degree Taylor polynomial of \(f\) at \(a\) is

    \[p_n(x)=f(a)+f′(a)(x−a)+\dfrac{f''(a)}{2!}(x−a)^2+\dfrac{f'''(a)}{3!}(x−a)^3+⋯+\dfrac{f^{(n)}(a)}{n!}(x−a)^n. \nonumber \]

    The \(n^{\text{th}}\)-degree Taylor polynomial for \(f\) at \(0\) is known as the \(n^{\text{th}}\)-degree Maclaurin polynomial for \(f\).

    We now show how to use this definition to find several Taylor polynomials for \(f(x)=\ln x\) at \(x=1\).

    Example \(\PageIndex{1}\): Finding Taylor Polynomials

    Find the Taylor polynomials \(p_0,p_1,p_2\) and \(p_3\) for \(f(x)=\ln x\) at \(x=1\). Use a graphing utility to compare the graph of \(f\) with the graphs of \(p_0,p_1,p_2\) and \(p_3\).

    Solution

    To find these Taylor polynomials, we need to evaluate \(f\) and its first three derivatives at \(x=1\).

    \[\begin{align*} f(x)&=\ln x & f(1)&=0\\[5pt]
    f′(x)&=\dfrac{1}{x} & f′(1)&=1\\[5pt]
    f''(x)&=−\dfrac{1}{x^2} & f''(1)&=−1\\[5pt]
    f'''(x)&=\dfrac{2}{x^3} & f'''(1)&=2\end{align*}\]

    Therefore,

    \[\begin{align*} p_0(x) &= f(1)=0,\\[4pt]p_1(x) &=f(1)+f′(1)(x−1) =x−1,\\[4pt]p_2(x) &=f(1)+f′(1)(x−1)+\dfrac{f''(1)}{2}(x−1)^2 = (x−1)−\dfrac{1}{2}(x−1)^2 \\[4pt]p_3(x) &=f(1)+f′(1)(x−1)+\dfrac{f''(1)}{2}(x−1)^2+\dfrac{f'''(1)}{3!}(x−1)^3=(x−1)−\dfrac{1}{2}(x−1)^2+\dfrac{1}{3}(x−1)^3 \end{align*}\]

    The graphs of \(y=f(x)\) and the first three Taylor polynomials are shown in Figure \(\PageIndex{1}\).

    This graph has four curves. The first is the function f(x)=ln(x). The second function is psub1(x)=x-1. The third is psub2(x)=(x-1)-1/2(x-1)^2. The fourth is psub3(x)=(x-1)-1/2(x-1)^2 +1/3(x-1)^3. The curves are very close around x = 1.
    Figure \(\PageIndex{1}\): The function \(y=\ln x\) and the Taylor polynomials \(p_0,p_1,p_2\) and \(p_3\) at \(x=1\) are plotted on this graph.
    Exercise \(\PageIndex{1}\)

    Find the Taylor polynomials \(p_0,p_1,p_2\) and \(p_3\) for \(f(x)=\dfrac{1}{x^2}\) at \(x=1\).

    Hint

    Find the first three derivatives of \(f\) and evaluate them at \(x=1.\)

    Answer

    \[ \begin{align*} p_0(x)&=1\\[5pt]
    p_1(x)&=1−2(x−1)\\[5pt]
    p_2(x)&=1−2(x−1)+3(x−1)^2\\[5pt]
    p_3(x)&=1−2(x−1)+3(x−1)^2−4(x−1)^3\end{align*}\]

    We now show how to find Maclaurin polynomials for \(e^x, \sin x,\) and \(\cos x\). As stated above, Maclaurin polynomials are Taylor polynomials centered at zero.

    Example \(\PageIndex{2}\): Finding Maclaurin Polynomials

    For each of the following functions, find formulas for the Maclaurin polynomials \(p_0,p_1,p_2\) and \(p_3\). Find a formula for the \(n^{\text{th}}\)-degree Maclaurin polynomial and write it using sigma notation. Use a graphing utility to compare the graphs of \(p_0,p_1,p_2\) and \(p_3\) with \(f\).

    1. \(f(x)=e^x\)
    2. \(f(x)=\sin x\)
    3. \(f(x)=\cos x\)
    Solution

    Since \(f(x)=e^x\),we know that \(f(x)=f′(x)=f''(x)=⋯=f^{(n)}(x)=e^x\) for all positive integers \(n\). Therefore,

    \[f(0)=f′(0)=f''(0)=⋯=f^{(n)}(0)=1 \nonumber \]

    for all positive integers \(n\). Therefore, we have

    \(\begin{align*} p_0(x)&=f(0)=1,\\[5pt]
    p_1(x)&=f(0)+f′(0)x=1+x,\\[5pt]
    p_2(x)&=f(0)+f′(0)x+\dfrac{f''(0)}{2!}x^2=1+x+\dfrac{1}{2}x^2,\\[5pt]
    p_3(x)&=f(0)+f′(0)x+\dfrac{f''(0)}{2}x^2+\dfrac{f'''(0)}{3!}x^3=1+x+\dfrac{1}{2}x^2+\dfrac{1}{3!}x^3,\end{align*}\)


    \(\displaystyle \begin{align*} p_n(x)&=f(0)+f′(0)x+\dfrac{f''(0)}{2}x^2+\dfrac{f'''(0)}{3!}x^3+⋯+\dfrac{f^{(n)}(0)}{n!}x^n\\[5pt]
    &=1+x+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+⋯+\dfrac{x^n}{n!}\\[5pt]
    &=\sum_{k=0}^n\dfrac{x^k}{k!}\end{align*}\).

    The function and the first three Maclaurin polynomials are shown in Figure \(\PageIndex{2}\).

    This graph has four curves. The first is the function f(x)=e^x. The second function is psub0(x)=1. The third is psub1(x) which is an increasing line passing through y=1. The fourth function is psub3(x) which is a curve passing through y=1. The curves are very close around y= 1.
    Figure \(\PageIndex{2}\): The graph shows the function \(y=e^x\) and the Maclaurin polynomials \(p_0,\,p_1,\,p_2\) and \(p_3\).

    b. For \(f(x)=\sin x\), the values of the function and its first four derivatives at \(x=0\) are given as follows:

    \[\begin{align*} f(x)&=\sin x & f(0)&=0\\[5pt]
    f′(x)&=\cos x & f′(0)&=1\\[5pt]
    f''(x)&=−\sin x & f''(0)&=0\\[5pt]
    f'''(x)&=−\cos x & f'''(0)&=−1\\[5pt]
    f^{(4)}(x)&=\sin x & f^{(4)}(0)&=0.\end{align*}\]

    Since the fourth derivative is \(\sin x,\) the pattern repeats. That is, \(f^{(2m)}(0)=0\) and \(f^{(2m+1)}(0)=(−1)^m\) for \(m≥0.\) Thus, we have

    \(\begin{align*} p_0(x)&=0,\\[5pt]
    p_1(x)&=0+x=x,\\[5pt]
    p_2(x)&=0+x+0=x,\\[5pt]
    p_3(x)&=0+x+0−\dfrac{1}{3!}x^3=x−\dfrac{x^3}{3!},\\[5pt]
    p_4(x)&=0+x+0−\dfrac{1}{3!}x^3+0=x−\dfrac{x^3}{3!},\\[5pt]
    p_5(x)&=0+x+0−\dfrac{1}{3!}x^3+0+\dfrac{1}{5!}x^5=x−\dfrac{x^3}{3!}+\dfrac{x^5}{5!},\end{align*}\)

    and for \(m≥0\),

    \[\begin{align*} p_{2m+1}(x)=p_{2m+2}(x)&=x−\dfrac{x^3}{3!}+\dfrac{x^5}{5!}−⋯+(−1)^m\dfrac{x^{2m+1}}{(2m+1)!}\\[5pt]
    &=\sum_{k=0}^m(−1)^k\dfrac{x^{2k+1}}{(2k+1)!}.\end{align*}\]

    Graphs of the function and its Maclaurin polynomials are shown in Figure \(\PageIndex{3}\).

    This graph has four curves. The first is the function f(x)=sin(x). The second function is psub1(x). The third is psub3(x). The fourth function is psub5(x). The curves are very close around x=0.
    Figure \(\PageIndex{3}\): The graph shows the function \(y=\sin x\) and the Maclaurin polynomials \(p_1,\, p_3\) and \(p_5\).

    c. For \(f(x)=\cos x\), the values of the function and its first four derivatives at \(x=0\) are given as follows:

    \[\begin{align*} f(x)&=\cos x & f(0)&=1\\[5pt]
    f′(x)&=−\sin x & f′(0)&=0\\[5pt]
    f''(x)&=−\cos x & f''(0)&=−1\\[5pt]
    f'''(x)&=\sin x & f'''(0)&=0\\[5pt]
    f^{(4)}(x)&=\cos x & f^{(4)}(0)&=1.\end{align*}\]

    Since the fourth derivative is \(\sin x\), the pattern repeats. In other words, \(f^{(2m)}(0)=(−1)^m\) and \(f^{(2m+1)}=0\) for \(m≥0\). Therefore,

    \(\begin{align*} p_0(x)&=1,\\[5pt]
    p_1(x)&=1+0=1,\\[5pt]
    p_2(x)&=1+0−\dfrac{1}{2!}x^2=1−\dfrac{x^2}{2!},\\[5pt]
    p_3(x)&=1+0−\dfrac{1}{2!}x^2+0=1−\dfrac{x^2}{2!},\\[5pt]
    p_4(x)&=1+0−\dfrac{1}{2!}x^2+0+\dfrac{1}{4!}x^4=1−\dfrac{x^2}{2!}+\dfrac{x^4}{4!},\\[5pt]
    p_5(x)&=1+0−\dfrac{1}{2!}x^2+0+\dfrac{1}{4!}x^4+0=1−\dfrac{x^2}{2!}+\dfrac{x^4}{4!},\end{align*}\)

    and for \(n≥0\),

    \[\begin{align*} p_{2m}(x)&=p_{2m+1}(x)\\[5pt]
    &=1−\dfrac{x^2}{2!}+\dfrac{x^4}{4!}−⋯+(−1)^m\dfrac{x^{2m}}{(2m)!}\\[5pt]
    &=\sum_{k=0}^m(−1)^k\dfrac{x^{2k}}{(2k)!}.\end{align*}\]

    Graphs of the function and the Maclaurin polynomials appear in Figure \(\PageIndex{4}\).

    This graph has four curves. The first is the function f(x)=cos(x). The second function is psub0(x). The third is psub2(x). The fourth function is psub4(x). The curves are very close around y=1
    Figure \(\PageIndex{4}\): The function \(y=\cos x\) and the Maclaurin polynomials \(p_0,p_2\) and \(p_4\) are plotted on this graph.
    Exercise \(\PageIndex{2}\)

    Find formulas for the Maclaurin polynomials \(p_0,\,p_1,\,p_2\) and \(p_3\) for \(f(x)=\dfrac{1}{1+x}\).

    Find a formula for the \(n^{\text{th}}\)-degree Maclaurin polynomial. Write your answer using sigma notation.

    Hint

    Evaluate the first four derivatives of \(f\) and look for a pattern.

    Answer

    \(\displaystyle p_0(x)=1,\) \(\displaystyle p_1(x)=1−x,\) \(\displaystyle p_2(x)=1−x+x^2,\) \(\displaystyle p_3(x)=1−x+x^2−x^3,\) \(\displaystyle p_n(x)=1−x+x^2−x^3+⋯+(−1)^nx^n\) \(\displaystyle=\sum_{k=0}^n(−1)^kx^k\)

    Taylor’s Theorem with Remainder

    Recall that the \(n^{\text{th}}\)-degree Taylor polynomial for a function \(f\) at \(a\) is the \(n^{\text{th}}\) partial sum of the Taylor series for \(f\) at \(a\). Therefore, to determine if the Taylor series converges, we need to determine whether the sequence of Taylor polynomials \({p_n}\) converges. However, not only do we want to know if the sequence of Taylor polynomials converges, we want to know if it converges to \(f\). To answer this question, we define the remainder \(R_n(x)\) as

    \[R_n(x)=f(x)−p_n(x). \nonumber \]

    For the sequence of Taylor polynomials to converge to \(f\), we need the remainder \(R_n\) to converge to zero. To determine if \(R_n\) converges to zero, we introduce Taylor’s theorem with remainder. Not only is this theorem useful in proving that a Taylor series converges to its related function, but it will also allow us to quantify how well the \(n^{\text{th}}\)-degree Taylor polynomial approximates the function.

    Here we look for a bound on \(|R_n|.\) Consider the simplest case: \(n=0\). Let \(p_0\) be the 0th Taylor polynomial at \(a\) for a function \(f\). The remainder \(R_0\) satisfies

    \(R_0(x)=f(x)−p_0(x)=f(x)−f(a).\)

    If \(f\) is differentiable on an interval \(I\) containing \(a\) and \(x\), then by the Mean Value Theorem there exists a real number \(c\) between \(a\) and \(x\) such that \(f(x)−f(a)=f′(c)(x−a)\). Therefore,

    \[R_0(x)=f′(c)(x−a). \nonumber \]

    Using the Mean Value Theorem in a similar argument, we can show that if \(f\) is \(n\) times differentiable on an interval \(I\) containing \(a\) and \(x\), then the \(n^{\text{th}}\) remainder \(R_n\) satisfies

    \[R_n(x)=\dfrac{f^{(n+1)}(c)}{(n+1)!}(x−a)^{n+1} \nonumber \]

    for some real number \(c\) between \(a\) and \(x\). It is important to note that the value \(c\) in the numerator above is not the center \(a\), but rather an unknown value \(c\) between \(a\) and \(x\). This formula allows us to get a bound on the remainder \(R_n\). If we happen to know that \(∣f^{(n+1)}(x)∣\) is bounded by some real number \(M\) on this interval \(I\), then

    \[|R_n(x)|≤\dfrac{M}{(n+1)!}|x−a|^{n+1} \nonumber \]

    for all \(x\) in the interval \(I\).

    We now state Taylor’s theorem, which provides the formal relationship between a function \(f\) and its \(n^{\text{th}}\)-degree Taylor polynomial \(p_n(x)\). This theorem allows us to bound the error when using a Taylor polynomial to approximate a function value, and will be important in proving that a Taylor series for \(f\) converges to \(f\).

    Theorem \(\PageIndex{2}\): Taylor's Theorem with Remainder

    Let \(f\) be a function that can be differentiated \(n+1\) times on an interval \(I\) containing the real number \(a\). Let \(p_n\) be the \(n^{\text{th}}\)-degree Taylor polynomial of \(f\) at \(a\) and let

    \[R_n(x)=f(x)−p_n(x) \nonumber \]

    be the \(n^{\text{th}}\) remainder. Then for each \(x\) in the interval \(I\), there exists a real number \(c\) between \(a\) and \(x\) such that

    \[R_n(x)=\dfrac{f^{(n+1)}(c)}{(n+1)!}(x−a)^{n+1} \nonumber \].

    If there exists a real number \(M\) such that \(∣f^{(n+1)}(x)∣≤M\) for all \(x∈I\), then

    \[|R_n(x)|≤\dfrac{M}{(n+1)!}|x−a|^{n+1} \nonumber \]

    for all \(x\) in \(I\).

    Proof

    Fix a point \(x∈I\) and introduce the function \(g\) such that

    \[g(t)=f(x)−f(t)−f′(t)(x−t)−\dfrac{f''(t)}{2!}(x−t)^2−⋯−\dfrac{f^{(n)}(t)}{n!}(x−t)^n−R_n(x)\dfrac{(x−t)^{n+1}}{(x−a)^{n+1}}. \nonumber \]

    We claim that \(g\) satisfies the criteria of Rolle’s theorem. Since \(g\) is a polynomial function (in \(t\)), it is a differentiable function. Also, \(g\) is zero at \(t=a\) and \(t=x\) because

    \[ \begin{align*} g(a) &=f(x)−f(a)−f′(a)(x−a)−\dfrac{f''(a)}{2!}(x−a)^2+⋯+\dfrac{f^{(n)}(a)}{n!}(x−a)^n−R_n(x) \\[4pt] &=f(x)−p_n(x)−R_n(x) \\[4pt] &=0, \\[4pt] g(x) &=f(x)−f(x)−0−⋯−0 \\[4pt] &=0. \end{align*}\]

    Therefore, \(g\) satisfies Rolle’s theorem, and consequently, there exists \(c\) between \(a\) and \(x\) such that \(g′(c)=0.\) We now calculate \(g′\). Using the product rule, we note that

    \[\dfrac{d}{dt}\left[\dfrac{f^{(n)}(t)}{n!}(x−t)^n\right]=−\dfrac{f^{(n)}(t)}{(n−1)!}(x−t)^{n−1}+\dfrac{f^{(n+1)}(t)}{n!}(x−t)^n. \nonumber \]

    Consequently,

    \[\begin{align*} g′(t)&=−f′(t)+[f′(t)−f''(t)(x−t)]+\left[f''(t)(x−t)−\dfrac{f'''(t)}{2!}(x−t)^2\right]+⋯ \\
    &\quad+\left[\dfrac{f^{(n)}(t)}{(n−1)!}(x−t)^{n−1}−\dfrac{f^{(n+1)}(t)}{n!}(x−t)^n\right]+(n+1)R_n(x)\dfrac{(x−t)^n}{(x−a)^{n+1}}\end{align*} \].

    Notice that there is a telescoping effect. Therefore,

    \[g'(t)=−\dfrac{f^{(n+1)}(t)}{n!}(x−t)^n+(n+1)R_n(x)\dfrac{(x−t)^n}{(x−a)^{n+1}} \nonumber \].

    By Rolle’s theorem, we conclude that there exists a number \(c\) between \(a\) and \(x\) such that \(g′(c)=0.\) Since

    \[g′(c)=−\dfrac{f^{(n+1})(c)}{n!}(x−c)^n+(n+1)R_n(x)\dfrac{(x−c)^n}{(x−a)^{n+1}} \nonumber \]

    we conclude that

    \[−\dfrac{f^{(n+1)}(c)}{n!}(x−c)^n+(n+1)R_n(x)\dfrac{(x−c)^n}{(x−a)^{n+1}}=0. \nonumber \]

    Adding the first term on the left-hand side to both sides of the equation and dividing both sides of the equation by \(n+1,\) we conclude that

    \[R_n(x)=\dfrac{f^{(n+1)}(c)}{(n+1)!}(x−a)^{n+1} \nonumber \]

    as desired. From this fact, it follows that if there exists \(M\) such that \(∣f^{(n+1)}(x)∣≤M\) for all \(x\) in \(I\), then

    \[|R_n(x)|≤\dfrac{M}{(n+1)!}|x−a|^{n+1} \nonumber \].

    Not only does Taylor’s theorem allow us to prove that a Taylor series converges to a function, but it also allows us to estimate the accuracy of Taylor polynomials in approximating function values. We begin by looking at linear and quadratic approximations of \(f(x)=\sqrt[3]{x}\) at \(x=8\) and determine how accurate these approximations are at estimating \(\sqrt[3]{11}\).

    Example \(\PageIndex{3}\): Using Linear and Quadratic Approximations to Estimate Function Values

    Consider the function \(f(x)=\sqrt[3]{x}\).

    1. Find the first and second Taylor polynomials for \(f\) at \(x=8\). Use a graphing utility to compare these polynomials with \(f\) near \(x=8.\)
    2. Use these two polynomials to estimate \(\sqrt[3]{11}\).
    3. Use Taylor’s theorem to bound the error.

    Solution:

    a. For \(f(x)=\sqrt[3]{x}\), the values of the function and its first two derivatives at \(x=8\) are as follows:

    \[\begin{align*} f(x)&=\sqrt[3]{x}, & f(8)&=2\\[5pt]
    f′(x)&=\dfrac{1}{3x^{2/3}}, & f′(8)&=\dfrac{1}{12}\\[5pt]
    f''(x)&=\dfrac{−2}{9x^{5/3}}, & f''(8)&=−\dfrac{1}{144.}\end{align*}\]

    Thus, the first and second Taylor polynomials at \(x=8\) are given by

    \(\begin{align*} p_1(x)&=f(8)+f′(8)(x−8)\\[5pt]
    &=2+\dfrac{1}{12}(x−8)\end{align*}\)

    \(\begin{align*} p_2(x)&=f(8)+f′(8)(x−8)+\dfrac{f''(8)}{2!}(x−8)^2\\[5pt]
    &=2+\dfrac{1}{12}(x−8)−\dfrac{1}{288}(x−8)^2.\end{align*}\)

    The function and the Taylor polynomials are shown in Figure \(\PageIndex{5}\).

    This graph has four curves. The first is the function f(x)=cube root of x. The second function is psub1(x). The third is psub2(x). The curves are very close around x=8.
    Figure \(\PageIndex{5}\): The graphs of \(f(x)=\sqrt[3]{x}\) and the linear and quadratic approximations \(p_1(x)\) and \(p_2(x)\)

    b. Using the first Taylor polynomial at \(x=8\), we can estimate

    \[\sqrt[3]{11}≈p_1(11)=2+\dfrac{1}{12}(11−8)=2.25. \nonumber \]

    Using the second Taylor polynomial at \(x=8\), we obtain

    \[\sqrt[3]{11}≈p_2(11)=2+\dfrac{1}{12}(11−8)−\dfrac{1}{288}(11−8)^2=2.21875. \nonumber \]

    c. By Theorem \(\PageIndex{2}\), there exists a \(c\) in the interval \((8,11)\) such that the remainder when approximating \(\sqrt[3]{11}\) by the first Taylor polynomial satisfies

    \[R_1(11)=\dfrac{f''(c)}{2!}(11−8)^2. \nonumber \]

    We do not know the exact value of \(c\), so we find an upper bound on \(R_1(11)\) by determining the maximum value of \(f''\) on the interval \((8,11)\). Since \(f''(x)=−\dfrac{2}{9x^{5/3}}\), the largest value for \(|f''(x)|\) on that interval occurs at \(x=8\). Using the fact that \(f''(8)=−\dfrac{1}{144}\), we obtain

    \(|R_1(11)|≤\dfrac{1}{144⋅2!}(11−8)^2=0.03125.\)

    Similarly, to estimate \(R_2(11)\), we use the fact that

    \(R_2(11)=\dfrac{f'''(c)}{3!}(11−8)^3\).

    Since \(f'''(x)=\dfrac{10}{27x^{8/3}}\), the maximum value of \(f'''\) on the interval \((8,11)\) is \(f'''(8)≈0.0014468\). Therefore, we have

    \(|R_2(11)|≤\dfrac{0.0011468}{3!}(11−8)^3≈0.0065104.\)

    Exercise \(\PageIndex{3}\):

    Find the first and second Taylor polynomials for \(f(x)=\sqrt{x}\) at \(x=4\). Use these polynomials to estimate \(\sqrt{6}\). Use Taylor’s theorem to bound the error.

    Hint

    Evaluate \(f(4),f′(4),\) and \(f''(4).\)

    Answer

    \(p_1(x)=2+\dfrac{1}{4}(x−4);p_2(x)=2+\dfrac{1}{4}(x−4)−\dfrac{1}{64}(x−4)^2;p_1(6)=2.5;p_2(6)=2.4375;\)

    \(|R_1(6)|≤0.0625;|R_2(6)|≤0.015625\)

    Example \(\PageIndex{4}\): Approximating \(\sin x\) Using Maclaurin Polynomials

    From Example \(\PageIndex{2b}\), the Maclaurin polynomials for \(\sin x\) are given by

    \[p_{2m+1}(x)=p_{2m+2}(x)=x−\dfrac{x^3}{3!}+\dfrac{x^5}{5!}−\dfrac{x^7}{7!}+⋯+(−1)^m\dfrac{x^{2m+1}}{(2m+1)!} \nonumber \]

    for \(m=0,1,2,….\)

    1. Use the fifth Maclaurin polynomial for \(\sin x\) to approximate \(\sin\left(\dfrac{π}{18}\right)\) and bound the error.
    2. For what values of \(x\) does the fifth Maclaurin polynomial approximate \(\sin x\) to within \(0.0001\)?
    Solution

    a.

    The fifth Maclaurin polynomial is

    \[p_5(x)=x−\dfrac{x^3}{3!}+\dfrac{x^5}{5!} \nonumber \].

    Using this polynomial, we can estimate as follows:

    \[\sin\left(\dfrac{π}{18}\right)≈p_5\left(\dfrac{π}{18}\right)=\dfrac{π}{18}−\dfrac{1}{3!}\left(\dfrac{π}{18}\right)^3+\dfrac{1}{5!}\left(\dfrac{π}{18}\right)^5≈0.173648. \nonumber \]

    To estimate the error, use the fact that the sixth Maclaurin polynomial is \(p_6(x)=p_5(x)\) and calculate a bound on \(R_6(\dfrac{π}{18})\). By Theorem \(\PageIndex{2}\), the remainder is

    \[R_6\left(\dfrac{π}{18}\right)=\dfrac{f^{(7)}(c)}{7!}\left(\dfrac{π}{18}\right)^7 \nonumber \]

    for some \(c\) between 0 and \(\dfrac{π}{18}\). Using the fact that \(∣f^{(7)}(x)∣≤1\) for all \(x\), we find that the magnitude of the error is at most

    \[\dfrac{1}{7!}⋅\left(\dfrac{π}{18}\right)^7≤9.8×10^{−10}. \nonumber \]

    b.

    We need to find the values of \(x\) such that

    \[\dfrac{1}{7!}|x|^7≤0.0001. \nonumber \]

    Solving this inequality for \(x\), we have that the fifth Maclaurin polynomial gives an estimate to within \(0.0001\) as long as \(|x|<0.907.\)

    Exercise \(\PageIndex{4}\)

    Use the fourth Maclaurin polynomial for \(\cos x\) to approximate \(\cos\left(\dfrac{π}{12}\right).\)

    Hint

    The fourth Maclaurin polynomial is \(p_4(x)=1−\dfrac{x^2}{2!}+\dfrac{x^4}{4!}\).

    Answer

    \(0.96593\)

    Now that we are able to bound the remainder \(R_n(x)\), we can use this bound to prove that a Taylor series for \(f\) at a converges to \(f\).

    Representing Functions with Taylor and Maclaurin Series

    We now discuss issues of convergence for Taylor series. We begin by showing how to find a Taylor series for a function, and how to find its interval of convergence.

    Example \(\PageIndex{5}\): Finding a Taylor Series

    Find the Taylor series for \(f(x)=\dfrac{1}{x}\) at \(x=1\). Determine the interval of convergence.

    Solution

    For \(f(x)=\dfrac{1}{x},\) the values of the function and its first four derivatives at \(x=1\) are

    \[\begin{align*} f(x)&=\dfrac{1}{x} & f(1)&=1\\[5pt]
    f′(x)&=−\dfrac{1}{x^2} & f′(1)&=−1\\[5pt]
    f''(x)&=\dfrac{2}{x^3} & f''(1)&=2!\\[5pt]
    f'''(x)&=−\dfrac{3⋅2}{x^4} & f'''(1)&=−3!\\[5pt]
    f^{(4)}(x)&=\dfrac{4⋅3⋅2}{x^5} & f^{(4)}(1)&=4!.\end{align*}\]

    That is, we have \(f^{(n)}(1)=(−1)^nn!\) for all \(n≥0\). Therefore, the Taylor series for \(f\) at \(x=1\) is given by

    \(\displaystyle \sum_{n=0}^∞\dfrac{f^{(n)}(1)}{n!}(x−1)^n=\sum_{n=0}^∞(−1)^n(x−1)^n\).

    To find the interval of convergence, we use the ratio test. We find that

    \(\dfrac{|a_{n+1}|}{|a_n|}=\dfrac{∣(−1)^{n+1}(x−1)n^{+1}∣}{|(−1)^n(x−1)^n|}=|x−1|\).

    Thus, the series converges if \(|x−1|<1.\) That is, the series converges for \(0<x<2\). Next, we need to check the endpoints. At \(x=2\), we see that

    \(\displaystyle \sum_{n=0}^∞(−1)^n(2−1)^n=\sum_{n=0}^∞(−1)^n\)

    diverges by the divergence test. Similarly, at \(x=0,\)

    \(\displaystyle \sum_{n=0}^∞(−1)^n(0−1)^n=\sum_{n=0}^∞(−1)^{2n}=\sum_{n=0}^∞1\)

    diverges. Therefore, the interval of convergence is \((0,2)\).

    Exercise \(\PageIndex{5}\)

    Find the Taylor series for \(f(x)=\dfrac{1}{2x}\) at \(x=2\) and determine its interval of convergence.

    Hint

    \(f^{(n)}(2)=\dfrac{(−1)^nn!}{2^{n+2}}\)

    Answer

    \(\dfrac{1}{4}\displaystyle \sum_{n=0}^∞\left(\dfrac{2−x}{2}\right)^n\). The interval of convergence is \((0,4)\).

    We know that the Taylor series found in this example converges on the interval \((0,2)\), but how do we know it actually converges to \(f\)? We consider this question in more generality in a moment, but for this example, we can answer this question by writing

    \[ f(x)=\dfrac{1}{x}=\dfrac{1}{1−(1−x)}. \nonumber \]

    That is, \(f\) can be represented by the geometric series \(\displaystyle \sum_{n=0}^∞(1−x)^n\). Since this is a geometric series, it converges to \(\dfrac{1}{x}\) as long as \(|1−x|<1.\) Therefore, the Taylor series found in Example \(\PageIndex{5}\) does converge to \(f(x)=\dfrac{1}{x}\) on \((0,2).\)

    We now consider the more general question: if a Taylor series for a function \(f\) converges on some interval, how can we determine if it actually converges to \(f\)? To answer this question, recall that a series converges to a particular value if and only if its sequence of partial sums converges to that value. Given a Taylor series for \(f\) at \(a\), the \(n^{\text{th}}\) partial sum is given by the \(n^{\text{th}}\)-degree Taylor polynomial \(p_n\). Therefore, to determine if the Taylor series converges to \(f\), we need to determine whether

    \(\displaystyle \lim_{n→∞}p_n(x)=f(x)\).

    Since the remainder \(R_n(x)=f(x)−p_n(x)\), the Taylor series converges to \(f\) if and only if

    \(\displaystyle \lim_{n→∞}R_n(x)=0.\)

    We now state this theorem formally.

    Theorem \(\PageIndex{3}\): Convergence of Taylor Series

    Suppose that \(f\) has derivatives of all orders on an interval \(I\) containing \(a\). Then the Taylor series

    \[\sum_{n=0}^∞\dfrac{f^{(n)}(a)}{n!}(x−a)^n \nonumber \]

    converges to \(f(x)\) for all \(x\) in \(I\) if and only if

    \[\lim_{n→∞}R_n(x)=0 \nonumber \]

    for all \(x\) in \(I\).

    With this theorem, we can prove that a Taylor series for \(f\) at \(a\) converges to \(f\) if we can prove that the remainder \(R_n(x)→0\). To prove that \(R_n(x)→0\), we typically use the bound

    \[|R_n(x)|≤\dfrac{M}{(n+1)!}|x−a|^{n+1} \nonumber \]

    from Taylor’s theorem with remainder.

    In the next example, we find the Maclaurin series for \(e^x\) and \(\sin x\) and show that these series converge to the corresponding functions for all real numbers by proving that the remainders \(R_n(x)→0\) for all real numbers \(x\).

    Example \(\PageIndex{6}\): Finding Maclaurin Series

    For each of the following functions, find the Maclaurin series and its interval of convergence. Use Theorem \(\PageIndex{2}\) to prove that the Maclaurin series for \(f\) converges to \(f\) on that interval.

    1. \(e^x\)
    2. \(\sin x\)
    Solution

    a. Using the \(n^{\text{th}}\)-degree Maclaurin polynomial for \(e^x\) found in Example \(\PageIndex{2a}\), we find that the Maclaurin series for \(e^x\) is given by

    \(\displaystyle \sum_{n=0}^∞\dfrac{x^n}{n!}\).

    To determine the interval of convergence, we use the ratio test. Since

    \(\dfrac{|a_{n+1}|}{|a_n|}=\dfrac{|x|^{n+1}}{(n+1)!}⋅\dfrac{n!}{|x|^n}=\dfrac{|x|}{n+1}\),

    we have

    \(\displaystyle \lim_{n→∞}\dfrac{|a_{n+1}|}{|a_n|}=\lim_{n→∞}\dfrac{|x|}{n+1}=0\)

    for all \(x\). Therefore, the series converges absolutely for all \(x\), and thus, the interval of convergence is \((−∞,∞)\). To show that the series converges to \(e^x\) for all \(x\), we use the fact that \(f^{(n)}(x)=e^x\) for all \(n≥0\) and \(e^x\) is an increasing function on \((−∞,∞)\). Therefore, for any real number \(b\), the maximum value of \(e^x\) for all \(|x|≤b\) is \(e^b\). Thus,

    \(|R_n(x)|≤\dfrac{e^b}{(n+1)!}|x|^{n+1}\).

    Since we just showed that

    \(\displaystyle \sum_{n=0}^∞\dfrac{|x|^n}{n!}\)

    converges for all \(x\), by the divergence test, we know that

    \(\displaystyle \lim_{n→∞}\dfrac{|x|^{n+1}}{(n+1)!}=0\)

    for any real number \(x\). By combining this fact with the squeeze theorem, the result is \(\displaystyle \lim_{n→∞}R_n(x)=0.\)

    b. Using the \(n^{\text{th}}\)-degree Maclaurin polynomial for \(\sin x\) found in Example \(\PageIndex{2b}\), we find that the Maclaurin series for \(\sin x\) is given by

    \(\displaystyle \sum_{n=0}^∞(−1)^n\dfrac{x^{2n+1}}{(2n+1)!}\).

    In order to apply the ratio test, consider

    \[\begin{align*} \dfrac{|a_{n+1}|}{|a_n|}&=\dfrac{|x|^{2n+3}}{(2n+3)!}⋅\dfrac{(2n+1)!}{|x|^{2n+1}}\\[5pt]
    &=\dfrac{|x|^2}{(2n+3)(2n+2)}\end{align*}. \nonumber \]

    Since

    \(\displaystyle \lim_{n→∞}\dfrac{|x|^2}{(2n+3)(2n+2)}=0\)

    for all \(x\), we obtain the interval of convergence as \((−∞,∞).\) To show that the Maclaurin series converges to \(\sin x\), look at \(R_n(x)\). For each \(x\) there exists a real number \(c\) between \(0\) and \(x\) such that

    \(R_n(x)=\dfrac{f^{(n+1)}(c)}{(n+1)!}x^{n+1}\).

    Since \(∣f^{(n+1)}(c)∣≤1\) for all integers \(n\) and all real numbers \(c\), we have

    \(|R_n(x)|≤\dfrac{|x|^{n+1}}{(n+1)!}\)

    for all real numbers \(x\). Using the same idea as in part a., the result is \(\displaystyle \lim_{n→∞}R_n(x)=0\) for all \(x\), and therefore, the Maclaurin series for \(\sin x\) converges to \(\sin x\) for all real \(x\).

    Exercise \(\PageIndex{6}\)

    Find the Maclaurin series for \(f(x)=\cos x\). Use the ratio test to show that the interval of convergence is \((−∞,∞)\). Show that the Maclaurin series converges to \(\cos x\) for all real numbers \(x\).

    Hint

    Use the Maclaurin polynomials for \(\cos x.\)

    Answer

    \(\displaystyle \sum_{n=0}^∞\dfrac{(−1)^nx^{2n}}{(2n)!}\)

    By the ratio test, the interval of convergence is \((−∞,∞).\) Since \(|R_n(x)|≤\dfrac{|x|^{n+1}}{(n+1)!}\), the series converges to \(\cos x\) for all real \(x\).

    Project: Proving that \(e\) is Irrational

    In this project, we use the Maclaurin polynomials for \(e^x\) to prove that \(e\) is irrational. The proof relies on supposing that \(e\) is rational and arriving at a contradiction. Therefore, in the following steps, we suppose \(e=r/s\) for some integers \(r\) and \(s\) where \(s≠0.\)

    1. Write the Maclaurin polynomials \(p_0(x),p_1(x),p_2(x),p_3(x),p_4(x)\) for \(e^x\). Evaluate \(p_0(1),p_1(1),p_2(1),p_3(1),p_4(1)\) to estimate \(e\).
    2. Let \(R_n(x)\) denote the remainder when using \(p_n(x)\) to estimate \(e^x\). Therefore, \(R_n(x)=e^x−p_n(x)\), and \(R_n(1)=e−p_n(1)\). Assuming that \(e=\dfrac{r}{s}\) for integers \(r\) and \(s\), evaluate \(R_0(1),R_1(1),R_2(1),R_3(1),R_4(1).\)
    3. Using the results from part 2, show that for each remainder \(R_0(1),R_1(1),R_2(1),R_3(1),R_4(1),\) we can find an integer \(k\) such that \(kR_n(1)\) is an integer for \(n=0,1,2,3,4.\)
    4. Write down the formula for the \(n^{\text{th}}\)-degree Maclaurin polynomial \(p_n(x)\) for \(e^x\) and the corresponding remainder \(R_n(x).\) Show that \(sn!R_n(1)\) is an integer.
    5. Use Taylor’s theorem to write down an explicit formula for \(R_n(1)\). Conclude that \(R_n(1)≠0\), and therefore, \(sn!R_n(1)≠0\).
    6. Use Taylor’s theorem to find an estimate on \(R_n(1)\). Use this estimate combined with the result from part 5 to show that \(|sn!R_n(1)|<\dfrac{se}{n+1}\). Conclude that if \(n\) is large enough, then \(|sn!R_n(1)|<1\). Therefore, \(sn!R_n(1)\) is an integer with magnitude less than 1. Thus, \(sn!R_n(1)=0\). But from part 5, we know that \(sn!R_n(1)≠0\). We have arrived at a contradiction, and consequently, the original supposition that e is rational must be false.

    The Binomial Series

    Our first goal in this section is to determine the Maclaurin series for the function \( f(x)=(1+x)^r\) for all real numbers \( r\). The Maclaurin series for this function is known as the binomial series. We begin by considering the simplest case: \( r\) is a nonnegative integer. We recall that, for \( r=0,\,1,\,2,\,3,\,4,\;f(x)=(1+x)^r\) can be written as

    \[\begin{align*} f(x) &=(1+x)^0=1, \\[4pt] f(x) &=(1+x)^1=1+x, \\[4pt] f(x) &=(1+x)^2=1+2x+x^2, \\[4pt] f(x) &=(1+x)^3=1+3x+3x^2+x^3 \\[4pt] f(x) &=(1+x)^4=1+4x+6x^2+4x^3+x^4. \end{align*}\]

    The expressions on the right-hand side are known as binomial expansions and the coefficients are known as binomial coefficients. More generally, for any nonnegative integer \( r\), the binomial coefficient of \( x^n\) in the binomial expansion of \( (1+x)^r\) is given by

    \[\binom{r}{n}=\dfrac{r!}{n!(r−n)!}\label{eq6.6} \]

    and

    \[\begin{align} f(x)&=(1+x)^r\nonumber\\[5pt]
    &= \binom{r}{0}+\binom{r}{1}x+\binom{r}{2}x^2+\binom{r}{3}x^3+⋯+\binom{r}{r-1}x^{r−1}+\binom{r}{r}x^r \nonumber\\[5pt]
    &=\sum_{n=0}^r\binom{r}{n}x^n.\label{eq6.7}\end{align} \]

    For example, using this formula for \( r=5\), we see that

    \[ \begin{align*} f(x) &=(1+x)^5 \\[4pt] &=\binom{5}{0}1+\binom{5}{1}x+\binom{5}{2}x^2+\binom{5}{3}x^3+\binom{5}{4}x^4+\binom{5}{5}x^5 \\[4pt] &=\dfrac{5!}{0!5!}1+\dfrac{5!}{1!4!}x+\dfrac{5!}{2!3!}x^2+\dfrac{5!}{3!2!}x^3+\dfrac{5!}{4!1!}x^4+\dfrac{5!}{5!0!}x^5 \\[4pt] &=1+5x+10x^2+10x^3+5x^4+x^5. \end{align*}\]

    We now consider the case when the exponent \(r\) is any real number, not necessarily a nonnegative integer. If \(r\) is not a nonnegative integer, then \(f(x)=(1+x)^r\) cannot be written as a finite polynomial. However, we can find a power series for \(f\). Specifically, we look for the Maclaurin series for \(f\). To do this, we find the derivatives of \(f\) and evaluate them at \(x=0\).

    \[ \begin{align*} f(x) &=(1+x)^r & f(0) &=1 \\[4pt] f′(x) &=r(1+x)^{r−1} & f'(0) &=r \\[4pt] f''(x) &=r(r−1)(1+x)^{r−2} & f''(0) &=r(r−1) \\[4pt] f'''(x) &=r(r−1)(r−2)(1+x)^{r−3} & f'''(0) &=r(r−1)(r−2) \\[4pt] f^{(n)}(x) &=r(r−1)(r−2)⋯(r−n+1)(1+x)^{r−n} & f^{(n)}(0) &=r(r−1)(r−2)⋯(r−n+1) \end{align*}\]

    We conclude that the coefficients in the binomial series are given by

    \[\dfrac{f^{(n)}(0)}{n!}=\dfrac{r(r−1)(r−2)⋯(r−n+1)}{n!}.\label{eq6.8} \]

    We note that if \(r\) is a nonnegative integer, then the \((r+1)^{\text{st}}\) derivative \( f^{(r+1)}\) is the zero function, and the series terminates. In addition, if \( r\) is a nonnegative integer, then Equation \ref{eq6.8} for the coefficients agrees with Equation \ref{eq6.6} for the coefficients, and the formula for the binomial series agrees with Equation \ref{eq6.7} for the finite binomial expansion. More generally, to denote the binomial coefficients for any real number \( r\), we define

    \[\binom{r}{n}=\dfrac{(r−1)(r−2)⋯(r−n+1)}{n!}. \nonumber \]

    With this notation, we can write the binomial series for \( (1+x)^r\) as

    \[\sum_{n=0}^∞\binom{r}{n}x^n=1+rx+\dfrac{r(r−1)}{2!}x^2+⋯+\dfrac{r(r−1)⋯(r−n+1)}{n!}x^n+⋯. \label{bin1} \]

    We now need to determine the interval of convergence for the binomial series Equation \ref{bin1}. We apply the ratio test. Consequently, we consider

    \[\begin{align*} \dfrac{|a_{n+1}|}{|a_n|} &=\dfrac{|r(r−1)(r−2)⋯(r−n)|x||^{n+1}}{(n+1)!}⋅\dfrac{n!}{|r(r−1)(r−2)⋯(r−n+1)||x|^n} \\[4pt] &=\dfrac{|r−n||x|}{|n+1|} \end{align*}\].

    Since

    \[\lim_{n→∞}\dfrac{|a_{n+1}|}{|a_n|}=|x|<1 \nonumber \]

    if and only if \( |x|<1\), we conclude that the interval of convergence for the binomial series is \( (−1,1)\). The behavior at the endpoints depends on \( r\). It can be shown that for \( r≥0\) the series converges at both endpoints; for \( −1

    Definition: Binomial Series

    For any real number \( r\), the Maclaurin series for \( f(x)=(1+x)^r\) is the binomial series. It converges to \( f\) for \( |x|<1\), and we write

    \[(1+x)^r=\sum_{n=0}^∞\binom{r}{n}x^n=1+rx+\dfrac{r(r−1)}{2!}x^2+⋯+r\dfrac{(r−1)⋯(r−n+1)}{n!}x^n+⋯ \nonumber \]

    for \( |x|<1\).

    We can use this definition to find the binomial series for \( f(x)=\sqrt{1+x}\) and use the series to approximate \( \sqrt{1.5}\).

    Example \(\PageIndex{1}\): Finding Binomial Series
    1. Find the binomial series for \( f(x)=\sqrt{1+x}\).
    2. Use the third-order Maclaurin polynomial \( p_3(x)\) to estimate \( \sqrt{1.5}\). Use Taylor’s theorem to bound the error. Use a graphing utility to compare the graphs of \( f\) and \( p_3\).
    Solution

    a. Here \( r=\dfrac{1}{2}\). Using the definition for the binomial series, we obtain

    \( \displaystyle \qquad \begin{align*} \sqrt{1+x} &=1+\dfrac{1}{2}x+\dfrac{(1/2)(−1/2)}{2!}x^2+\dfrac{(1/2)(−1/2)(−3/2)}{3!}x^3+⋯\\[5pt]
    &=1+\dfrac{1}{2}x−\dfrac{1}{2!}\dfrac{1}{2^2}x^2+\dfrac{1}{3!}\dfrac{1⋅3}{2^3}x^3−⋯+\dfrac{(−1)^{n+1}}{n!}\dfrac{1⋅3⋅5⋯(2n−3)}{2^n}x^n+⋯\\[5pt]
    &=1+\dfrac{1}{2}x+\sum_{n=2}^∞\dfrac{(−1)^{n+1}}{n!}\dfrac{1⋅3⋅5⋯(2n−3)}{2^n}x^n. \end{align*}\)

    b. From the result in part a. the third-order Maclaurin polynomial is

    \( p_3(x)=1+\dfrac{1}{2}x−\dfrac{1}{8}x^2+\dfrac{1}{16}x^3\).

    Therefore,

    \( \sqrt{1.5}=\sqrt{1+0.5}≈1+\dfrac{1}{2}(0.5)−\dfrac{1}{8}(0.5)^2+\dfrac{1}{16}(0.5)^3≈1.2266.\)

    From Taylor’s theorem, the error satisfies

    \( R_3(0.5)=\dfrac{f^{(4)}(c)}{4!}(0.5)^4\)

    for some \( c\) between \( 0\) and \( 0.5\). Since \( f^{(4)}(x)=−\dfrac{15}{2^4(1+x)^{7/2}}\), and the maximum value of \( ∣f^{(4)}(x)∣\) on the interval \( (0,0.5)\) occurs at \( x=0\), we have

    \( |R_3(0.5)|≤\dfrac{15}{4!2^4}(0.5)^4≈0.00244.\)

    The function and the Maclaurin polynomial \( p_3\) are graphed in Figure \(\PageIndex{1}\).

    This graph has two curves. The first one is f(x)= the square root of (1+x) and the second is psub3(x). The curves are very close at y = 1.
    Figure \(\PageIndex{1}\): The third-order Maclaurin polynomial \( p_3(x)\) provides a good approximation for \( f(x)=\sqrt{1+x}\) for \( x\) near zero.
    Exercise \(\PageIndex{1}\)

    Find the binomial series for \( f(x)=\dfrac{1}{(1+x)^2}\).

    Hint

    Use the definition of binomial series for \( r=−2\).

    Answer

    \(\displaystyle \sum_{n=0}^∞(−1)^n(n+1)x^n\)

    Common Functions Expressed as Taylor Series

    At this point, we have derived Maclaurin series for exponential, trigonometric, and logarithmic functions, as well as functions of the form \( f(x)=(1+x)^r\). In Table \(\PageIndex{1}\), we summarize the results of these series. We remark that the convergence of the Maclaurin series for \( f(x)=\ln(1+x)\) at the endpoint \( x=1\) and the Maclaurin series for \( f(x)=\tan^{−1}x\) at the endpoints \( x=1\) and \( x=−1\) relies on a more advanced theorem than we present here. (Refer to Abel’s theorem for a discussion of this more technical point.)

    Table \(\PageIndex{1}\): Maclaurin Series for Common Functions
    Function Maclaurin Series Interval of Convergence
    \( f(x)=\dfrac{1}{1−x}\) \(\displaystyle \sum_{n=0}^∞x^n\) \( −1<1\)>
    \( f(x)=e^x\) \(\displaystyle \sum_{n=0}^∞\dfrac{x^n}{n!}\) \( −∞<∞\)>
    \( f(x)=\sin x\) \(\displaystyle \sum_{n=0}^∞(−1)^n\dfrac{x^{2n+1}}{(2n+1)!}\) \( −∞<∞\)>
    \( f(x)=\cos x\) \(\displaystyle \sum_{n=0}^∞(−1)^n\dfrac{x^{2n}}{(2n)!}\) \( −∞<∞\)>
    \( f(x)=\ln(1+x)\) \(\displaystyle \sum_{n=0}^∞(−1)^{n+1}\dfrac{x^n}{n}\) \( −1
    \( f(x)=\tan^{−1}x\) \(\displaystyle \sum_{n=0}^∞(−1)^n\dfrac{x^{2n+1}}{2n+1}\) \( −1 \le x \le 1\)
    \( f(x)=(1+x)^r\) \(\displaystyle \sum_{n=0}^∞\binom{r}{n}x^n\) \( −1<1\)>
    Convergence at the endpoints
    depends on the value of \(r\)

    Earlier in the chapter, we showed how you could combine power series to create new power series. Here we use these properties, combined with the Maclaurin series in Table \(\PageIndex{1}\), to create Maclaurin series for other functions.

    Example \( \PageIndex{2}\): Deriving Maclaurin Series from Known Series

    Find the Maclaurin series of each of the following functions by using one of the series listed in Table \(\PageIndex{1}\).

    1. \( f(x)=\cos\sqrt{x}\)
    2. \( f(x)=\sinh x\)
    Solution

    a. Using the Maclaurin series for \( \cos x\) we find that the Maclaurin series for \( \cos\sqrt{x}\) is given by

    \(\displaystyle \sum_{n=0}^∞\dfrac{(−1)^n(\sqrt{x})^{2n}}{(2n)!}=\sum_{n=0}^∞\dfrac{(−1)^nx^n}{(2n)!}=1−\dfrac{x}{2!}+\dfrac{x^2}{4!}−\dfrac{x^3}{6!}+\dfrac{x^4}{8!}−⋯.\)

    This series converges to \( \cos\sqrt{x}\) for all \( x\) in the domain of \( \cos\sqrt{x}\); that is, for all \( x≥0\).

    b. To find the Maclaurin series for \( \sinh x,\) we use the fact that

    \( \sinh x=\dfrac{e^x−e^{−x}}{2}.\)

    Using the Maclaurin series for \( e^x\), we see that the \(n^{\text{th}}\) term in the Maclaurin series for \(\sinh x\) is given by

    \( \dfrac{x^n}{n!}−\dfrac{(−x)^n}{n!}.\)

    For \( n\) even, this term is zero. For \( n\) odd, this term is \( \dfrac{2x^n}{n!}\). Therefore, the Maclaurin series for \(\sinh x\) has only odd-order terms and is given by

    \(\displaystyle \sum_{n=0}^∞\dfrac{x^{2n+1}}{(2n+1)!}=x+\dfrac{x^3}{3!}+\dfrac{x^5}{5!}+⋯.\)

    Exercise \(\PageIndex{2}\)

    Find the Maclaurin series for \( \sin(x^2).\)

    Hint

    Use the Maclaurin series for \( \sin x.\)

    Answer

    \(\displaystyle \sum_{n=0}^∞\dfrac{(−1)^nx^{4n+2}}{(2n+1)!}\)

    We also showed previously in this chapter how power series can be differentiated term by term to create a new power series. In Example \(\PageIndex{3}\), we differentiate the binomial series for \( \sqrt{1+x}\) term by term to find the binomial series for \( \dfrac{1}{\sqrt{1+x}}\). Note that we could construct the binomial series for \( \dfrac{1}{\sqrt{1+x}}\) directly from the definition, but differentiating the binomial series for \( \sqrt{1+x}\) is an easier calculation.

    Example \(\PageIndex{3}\): Differentiating a Series to Find a New Series

    Use the binomial series for \( \sqrt{1+x}\) to find the binomial series for \( \dfrac{1}{\sqrt{1+x}}\).

    Solution

    The two functions are related by

    \( \dfrac{d}{dx}\sqrt{1+x}=\dfrac{1}{2\sqrt{1+x}}\),

    so the binomial series for \( \dfrac{1}{\sqrt{1+x}}\) is given by

    \(\displaystyle \dfrac{1}{\sqrt{1+x}}=2\dfrac{d}{dx}\sqrt{1+x}=1+\sum_{n=1}^∞\dfrac{(−1)^n}{n!}\dfrac{1⋅3⋅5⋯(2n−1)}{2^n}x^n.\)

    Exercise \(\PageIndex{3}\)

    Find the binomial series for \( f(x)=\dfrac{1}{(1+x)^{3/2}}\)

    Hint

    Differentiate the series for \( \dfrac{1}{\sqrt{1+x}}\)

    Answer

    \(\displaystyle \sum_{n=0}^∞\dfrac{(−1)^n}{n!}\dfrac{1⋅3⋅5⋯(2n+1)}{2^n}x^n\)

    In this example, we differentiated a known Taylor series to construct a Taylor series for another function. The ability to differentiate power series term by term makes them a powerful tool for solving differential equations. We now show how this is accomplished.

    Solving Differential Equations with Power Series

    Consider the differential equation

    \[y′(x)=y.\nonumber \]

    Recall that this is a first-order separable equation and its solution is \(y=Ce^x\). This equation is easily solved using techniques discussed earlier in the text. For most differential equations, however, we do not yet have analytical tools to solve them. Power series are an extremely useful tool for solving many types of differential equations. In this technique, we look for a solution of the form \(\displaystyle y=\sum_{n=0}^∞c_nx^n\) and determine what the coefficients would need to be. In the next example, we consider an initial-value problem involving \(y′=y\) to illustrate the technique.

    Example \( \PageIndex{4}\): Power Series Solution of a Differential Equation

    Use power series to solve the initial-value problem \(y′=y,\quad y(0)=3.\)

    Solution

    Suppose that there exists a power series solution

    \(\displaystyle y(x)=\sum_{n=0}^∞c_nx^n=c_0+c_1x+c_2x^2+c_3x^3+c_4x^4+⋯.\)

    Differentiating this series term by term, we obtain

    \( y′=c_1+2c_2x+3c_3x^2+4c_4x^3+⋯.\)

    If \(y\) satisfies the differential equation, then

    \( c_0+c_1x+c_2x^2+c_3x^3+⋯=c_1+2c_2x+3c_3x^2+4c_3x^3+⋯.\)

    Using the uniqueness of power series representations, we know that these series can only be equal if their coefficients are equal. Therefore,

    \( c_0=c_1,\)

    \( c_1=2c_2,\)

    \( c_2=3c_3,\)

    \( c_3=4c_4,\)

    Using the initial condition \( y(0)=3\) combined with the power series representation

    \( y(x)=c_0+c_1x+c_2x^2+c_3x^3+⋯\),

    we find that \( c_0=3\). We are now ready to solve for the rest of the coefficients. Using the fact that \( c_0=3\), we have

    \[\begin{align*} c_1&=c_0=3=\dfrac{3}{1!},\\[5pt]
    c_2&=\dfrac{c_1}{2}=\dfrac{3}{2}=\dfrac{3}{2!},\\[5pt]
    c_3&=\dfrac{c_2}{3}=\dfrac{3}{3⋅2}=\dfrac{3}{3!},\\[5pt]
    c_4&=\dfrac{c_3}{4}=\dfrac{3}{4⋅3⋅2}=\dfrac{3}{4!}.\end{align*}\]

    Therefore,

    \[y=3\left[1+\dfrac{1}{1!}x+\dfrac{1}{2!}x^2+\dfrac{1}{3!}x^3\dfrac{1}{4!}x^4+⋯\right]=3\sum_{n=0}^∞\dfrac{x^n}{n!}.\nonumber \]

    You might recognize

    \[\sum_{n=0}^∞\dfrac{x^n}{n!}\nonumber \]

    as the Taylor series for \( e^x\). Therefore, the solution is \( y=3e^x\).

    Exercise \(\PageIndex{4}\)

    Use power series to solve \( y′=2y,\quad y(0)=5.\)

    Hint

    The equations for the first several coefficients \( c_n\) will satisfy \( c_0=2c_1,\,c_1=2⋅2c_2,\,c_2=2⋅3c_3,\,….\) In general, for all \( n≥0,\;c_n=2(n+1)C_{n+1}\).

    Answer

    \( y=5e^{2x}\)

    We now consider an example involving a differential equation that we cannot solve using previously discussed methods. This differential equation

    \[y''−xy=0\nonumber \]

    is known as Airy’s equation. It has many applications in mathematical physics, such as modeling the diffraction of light. Here we show how to solve it using power series.

    Example \( \PageIndex{5}\): Power Series Solution of Airy’s Equation

    Use power series to solve \(y''−xy=0\) with the initial conditions \( y(0)=a\) and \( y'(0)=b.\)

    Solution

    We look for a solution of the form

    \[y=\sum_{n=0}^∞c_nx^n=c_0+c_1x+c_2x^2+c_3x^3+c_4x^4+⋯\nonumber \]

    Differentiating this function term by term, we obtain

    \[\begin{align*} y′&=c_1+2c_2x+3c_3x^2+4c_4x^3+⋯,\\[4pt]
    y''&=2⋅1c_2+3⋅2c_3x+4⋅3c_4x^2+⋯.\end{align*}\]

    If \(y\) satisfies the equation \( y''=xy\), then

    \( 2⋅1c_2+3⋅2c_3x+4⋅3c_4x^2+⋯=x(c_0+c_1x+c_2x^2+c_3x^3+⋯).\)

    Using the Uniqueness of Power Series Theorem (from an earlier Section) on the uniqueness of power series representations, we know that coefficients of the same degree must be equal. Therefore,

    \( 2⋅1c_2=0,\)

    \( 3⋅2c_3=c_0,\)

    \( 4⋅3c_4=c_1,\)

    \( 5⋅4c_5=c_2,\)

    More generally, for \( n≥3\), we have \( n⋅(n−1)c_n=c_{n−3}\). In fact, all coefficients can be written in terms of \( c_0\) and \( c_1\). To see this, first note that \( c_2=0\). Then

    \( c_3=\dfrac{c_0}{3⋅2}\),

    \( c_4=\dfrac{c_1}{4⋅3}\).

    For \( c_5,\,c_6,\,c_7\), we see that

    \[\begin{align*} c_5&=\dfrac{c_2}{5⋅4}=0,\\[5pt]
    c_6&=\dfrac{c_3}{6⋅5}=\dfrac{c_0}{6⋅5⋅3⋅2},\\[5pt]
    c_7&=\dfrac{c_4}{7⋅6}=\dfrac{c_1}{7⋅6⋅4⋅3}.\end{align*}\]

    Therefore, the series solution of the differential equation is given by

    \( y=c_0+c_1x+0⋅x^2+\dfrac{c_0}{3⋅2}x^3+\dfrac{c_1}{4⋅3}x^4+0⋅x^5+\dfrac{c_0}{6⋅5⋅3⋅2}x^6+\dfrac{c_1}{7⋅6⋅4⋅3}x^7+⋯.\)

    The initial condition \( y(0)=a\) implies \( c_0=a\). Differentiating this series term by term and using the fact that \( y′(0)=b\), we conclude that \( c_1=b\).

    Therefore, the solution of this initial-value problem is

    \( y=a\left(1+\dfrac{x^3}{3⋅2}+\dfrac{x^6}{6⋅5⋅3⋅2}+⋯\right)+b\left(x+\dfrac{x^4}{4⋅3}+\dfrac{x^7}{7⋅6⋅4⋅3}+⋯\right).\)

    Exercise \(\PageIndex{5}\)

    Use power series to solve \( y''+x^2y=0\) with the initial condition \( y(0)=a\) and \( y′(0)=b\).

    Hint

    The coefficients satisfy \( c_0=a,\,c_1=b,\,c_2=0,\,c_3=0,\) and for \( n≥4,\; n(n−1)c_n=−c_{n−4}\).

    Answer

    \(y=a\left(1−\dfrac{x^4}{3⋅4}+\dfrac{x^8}{3⋅4⋅7⋅8}−⋯\right)+b\left(x−\dfrac{x^5}{4⋅5}+\dfrac{x^9}{4⋅5⋅8⋅9}−⋯\right)\)

    Evaluating Non-elementary Integrals

    Solving differential equations is one common application of power series. We now turn to a second application. We show how power series can be used to evaluate integrals involving functions whose antiderivatives cannot be expressed using elementary functions.

    One integral that arises often in applications in probability theory is \(\displaystyle \int e^{−x^2}\,dx.\) Unfortunately, the antiderivative of the integrand \( e^{−x^2}\) is not an elementary function. By elementary function, we mean a function that can be written using a finite number of algebraic combinations or compositions of exponential, logarithmic, trigonometric, or power functions. We remark that the term “elementary function” is not synonymous with noncomplicated function. For example, the function \( f(x)=\sqrt{x^2−3x}+e^{x^3}−\sin(5x+4)\) is an elementary function, although not a particularly simple-looking function. Any integral of the form \(\displaystyle \int f(x)\,dx\) where the antiderivative of \( f\) cannot be written as an elementary function is considered a non-elementary integral.

    Non-elementary integrals cannot be evaluated using the basic integration techniques discussed earlier. One way to evaluate such integrals is by expressing the integrand as a power series and integrating term by term. We demonstrate this technique by considering \(\displaystyle \int e^{−x^2}\,dx.\)

    Example \(\PageIndex{6}\): Using Taylor Series to Evaluate a Definite Integral
    1. Express \(\displaystyle \int e^{−x^2}dx\) as an infinite series.
    2. Evaluate \(\displaystyle \int ^1_0e^{−x^2}dx\) to within an error of \( 0.01\).
    Solution

    a. The Maclaurin series for \( e^{−x^2}\) is given by

    \[\begin{align*} e^{−x^2}&=\sum_{n=0}^∞\dfrac{(−x^2)^n}{n!}\\[5pt]
    &=1−x^2+\dfrac{x^4}{2!}−\dfrac{x^6}{3!}+⋯+(−1)^n\dfrac{x^{2n}}{n!}+⋯\\[5pt]
    &=\sum_{n=0}^∞(−1)^n\dfrac{x^{2n}}{n!}.\end{align*}\]

    Therefore,

    \[\begin{align*} \int e^{−x^2}\,dx&=\int \left(1−x^2+\dfrac{x^4}{2!}−\dfrac{x^6}{3!}+⋯+(−1)^n\dfrac{x^{2n}}{n!}+⋯\right)\,dx\\[5pt]
    &=C+x−\dfrac{x^3}{3}+\dfrac{x^5}{5.2!}−\dfrac{x^7}{7.3!}+⋯+(−1)^n\dfrac{x^{2n+1}}{(2n+1)n!}+⋯.\end{align*}\]

    b. Using the result from part a. we have

    \[ \int ^1_0e^{−x^2}\,dx=1−\dfrac{1}{3}+\dfrac{1}{10}−\dfrac{1}{42}+\dfrac{1}{216}−⋯.\nonumber \]

    The sum of the first four terms is approximately \( 0.74\). By the alternating series test, this estimate is accurate to within an error of less than \( \dfrac{1}{216}≈0.0046296<0.01.\)

    Exercise \(\PageIndex{6}\)

    Express \(\displaystyle \int \cos\sqrt{x}\,dx\) as an infinite series. Evaluate \(\displaystyle \int ^1_0\cos\sqrt{x}\,dx\) to within an error of \( 0.01\).

    Hint

    Use the series found in Example \(\PageIndex{2}\).

    Answer

    \(\displaystyle C+\sum_{n=1}^∞(−1)^{n+1}\dfrac{x^n}{n(2n−2)!}\) The definite integral is approximately \( 0.764\) to within an error of \( 0.01\).

    As mentioned above, the integral \(\displaystyle \int e^{−x^2}\,dx\) arises often in probability theory. Specifically, it is used when studying data sets that are normally distributed, meaning the data values lie under a bell-shaped curve. For example, if a set of data values is normally distributed with mean \( μ\) and standard deviation \( σ\), then the probability that a randomly chosen value lies between \( x=a\) and \( x=b\) is given by

    \[\dfrac{1}{σ\sqrt{2π}}\int ^b_ae^{−(x−μ)^2/(2σ^2)}\,dx.\label{probeq} \]

    (See Figure \(\PageIndex{2}\).)

    This graph is the normal distribution. It is a bell-shaped curve with the highest point above mu on the x-axis. Also, there is a shaded area under the curve above the x-axis. The shaded area is bounded by alpha on the left and b on the right.
    Figure \(\PageIndex{2}\): If data values are normally distributed with mean \( μ\) and standard deviation \( σ\), the probability that a randomly selected data value is between \(a\) and \(b\) is the area under the curve \( y=\dfrac{1}{σ\sqrt{2π}}e^{−(x−μ)^2/(2σ^2)}\) between \( x=a\) and \( x=b\).

    To simplify this integral, we typically let \( z=\dfrac{x−μ}{σ}\). This quantity \(z\) is known as the \(z\) score of a data value. With this simplification, integral Equation \ref{probeq} becomes

    \[\dfrac{1}{\sqrt{2π}}\int ^{(b−μ)/σ}_{(a−μ)/σ}e^{−z^2/2}\,dz. \nonumber \]

    In Example \(\PageIndex{7}\), we show how we can use this integral in calculating probabilities.

    Example \(\PageIndex{7}\): Using Maclaurin Series to Approximate a Probability

    Suppose a set of standardized test scores are normally distributed with mean \( μ=100\) and standard deviation \( σ=50\). Use Equation \ref{probeq} and the first six terms in the Maclaurin series for \( e^{−x^2/2}\) to approximate the probability that a randomly selected test score is between \( x=100\) and \( x=200\). Use the alternating series test to determine how accurate your approximation is.

    Solution

    Since \( μ=100,σ=50,\) and we are trying to determine the area under the curve from \( a=100\) to \( b=200\), integral Equation \ref{probeq} becomes

    \[ \dfrac{1}{\sqrt{2π}}\int ^2_0e^{−z^2/2}\,dz.\label{probeqEx7} \]

    The Maclaurin series for \( e^{−x^2/2}\) is given by

    \[ \begin{align*} e^{−x^2/2}&=\sum_{n=0}^∞\dfrac{\left(−\dfrac{x^2}{2}\right)^n}{n!}\\[5pt]
    &=1−\dfrac{x^2}{2^1⋅1!}+\dfrac{x^4}{2^2⋅2!}−\dfrac{x^6}{2^3⋅3!}+⋯+(−1)^n\dfrac{x^{2n}}{2^n⋅n}!+⋯\\[5pt]
    &=\sum_{n=0}^∞(−1)^n\dfrac{x^{2n}}{2^n⋅n!}.\end{align*}\]

    Therefore,

    \[\begin{align*} \dfrac{1}{\sqrt{2π}}\int e^{−z^2/2}\,dz&=\dfrac{1}{\sqrt{2π}}\int \left(1−\dfrac{z^2}{2^1⋅1!}+\dfrac{z^4}{2^2⋅2!}−\dfrac{z^6}{2^3⋅3!}+⋯+(−1)^n\dfrac{z^{2n}}{2^n⋅n!}+⋯\right)dz\\[5pt]
    &=\dfrac{1}{\sqrt{2π}}\left(C+z−\dfrac{z^3}{3⋅2^1⋅1!}+\dfrac{z^5}{5⋅2^2⋅2!}−\dfrac{z^7}{7⋅2^3⋅3!}+⋯+(−1)^n\dfrac{z^{2n+1}}{(2n+1)2^n⋅n!}+⋯\right)\end{align*}\]

    We now use this result to evaluate the definite integral from Equation \ref{probeqEx7}:
    \[\dfrac{1}{\sqrt{2π}}\int ^2_0e^{−z^2/2}\,dz=\dfrac{1}{\sqrt{2π}}\left(2−\dfrac{8}{6}+\dfrac{32}{40}−\dfrac{128}{336}+\dfrac{512}{3456}−\dfrac{2^{11}}{11⋅2^5⋅5!}+⋯\right)\nonumber \]

    Using the first five terms, we estimate that the probability is approximately 0.4729. By the alternating series test, we see that this estimate is accurate to within

    \[ \dfrac{1}{\sqrt{2π}}\dfrac{2^{13}}{13⋅2^6⋅6!}≈0.00546.\nonumber \]

    Analysis

    If you are familiar with probability theory, you may know that the probability that a data value is within two standard deviations of the mean is approximately \( 95\%.\) Here we calculated the probability that a data value is between the mean and two standard deviations above the mean, so the estimate should be around \( 47.5\%\). The estimate, combined with the bound on the accuracy, falls within this range.

    Alternative method. If term-by-term integration is done instead, the result of evaluating the definite integral is

    \(\displaystyle \ \dfrac{1}{\sqrt{2π}} \sum_{n=0}^∞\dfrac{ (-1)^n}{2^n n!} \int ^2_0 z^{2n}\; dz =\displaystyle \ \dfrac{1}{\sqrt{2π}} \sum_{n=0}^∞\dfrac{ (-1)^n}{(2n+1)2^n n!} \left[ 2^{2n+1}-0^{2n+1} \right] =\displaystyle \ \dfrac{1}{\sqrt{2π}} \sum_{n=0}^∞\dfrac{ (-1)^n 2^{n+1}}{ n!(2n+1)} \)

    \(=\dfrac{1}{\sqrt{2π}}\left(\dfrac{2}{1\cdot 0! }−\dfrac{4}{3 \cdot 1! }+\dfrac{8}{5 \cdot 2! }−\dfrac{16}{7 \cdot 3!}+\dfrac{32}{ 9 \cdot 4!}−\dfrac{64}{11 \cdot 5! }+⋯\right) \)
    \(=\dfrac{1}{\sqrt{2π}}\left(2−\dfrac{4}{3}+\dfrac{4}{5}−\dfrac{8}{21}+\dfrac{4}{27}−\dfrac{8}{165}+⋯\right) \)

    Exercise \(\PageIndex{7}\)

    Given a set of normally distributed standardized test scores with mean \( μ=100\) and standard deviation \( σ=50\), use the first five terms of the Maclaurin series for \( e^{−x^2/2}\) to estimate the probability that a randomly selected test score is between \( 100\) and \( 150\). Use the alternating series test to determine the accuracy of this estimate.

    Hint

    Evaluate \(\displaystyle \int ^1_0e^{−z^2/2}\,dz\) using the first five terms of the Maclaurin series for \( e^{−z^2/2}\).

    Answer

    The estimate is approximately \( 0.3414.\) This estimate is accurate to within \( 0.0000094.\)

    Another application in which a non-elementary integral arises involves the period of a pendulum. The integral is

    \[\int ^{π/2}_0\dfrac{dθ}{\sqrt{1−k^2\sin^2θ}}\nonumber \].

    An integral of this form is known as an elliptic integral of the first kind. Elliptic integrals originally arose when trying to calculate the arc length of an ellipse. We now show how to use power series to approximate this integral.

    Example \( \PageIndex{8}\): Period of a Pendulum

    The period of a pendulum is the time it takes for a pendulum to make one complete back-and-forth swing. For a pendulum with length \( L\) that makes a maximum angle \( θ_{max}\) with the vertical, its period \( T\) is given by

    \[ T=4\sqrt{\dfrac{L}{g}}\int ^{π/2}_0\dfrac{dθ}{\sqrt{1−k^2\sin^2θ}}\nonumber \]

    where \( g\) is the acceleration due to gravity and \( k=\sin\left(\dfrac{θ_{max}}{2}\right)\) (see Figure \(\PageIndex{3}\)). (We note that this formula for the period arises from a non-linearized model of a pendulum. In some cases, for simplification, a linearized model is used and \(\sin θ\) is approximated by \( θ\).)

    This figure is a pendulum. There are three positions of the pendulum shown. When the pendulum is to the far left, it is labeled negative theta max. When the pendulum is in the middle and vertical, it is labeled equilibrium position. When the pendulum is to the far right it is labeled theta max. Also, theta is the angle from equilibrium to the far right position. The length of the pendulum is labeled L.
    Figure \(\PageIndex{3}\): This pendulum has length \( L\) and makes a maximum angle \( θ_{max}\) with the vertical.

    Use the binomial series

    \[ \dfrac{1}{\sqrt{1+x}}=1+\sum_{n=1}^∞\dfrac{(−1)^n}{n!}\dfrac{1⋅3⋅5⋯(2n−1)}{2^n}x^n\nonumber \]

    to estimate the period of this pendulum. Specifically, approximate the period of the pendulum if

    1. you use only the first term in the binomial series, and
    2. you use the first two terms in the binomial series.
    Solution

    We use the binomial series, replacing x with \( −k^2\sin^2θ.\) Then we can write the period as

    \[ T=4\sqrt{\dfrac{L}{g}}\int ^{π/2}_0\left(1+\dfrac{1}{2}k^2\sin^2θ+\dfrac{1⋅3}{2!2^2}k^4\sin^4θ+⋯\right)\,dθ.\nonumber \]

    a. Using just the first term in the integrand, the first-order estimate is

    \[ T≈4\sqrt{\dfrac{L}{g}}\int ^{π/2}_0\,dθ=2π\sqrt{\dfrac{L}{g}}.\nonumber \]

    If \( θ_{max}\) is small, then \( k=\sin\left(\dfrac{θ_{max}}{2}\right)\) is small. We claim that when \( k\) is small, this is a good estimate. To justify this claim, consider

    \[ \int ^{π/2}_0\left(1+\frac{1}{2}k^2\sin^2θ+\dfrac{1⋅3}{2!2^2}k^4\sin^4θ+⋯\right)\,dθ.\nonumber \]

    Since \( |\sin x|≤1\), this integral is bounded by

    \[ \int ^{π/2}_0\left(\dfrac{1}{2}k^2+\dfrac{1.3}{2!2^2}k^4+⋯\right)\,dθ\;<\;\dfrac{π}{2}\left(\dfrac{1}{2}k^2+\dfrac{1⋅3}{2!2^2}k^4+⋯\right).\nonumber \]

    Furthermore, it can be shown that each coefficient on the right-hand side is less than \( 1\) and, therefore, that this expression is bounded by

    \( \dfrac{πk^2}{2}(1+k^2+k^4+⋯)=\dfrac{πk^2}{2}⋅\dfrac{1}{1−k^2}\),

    which is small for \( k\) small.

    b. For larger values of \( θ_{max}\), we can approximate \( T\) by using more terms in the integrand. By using the first two terms in the integral, we arrive at the estimate

    \[ T≈4\sqrt{\frac{L}{g}}\int ^{π/2}_0\left(1+\dfrac{1}{2}k^2\sin^2θ\right)\,dθ=2π\sqrt{\dfrac{L}{g}}\left(1+\dfrac{k^2}{4}\right).\nonumber \]

    The applications of Taylor series in this section are intended to highlight their importance. In general, Taylor series are useful because they allow us to represent known functions using polynomials, thus providing us a tool for approximating function values and estimating complicated integrals. In addition, they allow us to define new functions as power series, thus providing us with a powerful tool for solving differential equations.

    Key Concepts

    • The binomial series is the Maclaurin series for \( f(x)=(1+x)^r\). It converges for \( |x|<1\).
    • Taylor series for functions can often be derived by algebraic operations with a known Taylor series or by differentiating or integrating a known Taylor series.
    • Power series can be used to solve differential equations.
    • Taylor series can be used to help approximate integrals that cannot be evaluated by other means.

    Glossary

    binomial series
    the Maclaurin series for \( f(x)=(1+x)^r\); it is given by \(\displaystyle (1+x)^r=\sum_{n=0}^∞\binom{r}{n}x^n=1+rx+\dfrac{r(r−1)}{2!}x^2+⋯+\dfrac{r(r−1)⋯(r−n+1)}{n!}x^n+⋯\) for \( |x|<1\)
    non-elementary integral
    an integral for which the antiderivative of the integrand cannot be expressed as an elementary function

    This page titled 11.10: Taylor and Maclaurin Series is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Gilbert Strang & Edwin “Jed” Herman (OpenStax) via source content that was edited to the style and standards of the LibreTexts platform.