Week 6 - Taylor Series

1. Brief

  • This week talks about how to transfer a function f(x)f(x) to a power series.

2. Better Than Linear Approximation

  • In calculus one, we've learned f(x)f(a)+f(a)(xa)f(x) \approx f(a) + f'(a) (x - a) to approximately get value of f(x)f(x).
  • This time we use another function g(x)=f(a)+f(a)(xa)+f(a)2(xa)2+f(a)6(xa)3g(x) = f(a) + f'(a) \cdot (x - a) + \frac{f''(a)}{2} \cdot (x -a)^2 + \frac{f'''(a)}{6} \cdot (x - a)^3
  • With some calculation, we can get:
    • g(a)=f(a)g(a) = f(a)
    • g(a)=f(a)g'(a) = f'(a)
    • g(a)=f(a)+f(a)(xa)g''(a) = f''(a) + f''(a) (x - a)
    • g(a)=f(a)+f(a)(xa)g'''(a) = f'''(a) + f'''(a) (x - a)
  • So, g(x)g(x) is a better approximation for f(x)f(x).
  • Example: f(x)=sin(x)f(x) = \sin(x)
    • f(x)=sin(x),f(0)=0f(x) = \sin(x), f(0) = 0
    • f(x)=cos(x),f(0)=1f(x) = \cos(x), f'(0) = 1
    • f(x)=sin(x),f(0)=0f(x) = - \sin(x), f''(0) = 0
    • f(x)=cos(x),f(0)=1f(x) = - \cos(x), f'''(0) = -1
    • g(x)=0+1x+02(x)2+16(x)3=xx36g(x) = 0 + 1 \cdot x + \frac{0}{2} \cdot (x)^2 + \frac{-1}{6}(x)^3 = x - \frac{x^3}{6}
    • f(12)=sin(12)0.4794f(\frac{1}{2}) = \sin(\frac{1}{2}) \approx 0.4794
    • g(12)=12(1/2)360.4792g(\frac{1}{2}) = \frac{1}{2} - \frac{(1/2)^3}{6} \approx 0.4792

3. Taylor Theorem

3.1. the Taylor Series for f Around Zero(Maclaurin Series)

  • Suppose f(x)=n=0anxn, x<Rf(x) = \sum_{n=0}^{\infty} a_n x^n,\ |x| < R
    • =a0+a1x+a2x2+a3x3+= a_0 + a_1 x + a_2 x^2 + a_3 x^3 + \cdots
  • Then, f(0)=a0+a10+a20+a30+=a0f(0) = a_0 + a_1 \cdot 0 + a_2 \cdot 0 + a_3 \cdot 0 + \cdots = a_0
  • f(x)=n=1annxn1,x<Rf'(x) = \sum_{n=1}^{\infty} a_n \cdot n \cdot x^{n-1}, |x| < R
    • =a1+a22x+= a_1 + a_2 \cdot 2 \cdot x + \cdots
    • => f(0)=a1f'(0) = a_1
  • f(x)=n=2ann(n1)xn2,x<Rf''(x) = \sum_{n=2}^{\infty} a_n \cdot n \cdot (n-1) \cdot x^{n-2}, |x| < R
    • =a2211+a332x+= a_2 \cdot 2 \cdot 1 \cdot 1 + a_3 \cdot 3 \cdot 2 \cdot x + \cdots
    • => f(0)=a22f''(0) = a_2 \cdot 2
    • => a2=f(0)2a_2 = \frac{f''(0)}{2}
  • a3=f(0)3!a_3 = \frac{f'''(0)}{3!}
  • \cdots

  • So, Assume f(x)=n=0anxn, x<Rf(x) = \sum_{n=0}^{\infty} a_n x^n,\ |x| < R

    • Then an=fn(0)n!a_n = \frac{f^{n}(0)}{n!}

Definition

  • If f(x)=n=0anxn, where x<R\displaystyle f(x) = \sum_{n=0}^{\infty} a_n x^n,\ \text{where}\ |x| < R
  • Then f(x)=n=0f(n)(0)n!xn\displaystyle f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} \cdot x^n
    • This series is called Taylor series of the function f at 0 or Maclaurin series.

3.2. The Taylor Series for f Centered Around a

  • f(x)=n=0cn(xa)n\displaystyle f(x) = \sum_{n=0}^{\infty} c_n (x-a)^n
    • c0+c1(xa)+c2(xa)2+c_0 + c_1 (x - a) + c_2 (x - a)^2 + \cdots
    • f(a)=c0f(a) = c_0
    • f(a)=c1f'(a) = c_1
    • ...
  • To summary this:
    • The Taylor Series for f Centered Around a is f(x)=n=0f(n)(a)n!(xa)nf(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!} \cdot (x-a)^n
  • Example f(x)=sin(x)f(x) = \sin(x)
    • The Taylor Series for sin\sin around 0 is f(x)=n=0(1)n(2n+1)!x2n+1f(x) = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!} \cdot x^{2n+1}
  • Quiz 6: Let f(x)=cos(x5)f(x) = \cos(x^5). By considering the Taylor series for ff around 0, compute f(90)(0)f^{(90)}(0).
    • The Taylor Series for cos\cos around 0 is f(x)=n=0(1)n(2n)!x2nf(x) = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n)!} \cdot x^{2n}
    • f(x)=1x22!+x44!x66!++x1616!x1818!+f(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots + \frac{x^{16} }{16!} - \frac{x^{18} }{18!} + \cdots
    • f(x5)=1x102!+x204!x306!++x8016!x9018!+f(x^5) = 1 - \frac{x^{10} }{2!} + \frac{x^{20} }{4!} - \frac{x^{30} }{6!} + \cdots + \frac{x^{80} }{16!} - \frac{x^{90} }{18!} + \cdots
    • So we just need to differentiate term d90dx90(x9018!)\frac{d^{90} }{dx^{90} } (- \frac{x^{90} }{18!}) which =90!x018!=90!18!= - \frac{90! \cdot x^0}{18!} = - \frac{90!}{18!}

3.3. Taylor's Theorem

  • Suppose f:RRf: \mathbb{R} \to \mathbb{R} is infinitely differentiable.
    • f(x)=(n=0Nf(n)(0)n!xn)+RNxf(x) = (\sum_{n=0}^{N} \frac{f^{(n)}(0)}{n!} \cdot x^n) + R_N{x}. R stands for remainder.
  • Then RN(x)=f(N+1)(z)(N+1)!xN+1R_N(x) = \frac{f^{(N+1)}(z)}{(N+1)!} x^{N+1} for some z between x and 0.

Usage

  • Use Taylor's Theorem to prove sinx=n=0(1)n(2n+1)!x2n+1\sin{x} = \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!} \cdot x^{2n+1}
  • f(x)=sinxf(x) = \sin x
  • With Taylor's Theorem, sinxn=0Nf(n)(0)n!xn=RN(x)RN(x)=f(N+1)(z)(N+1)!xN+1\begin{aligned} \sin{x} &- \sum_{n=0}^{N} \frac{f^{(n)}(0)}{n!} \cdot x^n = R_N(x) \\ R_N(x) &= \frac{f^{(N+1)}(z)}{(N+1)!} x^{N+1} \end{aligned}
  • We know: f(N+1)(x)=±sinx or ±cosxf^{(N+1)}(x) = \pm \sin x \ \text{or} \ \pm \cos x , so f(N+1)(x)1f^{(N+1)}(x) \le 1
  • Then, RN(x)1(N+1)!xN+1R_N(x) \le \frac{1}{(N+1)!} x^{N+1}
  • So, if limNxN+1(N+1)!=0\displaystyle \lim_{N \to \infty}|\frac{x^{N+1} }{(N+1)!}| = 0, limNRN(x)=0\displaystyle \lim_{N \to \infty}|R_N(x)| = 0.
    • Then sinx=n=0f(n)(0)n!xn=n=0(1)n(2n+1)!x(2n+1)\displaystyle \sin{x} = \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} \cdot x^n = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!} \cdot x^{(2n+1)}
  • So we need to prove limNxN+1(N+1)!=0\displaystyle \lim_{N \to \infty}|\frac{x^{N+1} }{(N+1)!}| = 0.
    • And if N=0xN+1(N+1)!\displaystyle \sum_{N=0}^{\infty}|\frac{x^{N+1} }{(N+1)!}| converge, then the limit must be 0.
  • Now, use ratio test to prove the series converge:
    • limNxN+2/(N+2)!xN+1/(N+1)!=limNx(N+1)!(N+2)!=limNxN+2=0\displaystyle \lim_{N \to \infty } \frac{x^{N+2}/{(N+2)!} } { x^{N+1}/{(N+1)!} } = \lim_{N \to \infty} \frac{x \cdot (N+1)! } { (N+2)! } = \lim_{N \to \infty} \frac{x } { N+2 } = 0

the Radius of Convergence of 1/(1+x^2)

  • 11x=n=0xn\displaystyle \frac{1}{1-x} = \sum_{n=0}^{\infty} x^n, if x<1|x| < 1.
    • the radius of convergence is 1.
  • 11+x=n=0(x)n=n=0(1)nxn\displaystyle \frac{1}{1+x} = \sum_{n=0}^{\infty} (-x)^n = \sum_{n=0}^{\infty} (-1)^n x^n, if x<1|x| < 1.
    • the radius of convergence is 1.
  • 11+x2=n=0(1)n(x2)n=n=0(1)nx2n\displaystyle \frac{1}{1+x^2} = \sum_{n=0}^{\infty} (-1)^n(x^2)^n = \sum_{n=0}^{\infty} (-1)^n x^{2n}, if x<1|x| < 1.
    • the radius of convergence is 1.
  • The question is why the radius of convergence of function 11+x2\frac{1}{1+x^2} at 0 is 1, and at 1 is 2\sqrt{2}
    • We can understand that the radius of convergence of 11x\frac{1}{1-x} at 0 is 1, because x1x \ne 1.
    • But sinx\sin x is very similar to 11+x2\frac{1}{1+x^2}, and the radius of convergence of sinx\sin x at 0 is \infty.
      • sinx=n=0(1)n(2n+1)!x2n+1\displaystyle \sin x = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!} x^{2n+1} for all x.
  • The answer is, if we set i=1i = \sqrt{-1}, then f(i)=11+(i)2=11+(1)f(i) = \frac{1}{1+(i)^2} = \frac{1}{1+(-1)}, which doesn't exist.
  • So there is a bad point(间断点) where the function is undefined. It's just the bad point isn't a real point.(这个间断点不在实轴上,是个虚数)
  • The bad point in the complex plane is messing up the radius of convergence even along the real line. So complex numbers is very important, even in the thery of real value Taylor Series.(这个在复平面上的间断点限制了收敛半径,所以复数在实数域的泰勒展开式中同样重要。)
  • Additional evidence is eix=cosx+isinx. (i=1)e^{ix} = \cos x + i \cdot \sin x. \ (i = \sqrt{-1}) . Interpret this as a statement about power series: n=0(ix)nn!=n=0(1)nx2n2n!+in=0(1)nx2n+1(2n+1)! \sum_{n=0}^{\infty} \frac{(ix)^n}{n!} = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n} }{2n!} + i \cdot \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1} }{(2n+1)!} . Set x=πx = \pi: eiπ=cosπ+isinπ=1e^{i \pi} = \cos \pi + i \cdot \sin \pi = -1
  • Taylor series are the first step into the theory of complex analysis(复分析理论).

Mean Value Theorem

  • f:[a,b]R continuousf: [a, b] \to \mathbb{R} \text{ continuous}
    • and, on (a,b)(a, b) differentiable,
  • Then, there is a point c(a,b)c \in (a, b), so that f(c)=f(b)f(a)baf'(c) = \frac{f(b) - f(a)}{b - a}
  • replace c and b with z and x, we get:
    • f(z)=f(x)f(a)xaf'(z) = \frac{f(x) - f(a)}{x - a}
    • f(x)=f(a)+R0(x),where R0(x)=f(z)1!(xa)1f(x) = f(a) + R_0(x), \text{where}\ R_0(x) = \frac{f'(z)}{1!} \cdot (x-a)^1, and z is between x and a.
    • It is the Taylor Theorem when N=0N = 0
  • Example f(t)=your position at time t secf(t) = \text{your position at time t sec}
    • f(0)=0f(0) = 0, f(0)=0f'(0) = 0, f(t)250ms2f''(t) \le 250 \frac{m}{s^2}
    • Question: How big can f(60)f(60) be?
    • Use Taylor Theorem, we get:
      • f(t)=f(0)+f(0)(t0)+R1(t)f(t) = f(0) + f'(0) \cdot (t - 0) + R_1(t), R1(t)=f(z)2!(t0)2R_1(t) = \frac{f''(z)}{2!} \cdot (t - 0)^2
      • R1(t)2502!t2|R_1(t)| \le \frac{250}{2!} \cdot t^2
    • So f(t)f(0)+f(0)t+2502!t2=125t2f(t) \le f(0) + f'(0) \cdot t + \frac{250}{2!} \cdot t^2 = 125 t^2
    • f(60)125602=450000m=450kmf(60) \le 125 \cdot 60^2 = 450000 \text{m} = 450 \text{km}

4. Practice

4.1. Uniform Convergence

Approximate cos x when x is near zero

  • Goal: Find polynomial p(x)p(x) so that p(x)cosx<1100|p(x) - \cos x| < \frac{1}{100}, where x[1,1]x \in [-1, 1]
  • cosx=n=0(1)n(2n)!x2n\displaystyle \cos x = \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!} \cdot x^{2n}
  • cosxn=0Nf(n)(0)n!xn=RN(x)\displaystyle \cos x - \sum_{n=0}^{N}\frac{f^{(n)}(0)}{n!} \cdot x^{n} = R_N(x)
  • RN(x)=f(N+1)(z)(N+1)!xN+1\displaystyle R_N(x) = \frac{f^{(N+1)}(z)}{(N+1)!} \cdot x^{N+1}, z(0,x)z \in (0, x)
  • x[1,1]x \in [-1, 1], then xN+11|x^{N+1}| \le 1
    • => RN(x)f(N+1)(z)(N+1)! R_N(x) \le \frac{f^{(N+1)}(z)}{(N+1)!}
  • f(N+1)(z)=±sinz or ±cosz1f^{(N+1)}(z) = \pm \sin z\ \text{or}\ \pm \cos z \le 1
    • => RN(x)1(N+1)! R_N(x) \le \frac{1}{(N+1)!}
  • We want 1(N+1)!<1100\frac{1}{(N+1)!} < \frac{1}{100} and 15!=1120\frac{1}{5!} = \frac{1}{120}
    • => N=4N = 4
  • cosx=1x22+x424x6720+\cos x = 1 - \frac{x^2}{2} + \frac{x^4}{24} -\frac{x^6}{720} + \cdots
    • There is no x to the 5th term, so we can make N=5N = 5
  • cosx=1x22+x424R5\cos x = 1 - \frac{x^2}{2} + \frac{x^4}{24} -R_5
    • => R5(x)1(5+1)!=16!=1720<1100 R_5(x) \le \frac{1}{(5+1)!} = \frac{1}{6!} = \frac{1}{720} < \frac{1}{100}
  • So p(x)=1x22+x424cosxp(x) = 1 - \frac{x^2}{2} + \frac{x^4}{24} \approx \cos x

4.2. Limits

  • limx0sinxx\displaystyle \lim_{x \to 0} \frac{\sin x}{x}
  • use Taylor Series, we know:
    • sinx=xx36+x55!\sin x = x - \frac{x^3}{6} + \frac{x^5}{5!} - \cdots
    • sinxx+ higher order terms\sin x \approx x +\ \text{higher order terms}
  • then limx0sinxx=limx0x+higher order termsx=1+limx0higher order termsx\displaystyle \lim_{x \to 0} \frac{\sin x}{x} = \lim_{x \to 0} \frac{x + \text{higher order terms} }{x} = 1 + \lim_{x \to 0} \frac{\text{higher order terms} }{x}

4.3. Real Analytic Function

  • Theorem:
    • The function ff is real analytic at a if there is some R>0R > 0,
    • So that f(x)=n=0f(n)(a)n!(xa)n when xa<Rf(x) = \sum_{n = 0}^{\infty} \frac{f^{(n)}(a)}{n!}(x-a)^n \ \text{when } |x-a|<R
  • Real Analytic Functions ∈ Infinitely Differentiable Functions(Smooth Functions(CC^{\infty})) ∈ Differentiable Functions ∈ Continuous Functions ∈ All Functions

Holograms

  • A little bit of a hologram records everything in the function.
  • For example sinx\sin x.
    • Only look the points near 0, we know:
      • f(0)=0f(0) = 0
      • f(0)=1f'(0) = 1
      • f(0)=0f''(0) = 0
      • f(0)=1f'''(0) = -1
      • We can calculate all of the derivatives of the function by just looking the area near 0.
    • And use Taylor Series, we can get f(x)=n=0f(n)(0)n!xn\displaystyle f(x) = \sum_{n = 0}^{\infty} \frac{f{(n)}(0)}{n!} x^n

5. Important Taylor Series and Their Radii of Convergence

  • 11x=n=0xn=1+x+x2+x3+,R=1\frac{1}{1-x} = \sum_{n=0}^{\infty} x^n = 1 + x + x^2 + x^3 + \cdots, R = 1
  • ex=n=0xnn!=1+x1!+x22!+x33!+,R=e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + \frac{x}{1!} + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots, R = \infty
  • sinx=n=0(1)nx2n+1(2n+1)!=xx33!+x55!x77!+,R=\sin x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1} }{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots, R = \infty
  • cosx=n=0(1)nx2n(2n)!=1x22!+x44!x66!+,R=\cos x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n} }{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots, R = \infty
  • tan1x=n=0(1)nx2n+12n+1=xx33+x55x77+,R=1\tan^{-1} x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1} }{2n+1} = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \cdots, R = 1
  • ln(1+x)=n=0(1)n1xnn=xx22+x33x44+,R=1\ln (1 + x) = \sum_{n=0}^{\infty} \frac{(-1)^{n-1} x^{n} }{n} = x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \cdots, R = 1
  • (1x)k=n=0(nk)xn=1+kx+k(k1)2!x2+k(k1)(k2)3!x3+,R=1(1 - x)^k = \sum_{n=0}^{\infty} (n {k})x^{n} = 1 + kx + \frac{k(k-1)}{2!}x^2 + \frac{k(k-1)(k-2)}{3!}x^3 + \cdots, R = 1

results matching ""

    No results matching ""