zoukankan      html  css  js  c++  java
  • MOOCULUS微积分-2: 数列与级数学习笔记 7. Taylor series

    此课程(MOOCULUS-2 "Sequences and Series")由Ohio State University于2014年在Coursera平台讲授。

    PDF格式教材下载 Sequences and Series

    本系列学习笔记PDF下载(Academia.edu) MOOCULUS-2 Solution

    Summary

    • Given a function $f$, the series $$sum_{n=0}^infty {f^{(n)}(0)over n!}x^n$$ is called the Maclaurin series for $f$, or often just the Taylor series for $f$ centered around zero.
    • Given a function $f$, the series $$sum_{n=0}^infty {f^{(n)}(c)over n!}(x-c)^n$$ is called the Taylor series for $f$ centered around $c$.
    • Taylor's Theorem
      Suppose that $f$ is defined on some open interval $I = (a-R,a+R)$ around $a$ and suppose the function $f$ is $(N+1)$-times differentiable on $I$, meaning that $f^{(N+1)}(x)$ exists for $xin I$. Then for each $x eq a$ in $I$ there is a value $z$ between $x$ and $a$ so that $$f(x) = sum_{n=0}^N {f^{(n)}(a)over n!}\,(x-a)^n + {f^{(N+1)}(z)over (N+1)!}(x-a)^{N+1}.$$
    • Common functions: $$e^x=sum_{n=0}^{infty}{1over n!}x^n=1+x+{x^2over2!}+{x^3over3!}+cdotscdots, ext{for all} x$$ $${1over1-x}=sum_{n=0}^{infty}x^n=1+x+x^2+x^3+cdotscdots, ext{for} |x| < 1$$ $$log(1+x)=sum_{n=1}^{infty}{(-1)^{n-1}over n}x^n=x-{1over2}x^2+{1over3}x^3+cdotscdots, ext{for} -1 < x leq 1$$ $$sin x=sum_{n=0}^{infty}{(-1)^nover(2n+1)!}x^{2n+1}=x-{x^3over3!}+{x^5over5!} +cdotscdots, ext{for all} x$$ $$cos x=sum_{n=0}^{infty}{(-1)^nover(2n)!}x^{2n}=1-{x^2over2!}+{x^4over4!} +cdotscdots, ext{for all} x$$

    Exercises 7.1

    For each function, find the Taylor series centered at $c$, and the radius of convergence.

    1. $cos x$ around $c = 0$  

    Solution: $$f(0)=cos xig|_{x=0}=1$$ $$f'(0)=-sin xig|_{x=0}=0$$ $$f''(0)=-cos xig|_{x=0}=-1$$ $$f'''(0)=sin xig|_{x=0}=0$$ $$f^{(4)}(0)=cos xig|_{x=0}=1$$ $$cdotscdotscdotscdots$$ The Taylor series is $$cos x=1-{1over2!}x^2+{1over4!}x^4+cdots=sum_{n=0}^{infty}{(-1)^nover(2n)!}x^{2n}$$ And the radius of convergence is $${1over R}=lim_{n oinfty}{|a_{n+1}|over|a_n|}=lim_{n oinfty}{(2n)!over(2n+2)!}=lim_{n oinfty}{1over(2n+2)(2n+1)}=0$$ Thus $R=infty$.

    2. $e^x$ around $c = 0$  

    Solution: $$f(0)=e^xig|_{x=0}=1$$ $$f'(0)=e^xig|_{x=0}=1$$ $$cdotscdotscdotscdots$$ The Taylor series is $$e^x=1+x+{1over2!}x^2+cdots=sum_{n=0}^{infty}{x^nover n!}$$ The radius of convergence is $${1over R}=lim_{n oinfty}{|a_{n+1}|over|a_n|}=lim_{n oinfty}{n!over(n+1)!}=lim_{n oinfty}{1over n+1}=0$$ Thus $R=infty$.

    3. $1/x$ around $c=5$  

    Solution: $$f(5)={1over x}ig|_{x=5}={1over5}$$ $$f'(5)=-{1over x^2}ig|_{x=5}=-{1over25}$$ $$f''(5)={2over x^3}ig|_{x=5}={2over125}$$ $$f'''(5)={-6over x^4}ig|_{x=5}={-6over625}$$ $$cdotscdotscdotscdots$$ The Taylor series is $${1over x}={1over5}-{1over25}(x-5)+{1over125}(x-5)^2-{1over625}(x-5)^3+cdots=sum_{n=0}^{infty}{(-1)^nover5^{n+1}}(x-5)^n$$ The radius of convergence is $${1over R}=lim_{n oinfty}{|a_{n+1}|over|a_n|}=lim_{n oinfty}{5^{n+1}over5^{n+2}}={1over5}$$ Thus $R=5$.  

    4. $log x$ around $c=1$  

    Solution: $$f(1)=log xig|_{x=1}=0$$ $$f'(1)={1over x}ig|_{x=1}=1$$ $$f''(1)={-1over x^2}ig|_{x=1}=-1$$ $$f'''(1)={2over x^3}ig|_{x=1}=2$$ $$f^{(4)}(1)={-6over x^4}ig|_{x=1}=-6$$ $$cdotscdotscdotscdots$$ The Taylor series is $$log x=(x-1)-{1over2}(x-1)^2+{1over3}(x-1)^3-{1over4}(x-1)^4+cdots=sum_{n=1}^{infty}{(-1)^{n-1}over n}(x-1)^n$$ The radius of convergence is $${1over R}=lim_{n oinfty}{|a_{n+1}|over|a_n|}=lim_{n oinfty}{nover n+1}=1$$ Thus $R=1$.

    5. $log x$ around $c=2$  

    Solution: $$f(2)=log xig|_{x=2}=log2$$ $$f'(2)={1over x}ig|_{x=2}={1over2}$$ $$f''(2)={-1over x^2}ig|_{x=2}=-{1over4}$$ $$f'''(2)={2over x^3}ig|_{x=2}={1over4}$$ $$f^{(4)}(2)={-6over x^4}ig|_{x=2}=-{3over8}$$ $$cdotscdotscdotscdots$$ The Taylor series is $$log x=log2+{1over2}(x-2)-{1over8}(x-2)^2+{1over24}(x-2)^3-{1over64}(x-2)^4cdots=log2+sum_{n=1}^infty {(-1)^{n-1}over ncdot2^n}(x-2)^n$$ The radius of convergence is $${1over R}=lim_{n oinfty}{|a_{n+1}|over|a_n|}=lim_{n oinfty}{ncdot2^nover(n+1)cdot2^{n+1}}={1over2}$$ Thus $R=2$.

    6. $1/x^2$ around $c=1$  

    Solution: $$f(1)={1over x^2}ig|_{x=1}=1$$ $$f'(1)={-2over x^3}ig|_{x=1}=-2$$ $$f''(1)={6over x^4}ig|_{x=1}=6$$ $$f'''(1)={-24over x^5}ig|_{x=1}=-24$$ $$cdotscdotscdotscdots$$ The Taylor series is $${1over x^2}=1-2(x-1)+3(x-1)^2-4(x-1)^3+cdots=sum_{n=0}^{infty}(-1)^n(n+1)(x-1)^n$$ The radius of convergence is $${1over R}=lim_{n oinfty}{|a_{n+1}|over|a_n|}=lim_{n oinfty}{n+2over n+1}=1$$ Thus $R=1$.

    7. $1/sqrt{1-x}$ around $c = 0$  

    Solution: $$f(0)=(1-x)^{-{1over2}}ig|_{x=0}=1$$ $$f'(0)={1over2}(1-x)^{-{3over2}}ig|_{x=0}={1over2}$$ $$f''(0)={3over4}(1-x)^{-{5over2}}ig|_{x=0}={3over4}={1cdot3over2^2}$$ $$f'''(0)={15over8}(1-x)^{-{7over2}}ig|_{x=0}={15over8}={1cdot3cdot5over2^3}$$ $$f^{(4)}(0)={105over16}(1-x)^{-{9over2}}ig|_{x=0}={105over16}={1cdot3cdot5cdot7over2^4}$$ $$cdotscdotscdotscdots$$ The Taylor series is $${1oversqrt{1-x}}=1+{1over2}x+{3over8}x^2+{5over16}x^3 +{35over128}x^4+cdots=1+sum_{n=1}^{infty}{1cdot3cdot5cdotscdot(2n-1)over2^ncdot n!}x^n$$ $$=1+sum_{n=1}^{infty}{(2n-1)!over2^ncdot n!cdot2cdot4cdotscdot(2n-2)}x^n$$ $$=1+sum_{n=1}^{infty}{(2n-1)!over2^{2n-1}cdot n!cdot(n-1)!}x^n$$ The radius of convergence is $${1over R}=lim_{n oinfty}{|a_{n+1}|over|a_n|}=lim_{n oinfty}{(2n+1)!over2^{2n+1}cdot(n+1)!cdot n!}cdot{2^{2n-1}cdot n!cdot(n-1)!over(2n-1)!}=lim_{n oinfty}{(2n+1)cdot2nover4cdot(n+1)n}=1$$ Thus $R=1$.

    8. Find the first four terms of the Taylor series for $ an x$ centered at zero. By "first four terms" I mean up to and including the $x^3$ term.

    Solution: $$f(0)= an xig|_{x=0}=0$$ $$f'(0)=sec^2 xig|_{x=0}=1$$ $$f''(0)=2sec^2 xcdot an xig|_{x=0}=0$$ $$f'''(0)=2cdot(2sec xcdot an xcdotsec xcdot an x+sec^2 xcdotsec^2 x)ig|_{x=0}=2$$ Thus the first four terms are $$ an x=x+{x^3over3}$$

    9. Use a combination of Taylor series and algebraic manipulation to find a series centered at zero for $xcos (x^2)$.  

    Solution:

    We know $$cos x=sum_{n=0}^{infty}{(-1)^nover(2n)!}x^{2n}$$ So $$cos x^2=sum_{n=0}^{infty}{(-1)^nover(2n)!}x^{4n}$$ Thus $$xcos x^2=sum_{n=0}^{infty}{(-1)^nover(2n)!}x^{4n+1}$$

    10. Use a combination of Taylor series and algebraic manipulation to find a series centered at zero for $xe^{-x}$.

    Solution:

    We know $$e^x=sum_{n=0}^{infty}{x^nover n!}$$ So $$e^{-x}=sum_{n=0}^{infty}{(-1)^nover n!}x^n$$ Thus $$xe^{-x}=sum_{n=0}^{infty}{(-1)^nover n!}x^{n+1}$$

    Exercises 7.2

    1. Find a polynomial approximation for $cos x$ on $[0,pi]$, accurate to $pm 10^{-3}$.

    Solution:

    By Taylor's theorem, we have $$cos x=sum_{n=0}^N {f^{(n)}(a)over n!}\,x^n +R_n(x)$$ where $R_n(x)={f^{(N+1)}(z)over (N+1)!}x^{N+1}$. So we have $$|R_n(x)|=ig|{f^{(N+1)}(z)over (N+1)!}x^{N+1}ig| < 0.001$$ Since $|f^{(N+1)}(z)|leq1$ and $xin [0, pi]$, we have $$ig|{x^{N+1}over(N+1)!}ig|leqig|{{pi}^{N+1}over(N+1)!}ig| < 0.001$$ Computing in R:

    f = function(x) pi^(x + 1) / factorial(x + 1)
    for (i in 0:100) {
      if (f(i) < 1 / 1000) {
        print(i)
        break
      }
    }
    # [1] 12
    

    That is, the polynomial approximation is $$cos x=1-{x^2over2}+{x^4over24}- {x^6over720}+cdots+{x^{12}over12!}$$

    2. How many terms of the series for $log x$ centered at 1 are required so that the guaranteed error on $[1/2,3/2]$ is at most $10^{-3}$? What if the interval is instead $[1,3/2]$?

    Solution:

    First, calculate the Taylor series of $log x$ centered at 1: $$f(1)=log xig|_{x=1}=0$$ $$f'(1)={1over x}ig|_{x=1}=1$$ $$f''(1)={-1over x^2}ig|_{x=1}=-1$$ $$f'''(1)={2over x^3}ig|_{x=1}=2$$ $$f^{(4)}(1)={-6over x^4}ig|_{x=1}=-6$$ $$cdotscdotscdots$$ $$f^{(n)}(1)={(-1)^{n-1}cdot(n-1)!over x^n}ig|_{x=1}=(-1)^{n-1}cdot(n-1)!$$ Thus $$log x=sum_{n=1}^{infty}{(-1)^{n-1}over n}(x-1)^n$$ By Taylor's theorem, we have $$R_{n}(x)=ig|{f^{(N+1)}(z)over(N+1)!}(x-1)^{N+1}ig| < 0.001$$ where $xin[{1over2},{3over2}]$, so $x-1in[-{1over2}, {1over2}]$, we hope to maximize $R_n(x)$, that is $$R_n(x) leq ig|{(-1)^{N}cdot N!over(N+1)!cdot ({1over2})^{N+1}}cdot({1over2})^{N+1}ig|={1over N+1} < 0.001Rightarrow N=1000$$ If the interval is $[1, {3over2}]$, similarly we have $x-1in[0, {1over2}]$, and $$R_n(x) leq ig|{(-1)^{N}cdot N!over(N+1)!cdot 1^{N+1}}cdot({1over2})^{N+1}ig|={({1over2})^{N+1}over N+1} < 0.001Rightarrow N=7$$ R code:

    f = function(x) 0.5^(x + 1) / (x + 1)
    for (i in 0:1e7) {
      if (f(i) < 0.001) {
        print(i)
        break
      }
    }
    # [1] 7
    

    3. Find the first three nonzero terms in the Taylor series for $ an x$ on $[-pi/4,pi/4]$, and compute the guaranteed error term as given by Taylor's theorem. (You may want to use Sage or a similar aid.)

    Solution: $$f(x)= an xig|_{x=0}=0$$ $$f'(x)=sec^2 xig|_{x=0}=1$$ $$f''(x)=2 an xsec^2 xig|_{x=0}=0$$ $$f'''(x)=2sec^4x+4 an^2xsec^2xig|_{x=0}=2$$ $$f^{(4)}(x)=16 an xsec^4x+8 an^3xsec^2xig|_{x=0}=0$$ $$f^{(5)}(x)=16sec^6x+64 an^2xsec^4x+24 an^2xsec^4x+16 an^4xsec^2xig|_{x=0}=16$$ Additionally, we need to calculate the $7^{ ext{th}}$ derivative of $ an x$: $$f^{(6)}(x)=272sec^6x an x+416sec^4x an^3x+ 32sec^2x an^5x$$ $$f^{(7)}(x)=272sec^8x+2880 an^2xsec^6x +1824 an^4xsec^4x+64 an^6xsec^2x$$ Thus the Taylor series is $$ an x=x+{x^3over3}+{2x^5over15}+R_{n}(x)$$ where $R_n(x)={f^{(N+1)}(z)over(N+1)!}x^{N+1}$. Since $xin[-{piover4}, {piover4}]$, and both of $ an x$ and $sec x$ are increasing on $[0, {piover4}]$. We have $$R_n(x) leq ig|{f^{(7)}({piover4})over7!}cdot({piover4})^7ig|={34816over7!}cdot({piover4})^7doteq1.273437$$ Thus the error is $pm1.273437$.

    4. Prove: For all real numbers $x$, $$cos x = sum_{n=0}^infty frac{(-1)^n}{(2n)!} x^{2n}$$

    Solution:

    By Taylor's theorem, we have $$cos x=sum_{n=0}^{N}{f^{(n)}(0)over n!}x^n+R_n(x)$$ where $R_n(x)={f^{(N+1)}(z)over(N+1)!}x^{N+1}$. We need to prove that $$lim_{n oinfty}R_n(x)=0$$ Since the derivative of $cos x$ is no larger than 1. So $$ig|R_n(x)ig|=ig|{f^{(N+1)}(z)over(N+1)!}x^{N+1}ig|leqig|{x^{N+1}over(N+1)!}ig|$$ And $$lim_{n oinfty}{d^nover n!}=0$$ for any $d$ since $sum_{n=0}^{infty}{x^nover n!}$ converges for all $x$ (by ratio test can obtain that $1/R=0$). Thus the right hand of the above inequality converges to 0 when $N$ is closing to $infty$. That is $$lim_{n oinfty}R_n(x)=0$$ Therefore, $cos x$ is euqal to its Taylor series: $$cos x = sum_{n=0}^infty frac{(-1)^n}{(2n)!} x^{2n}$$

    5. Prove: For all real numbers $x$, $$e^x = sum_{n=0}^infty frac{1}{n!} x^{n}$$

    Solution:

    This proof is quite similar to the above one. We also need to prove that $$lim_{n oinfty}R_n(x)=0$$ where $$ig|R_n(x)ig|=ig|{e^{N+1}over(N+1)!}x^{N+1}ig|$$ Note that the right hand converges to 0 when $N$ is closing to $infty$. Thus $$e^x = sum_{n=0}^infty frac{1}{n!} x^{n}$$

    Additional Exercises

    1. Find the first four terms of Taylor series for $$f(x)=e^{ an x}-1$$ centered at $a=0$.

    Solution: $$f(0)=e^{ an x}-1ig|_{x=0}=0$$ $$f'(0)=e^{ an x}cdotsec^2xig|_{x=0}=1$$ $$f''(0)=e^{ an x}cdot(sec^4x+2sec^2x an x)ig|_{x=0}=1$$ $$f'''(0)=4e^{ an x}sec^2x an^2x+6e^{ an x}sec^4x an x+e^{ an x}sec^6x+2e^{ an x}sec^4xig|_{x=0}=3$$ Thus its Taylor series is $$0+x+{1over2}x^2+{1over2}x^3+cdots$$

    2. By finding the Taylor series around x=2, rewrite the polynomial $p(x) = -4 \, x^{3} - 3 \, x^{2} - 3 \, x - 1$ as a polynomial in $x-2$.

    Solution: $$p(2)=-4x^3-3x^2-3x-1ig|_{x=2}=-51$$ $$p'(2)=-12x^2-6x-3ig|_{x=2}=-63$$ $$p''(2)=-24x-6ig|_{x=2}=-54$$ $$p'''(2)=-24ig|_{x=2}=-24$$ Thus its Taylor series is $$p(x)=p(2)+{p'(2)over1}(x-2)+{p''(2)over2!}(x-2)^2+{p'''(2)over3!}(x-2)^3$$ $$=-51-63(x-2)-27(x-2)^2-4(x-2)^3$$

    3. By considering Taylor series, evaluate $$lim_{x o 0} displaystylefrac{{left(sinleft(3 \, x ight) + anleft(3 \, x ight) ight)}^{2}}{{left(e^{x} - 1 ight)} logleft(x + 1 ight)}.$$

    Solution: $$sin3x=3x-{27x^3over6}+O(x^5)$$ $$ an3x=3x+9x^3+O(x^5)$$ $$e^x-1=x+{x^2over2}+{x^3over6}+O(x^4)$$ $$log(x+1)=x-{1over2}x^2+{1over3}x^3+O(x^4)$$ So plug in the above results we have $$lim_{x o 0} f(x)=lim_{x o0}{(6x+{9over2}x^3+O(x^5))^2over (x+{x^2over2}+{x^3over6}+O(x^4))(x-{1over2}x^2+{1over3}x^3+O(x^4))}=lim_{x o0}{36x^2+O(x^4)over x^2+O(x^3)}=36$$

    4. Estimate $sin1$ within $1/40$.

    Solution: $$sin x=sum_{n=0}^{N}{(-1)^nover(2n+1)!}x^{2n+1}+R_{n}(x)=x-{1over3!}x^3+{1over5!}x^5+cdots+R_{n}(x)$$ $$Rightarrow ig|R_n(x)ig|=ig|{f^{(N+1)}(z)over(2N+3)!}x^{2N+3}ig|leq{x^{2N+3}over(2N+3)!}={1over(2N+3)!}leq{1over40}$$ Thus $N=1$ is enough. And the estimation is $$sin1=1-{1over3!}={5over6}$$

    5. Consider the polynomial $p(x) = 16 \, x^{5} - 20 \, x^{3} + 5 \, x$. Use the Taylor series for $cos x$ to find a Taylor series for $f(x) = p(cos x)$ around the point $x=0$ (up to $x^2$ term).

    Solution: $$cos x=sum_{n=0}^{infty}{(-1)^nover(2n)!}x^{2n}=1-{x^2over2}+{x^4over4!}+cdots$$ $$Rightarrow p(cos x)=16(1-{x^2over2}+O(x^4))^5-20(1-{x^2over2}+O(x^4))^3 +5(1-{x^2over2}+O(x^4)$$ $$=16(1-{5over2}x^2+O(x^4))-20(1-{3over2}x^2+O(x^4)) +5-{5over2}x^2+O(x^4)$$ $$=1-{25over2}x^2+O(x^4)$$


    作者:赵胤
    出处:http://www.cnblogs.com/zhaoyin/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

  • 相关阅读:
    找不到方法 Void Newtonsoft.Json.JsonConvert.set_DefaultSettings
    HDUJ 1203 I NEED A OFFER!
    EasyUI基础入门之Resiable(可缩放)
    6大设计原则(2):里氏替换原则
    scikit-learn:class and function reference(看看你究竟掌握了多少。。)
    NoSQL之Redis探析
    docker 命令汇总2
    【Web应用-FTP】FTP 容量显示说明
    【Web应用-网络连接】关于 Azure Web 应用 4 分钟空闲连接的限制
    【Web应用-网络连接】Azure Web 应用对外连接数上限分析
  • 原文地址:https://www.cnblogs.com/zhaoyin/p/4156717.html
Copyright © 2011-2022 走看看