Calculus II Home

Taylor Series

    


A function \(f\) may or may not have a power series representation. But if it has one, we can find it explicitly.

Theorem. Suppose that a function \(f\) is infinitely differentiable at \(c\) and \(f\) has a power series representation about \(c\): \[ f(x)=\sum_{n=0}^{\infty} a_n (x-c)^n,\; |x-c| < R.\] Then \(a_n=\displaystyle\frac{f^{(n)}(c)}{n!},\; n\geq 0\), i.e., \[f(x)=\sum_{n=0}^{\infty} \frac{f^{(n)}(c)}{n!} (x-c)^n =f(c)+\frac{f'(c)}{1!}(x-c)+\frac{f''(c)}{2!}(x-c)^2+\frac{f'''(c)}{3!}(x-c)^3+\cdots.\]

Plugging \(x=c\) in \(f(x)=\displaystyle\sum_{n=0}^{\infty} a_n (x-c)^n\), we get \(a_0=f(c)\). Taking derivative of \(f\) at \(c\), we have \[f'(c)=\sum_{n=1}^{\infty} a_n n(x-c)^{n-1} \Big\vert_{x=c} \implies a_1=f'(c).\] Similarly taking \(k\)th derivative of \(f\) at \(c\), we have \[f^{(k)}(c)=\sum_{n=k}^{\infty} a_n n!(x-c)^{n-k} \Big\vert_{x=c} \implies f^{(k)}(c)=k!a_k \implies a_k=\frac{f^{(k)}(c)}{k!}.\]

Definition. The Taylor Series of \(f\) about \(c\) is \[\sum_{n=0}^{\infty} \frac{f^{(n)}(c)}{n!} (x-c)^n =f(c)+\frac{f'(c)}{1!}(x-c)+\frac{f''(c)}{2!}(x-c)^2+\frac{f'''(c)}{3!}(x-c)^3+\cdots.\] The Maclaurin Series of \(f\) is the Taylor Series of \(f\) about \(0\): \[\sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} x^n =f(0)+\frac{f'(0)}{1!}x+\frac{f''(0)}{2!}x^2+\frac{f'''(0)}{3!}x^3+\cdots.\]

Example.

  1. Find the Taylor Series of \(f(x)=e^x\) about \(2\).

  2. Find the Maclaurin Series of \(f(x)=e^x\).

Solution.

  1. Since \(f^{(n)}(x)=e^x\) for all integers \(n\geq 0\), \(f^{(n)}(2)=e^2\) for all integers \(n\geq 0\). Then the Taylor Series of \(f(x)=e^x\) about \(2\) is \[\sum_{n=0}^{\infty} \frac{f^{(n)}(2)}{n!} (x-2)^n =\sum_{n=0}^{\infty} \frac{e^2}{n!} (x-2)^n =e^2+\frac{e^2}{1!}(x-2)+\frac{e^2}{2!}(x-2)^2+\frac{e^2}{3!}(x-2)^3+\cdots.\]
  2. Since \(f^{(n)}(0)=e^0=1\) for all integers \(n\geq 0\), the Maclaurin Series of \(f(x)=e^x\) is \[\sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} x^n =\sum_{n=0}^{\infty} \frac{1}{n!} x^n =1+\frac{x}{1!}+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots.\] Note that if \(f(x)=e^x\) has a power series representation about \(0\), then \[e^x=\sum_{n=0}^{\infty} \frac{x^n}{n!} =1+\frac{x}{1!}+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots.\]


Question. When does a function \(f\) have a power series representation? When is \(f(x)\) equal to its Taylor series?

To answer these questions, we define the \(n\)th degree Taylor polynomial of \(f\) about \(c\), denoted by \(T_n\), as \[T_n(x)=\sum_{i=0}^{n} \frac{f^{(i)}(c)}{i!} (x-c)^i =f(c)+\frac{f'(c)}{1!}(x-c)+\frac{f''(c)}{2!}(x-c)^2+\cdots+\frac{f^{(n)}(c)}{n!}(x-c)^n.\] We define the corresponding remainder, denoted by \(R_n\), as \(R_n(x)=f(x)-T_n(x)\). Then \[f(x)=T_n(x)+R_n(x).\] Taking limit as \(n\to \infty\), we have \[f(x)=\lim_{n\to \infty} T_n(x)+ \lim_{n\to \infty}R_n(x)=\sum_{n=0}^{\infty} \frac{f^{(n)}(c)}{n!} (x-c)^n +\lim_{n\to \infty}R_n(x) =\sum_{n=0}^{\infty} \frac{f^{(n)}(c)}{n!} (x-c)^n,\] when \(\displaystyle\lim_{n\to \infty}R_n(x)=0\).

Theorem. Suppose that a function \(f\) is infinitely differentiable at \(c\) with Taylor polynomial \(T_n\) about \(c\) and the remainder \(R_n\). If \(\displaystyle\lim_{n\to \infty}R_n(x)=0\) for all \(x\) satisfying \(|x-c| < R\), then \[f(x)=\sum_{n=0}^{\infty} \frac{f^{(n)}(c)}{n!} (x-c)^n,\; |x-c| < R.\]

It is difficult to show \(\displaystyle\lim_{n\to \infty}R_n(x)=0\). We use the following result:
Theorem. If \(M\) is a constant such that \(|f^{(n)}(x)|\leq M\) for all \(x\) satisfying \(|x-c| < R\), then \[|R_n(x)|\leq \frac{M}{(n+1)!} |x-c|^{n+1},\;|x-c| < R.\]


Example. Prove that \(f(x)=e^x\) is equal to its Maclaurin Series for all \(x\): \[e^x=\sum_{n=0}^{\infty} \frac{x^n}{n!} =1+\frac{x}{1!}+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots.\]
Solution. Let \(R\) be an arbitrary positive real number. It suffices to show that \(f(x)=e^x\) is equal to its Maclaurin Series for all \(x\) satisfying \(|x| < R\).
Since \(f^{(n)}(x)=e^x\) for all integers \(n\geq 0\), \(|f^{(n)}(x)|\leq e^R\) for all \(x\) satisfying \(|x| < R\). Then by the preceding theorem, \[|R_n(x)|\leq \frac{e^R}{(n+1)!} |x|^{n+1},\;|x| < R.\] Taking limit as \(n\to \infty\), we have \[0\leq \lim_{n\to \infty}|R_n(x)|\leq \lim_{n\to \infty}\frac{e^R}{(n+1)!} |x|^{n+1}=0 \implies \lim_{n\to \infty}|R_n(x)|=0,\;|x| < R.\] \[f(x)=\lim_{n\to \infty} T_n(x)+ \lim_{n\to \infty}R_n(x)=\sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} x^n=\sum_{n=0}^{\infty} \frac{x^n}{n!},\;|x| < R.\] Since \(R\) is an arbitrary positive real number, for all \(x\), \[e^x=\sum_{n=0}^{\infty} \frac{x^n}{n!} =1+\frac{x}{1!}+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots.\]


By arguments similar to that above, we have the following results: \[\begin{align*} \cos x =\sum_{n=0}^{\infty} (-1)^n\frac{x^{2n}}{(2n)!} &=1-\frac{x^2}{2!}+\frac{x^4}{4!}-\frac{x^6}{6!}+\cdots, \text{ for all } x \;(R=\infty)\\ \sin x =\sum_{n=0}^{\infty} (-1)^n\frac{x^{2n+1}}{(2n+1)!} &=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\cdots, \text{ for all } x \;(R=\infty)\\ \tan^{-1} x =\sum_{n=0}^{\infty} (-1)^n\frac{x^{2n+1}}{2n+1} &=x-\frac{x^3}{3}+\frac{x^5}{5}-\frac{x^7}{7}+\cdots, \text{ for } |x|<1 \;(R=1)\\ \ln(1+x) =\sum_{n=1}^{\infty} (-1)^{(n-1)}\frac{x^n}{n} &=x-\frac{x^2}{2}+\frac{x^3}{3}-\frac{x^4}{4}+\cdots, \text{ for } |x|<1 \;(R=1) \end{align*}\]


Example. Write \(\displaystyle\int e^{-x^2}\;dx\) and \(\displaystyle\int_0^1 e^{-x^2}\;dx\) as infinite series.

Solution. We know that \(e^x=\displaystyle\sum_{n=0}^{\infty} \frac{x^n}{n!}\) for all \(x\). Substituting \(x\) by \(-x^2\), we get \[e^{-x^2}=\sum_{n=0}^{\infty} \frac{(-x^2)^n}{n!} =\sum_{n=0}^{\infty} (-1)^n \frac{x^{2n}}{n!} =1-\frac{x^2}{1!}+\frac{x^4}{2!}-\frac{x^6}{3!}+\cdots.\] By term by term integration, we have \[\int e^{-x^2} \;dx=\int\left[\sum_{n=0}^{\infty} (-1)^n \frac{x^{2n}}{n!} \right]dx =\sum_{n=0}^{\infty} \left[ \int (-1)^n\frac{x^{2n}}{n!}\;dx \right] =C+\sum_{n=0}^{\infty} (-1)^n \frac{x^{2n+1}}{n!(2n+1)}.\] \[\int_0^1 e^{-x^2} \;dx =\left. C+\sum_{n=0}^{\infty} (-1)^n \frac{x^{2n+1}}{n!(2n+1)} \right\vert_0^1 =\sum_{n=0}^{\infty} \frac{(-1)^n}{n!(2n+1)}.\] Note that we can approximate \(\displaystyle\int_0^1 e^{-x^2}\;dx\) by truncating the above series after a few terms. \[\int_0^1 e^{-x^2} \;dx \approx\sum_{n=0}^{2} \frac{(-1)^n}{n!(2n+1)} =\frac{1}{1}-\frac{1}{3}+\frac{1}{10}=\frac{23}{30}.\]


Last edited