Salta al contenuto
Note per Studenti Taylor's Formula - Peano and Lagrange Remainders Report

Taylor's Formula - Peano and Lagrange Remainders

In questa pagina 5

Prerequisites: Derivatives - Definition and Differentiation RulesThe derivative is the limit of the difference quotient and gives the slope of the tangent line; differentiable implies continuous but not conversely; the notes collect the derivatives of elementary functions, the rules (linearity, product, quotient, chain rule, inverse function, f^g) and higher-order derivatives with the classes C^n.Derivatives - Definition and Differentiation Rules → (including higher derivatives), little-o and asymptotic notation, L'Hopital's Rule and the Limit of the DerivativeFor a 0/0 form or a quotient whose denominator tends to infinity, if the limit of f'/g' exists then the limit of f/g exists and is the same; it holds for one-sided limits and limits at infinity, while if f'/g' has no limit nothing can be concluded. It is also used to study differentiability at a point (theorem on the limit of the derivative) and to define the classes C^0 and C^1.L'Hopital's Rule and the Limit of the Derivative →, Rolle's and Lagrange's TheoremsRolle: f continuous on [a,b], differentiable in ]a,b[, f(a) = f(b) implies f'(c) = 0 for some c; Lagrange (mean value theorem): without f(a) = f(b), f'(c) equals the slope of the chord. Consequence: on an interval f is constant if and only if f' = 0, while on a non-interval set f is only piecewise constant (arctan x + arctan(1/x)).Rolle's and Lagrange's Theorems →. Table of ready-made expansions: Maclaurin Series of the Elementary Functions and ApplicationsTable of the Maclaurin expansions to know by heart (exponential, sine, cosine, log(1+x), (1+x)^alpha, arctangent, hyperbolic functions, tangent) and rules for combining them: algebra of little-o, sums, products, compositions, expansions at infinity, and how many terms to keep in a limit.Maclaurin Series of the Elementary Functions and Applications →.

The question

Given ff differentiable nn times at x0=0x_0 = 0, is there a polynomial Tn(x)T_n(x) of degree ≤n\le n with f(x)=Tn(x)+o(xn)as x→0 ?f(x) = T_n(x) + o(x^n) \quad \text{as } x \to 0\,? Polynomials are the easiest functions to handle, so replacing ff by one simplifies many computations. For n=1n = 1 we already know: ff differentiable at 00 iff f(x)=f(0)+f′(0)x+o(x)f(x) = f(0) + f'(0)x + o(x), the tangent line. Taylor's formula uses higher degree polynomials, which approximate better.

Motivating example: sin⁡x\sin x

  • n=1n = 1: sin⁡x=x+o(x)\sin x = x + o(x).
  • n=2n = 2: lim⁡x→0sin⁡x−xx2=Hlim⁡cos⁡x−12x=Hlim⁡−sin⁡x2=0\lim_{x \to 0}\frac{\sin x - x}{x^2} \overset{H}{=} \lim\frac{\cos x - 1}{2x} \overset{H}{=} \lim\frac{-\sin x}{2} = 0, so sin⁡x=x+o(x2)\sin x = x + o(x^2): the x2x^2 term is absent (its coefficient is 0=12f′′(0)0 = \frac12 f''(0)).
  • n=3n = 3: lim⁡x→0sin⁡x−xx3=Hlim⁡cos⁡x−13x2=Hlim⁡−sin⁡x3⋅2x=Hlim⁡−cos⁡x3!=−13!\lim_{x \to 0}\frac{\sin x - x}{x^3} \overset{H}{=} \lim\frac{\cos x - 1}{3x^2} \overset{H}{=} \lim\frac{-\sin x}{3\cdot 2x} \overset{H}{=} \lim\frac{-\cos x}{3!} = -\frac1{3!}, hence sin⁡x=x−x33!+o(x3)\sin x = x - \frac{x^3}{3!} + o(x^3) and the coefficient is 13!f′′′(0)\frac{1}{3!}f'''(0).

The pattern: the coefficient of xkx^k is 1k!f(k)(0)\frac{1}{k!}f^{(k)}(0).

Taylor's formula with Peano remainder

Theorem (Maclaurin, Peano remainder). If ff is differentiable nn times at x0=0x_0 = 0, there is one and only one polynomial TnT_n of degree ≤n\le n with f(x)=Tn(x)+o(xn)(x→0),f(x) = T_n(x) + o(x^n) \quad (x \to 0), namely Tn(x)=∑k=0nf(k)(0)k!xk=f(0)+f′(0)x+12f′′(0)x2+⋯+1n!f(n)(0)xn.T_n(x) = \sum_{k=0}^{n}\frac{f^{(k)}(0)}{k!}x^k = f(0) + f'(0)x + \tfrac12 f''(0)x^2 + \dots + \tfrac{1}{n!}f^{(n)}(0)x^n.

Example. All derivatives of exe^x at 00 equal 11: ex=1+x+x22+x36+o(x3)e^x = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + o(x^3). Check: T3(0.1)=1.105167T_3(0.1) = 1.105167, e0.1=1.105171…e^{0.1} = 1.105171\ldots, error about 4⋅10−64\cdot10^{-6}, far less than x3=0.001x^3 = 0.001.

Names: TnT_n is the Taylor polynomial of order nn (Maclaurin polynomial at 00); Rn=f−Tn=o(xn)R_n = f - T_n = o(x^n) is the Peano remainder, which says only that the error is negligible relative to xnx^n, not how large it is. TnT_n is also the only polynomial of degree ≤n\le n with Tn(k)(0)=f(k)(0)T_n^{(k)}(0) = f^{(k)}(0) for k=0,…,nk = 0, \dots, n.

Proof (by induction on nn)

n=1n = 1: characterisation of differentiability.

n=2n = 2: lim⁡x→0f(x)−f(0)−f′(0)xx2=Hlim⁡x→0f′(x)−f′(0)2x=12f′′(0).\lim_{x \to 0}\frac{f(x) - f(0) - f'(0)x}{x^2} \overset{H}{=} \lim_{x \to 0}\frac{f'(x) - f'(0)}{2x} = \tfrac12 f''(0). L'Hopital is allowed because f′′(0)f''(0) exists, so ff and f′f' are differentiable (hence continuous) at 00: numerator and denominator tend to 00. The last limit is the difference quotient of f′f', which tends to f′′(0)f''(0). Therefore f(x)−T1(x)=12f′′(0)x2+o(x2)f(x) - T_1(x) = \frac12 f''(0)x^2 + o(x^2).

n=3n = 3: one more step, using that f,f′,f′′f, f', f'' are continuous at 00: lim⁡x→0f(x)−f(0)−f′(0)x−12f′′(0)x2x3=Hlim⁡f′(x)−f′(0)−f′′(0)x3x2=Hlim⁡f′′(x)−f′′(0)3⋅2 x=13!f′′′(0).\lim_{x \to 0}\frac{f(x) - f(0) - f'(0)x - \frac12 f''(0)x^2}{x^3} \overset{H}{=} \lim\frac{f'(x) - f'(0) - f''(0)x}{3x^2} \overset{H}{=} \lim\frac{f''(x) - f''(0)}{3\cdot2\,x} = \tfrac{1}{3!}f'''(0).

Inductive step: applying L'Hopital n−1n - 1 times, lim⁡x→0f(x)−Tn−1(x)xn=1n!f(n)(0)\lim_{x \to 0}\frac{f(x) - T_{n-1}(x)}{x^n} = \frac{1}{n!}f^{(n)}(0), so f=Tn−1+1n!f(n)(0)xn+o(xn)=Tn+o(xn)f = T_{n-1} + \frac{1}{n!}f^{(n)}(0)x^n + o(x^n) = T_n + o(x^n). ■\blacksquare

Uniqueness

Let Pn=a0+a1x+⋯+anxnP_n = a_0 + a_1 x + \dots + a_n x^n with Pn(k)(0)=f(k)(0)P_n^{(k)}(0) = f^{(k)}(0). Differentiating akxka_kx^k kk times leaves k! akk!\,a_k; lower-degree terms vanish (differentiated too often), higher-degree terms still contain xx and are 00 at 00. So Pn(k)(0)=k! akP_n^{(k)}(0) = k!\,a_k, hence ak=f(k)(0)k!a_k = \frac{f^{(k)}(0)}{k!}: the coefficients are forced, Pn=TnP_n = T_n. ■\blacksquare

Fundamental practical consequence. If by any means (even without differentiating) one writes f(x)=a0+a1x+⋯+anxn+o(xn)f(x) = a_0 + a_1x + \dots + a_nx^n + o(x^n), then it is the Taylor polynomial and ak=f(k)(0)k!a_k = \frac{f^{(k)}(0)}{k!}. This is why expansions are built by combining known ones, and why derivatives can be read off coefficients: f(k)(0)=k! akf^{(k)}(0) = k!\,a_k.

sin⁡x\sin x in detail

The derivatives repeat with period four: 0,1,0,−1,…0, 1, 0, -1, \dots at 00. Even derivatives vanish; odd derivatives are (−1)h(-1)^h for k=2h+1k = 2h + 1: sin⁡x=x−x33!+x55!−⋯+(−1)nx2n+1(2n+1)!+o(x2n+1).\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \dots + (-1)^n\frac{x^{2n+1}}{(2n+1)!} + o(x^{2n+1}). The next coefficient (degree 2n+22n + 2) is 00, so the error is in fact o(x2n+2)o(x^{2n+2}): e.g. sin⁡x=x−x36+o(x4)\sin x = x - \frac{x^3}{6} + o(x^4). Odd functions have only odd powers; even functions (like cos⁡x\cos x) only even powers.

Taylor's formula at a point x0∈Rx_0 \in \mathbb{R}

Theorem. If ff is differentiable nn times at x0x_0, there is one and only one polynomial Tn,x0T_{n,x_0} of degree ≤n\le n with f(x)=Tn,x0(x)+o((x−x0)n)f(x) = T_{n,x_0}(x) + o((x - x_0)^n) as x→x0x \to x_0, and Tn,x0(x)=∑k=0nf(k)(x0)k!(x−x0)k.T_{n,x_0}(x) = \sum_{k=0}^n\frac{f^{(k)}(x_0)}{k!}(x - x_0)^k.

Example. log⁡x\log x at x0=1x_0 = 1, order 22: f(1)=0f(1) = 0, f′(1)=1f'(1) = 1, f′′(1)=−1f''(1) = -1, so log⁡x=(x−1)−12(x−1)2+o((x−1)2)\log x = (x - 1) - \frac12(x - 1)^2 + o((x - 1)^2).

Warning. Taylor polynomials at different points are independent.

Example: sin⁡x\sin x at x0=π4x_0 = \frac\pi4, order 3. f=sin⁡f = \sin, f′=cos⁡f' = \cos, f′′=−sin⁡f'' = -\sin, f′′′=−cos⁡f''' = -\cos at π4\frac\pi4 equal 22,22,−22,−22\frac{\sqrt2}{2}, \frac{\sqrt2}{2}, -\frac{\sqrt2}{2}, -\frac{\sqrt2}{2}: sin⁡x=22(1+(x−π4)−12(x−π4)2−16(x−π4)3)+o ⁣((x−π4)3).\sin x = \frac{\sqrt2}{2}\left(1 + \left(x - \tfrac\pi4\right) - \tfrac12\left(x - \tfrac\pi4\right)^2 - \tfrac16\left(x - \tfrac\pi4\right)^3\right) + o\!\left(\left(x - \tfrac\pi4\right)^3\right). Typical error: replacing xx with x−π4x - \frac\pi4 in the expansion at 00 gives the expansion of sin⁡(x−π4)\sin\left(x - \frac\pi4\right), a different function.

Uses. (1) Limits: lim⁡x→0sin⁡x−xx3=lim⁡−x36+o(x3)x3=−16\lim_{x \to 0}\frac{\sin x - x}{x^3} = \lim\frac{-\frac{x^3}{6} + o(x^3)}{x^3} = -\frac16 without L'Hopital. (2) Order of an infinitesimal: the first non-zero term of the expansion gives the power it is asymptotic to. (3) High-order derivatives at a point from the coefficients.

The Peano remainder is a local approximation with no numerical estimate; for the error on a whole interval, use the Lagrange remainder.

Taylor's formula with Lagrange remainder

Peano says the error is negligible near x0x_0; Lagrange gives a formula for the error, allowing a numerical bound on a whole interval (a global approximation).

Theorem (Lagrange remainder). Let f∈Cn+1([a,b])f \in C^{n+1}([a, b]) and x0∈[a,b]x_0 \in [a, b]. For every x∈[a,b]x \in [a, b] there is cc between x0x_0 and xx such that f(x)=Tn,x0(x)+1(n+1)!f(n+1)(c)(x−x0)n+1.f(x) = T_{n,x_0}(x) + \frac{1}{(n+1)!}f^{(n+1)}(c)(x - x_0)^{n+1}.

Example. exe^x, x0=0x_0 = 0, n=2n = 2: ex=1+x+x22+ec6x3e^x = 1 + x + \frac{x^2}{2} + \frac{e^c}{6}x^3 with cc between 00 and xx. For x=12x = \frac12 the error is at most e1/26⋅18<0.035\frac{e^{1/2}}{6}\cdot\frac18 < 0.035.

The Lagrange remainder Rn,x0(x)=1(n+1)!f(n+1)(c)(x−x0)n+1R_{n,x_0}(x) = \frac{1}{(n+1)!}f^{(n+1)}(c)(x - x_0)^{n+1} looks like the next Taylor term, but the (n+1)(n+1)-th derivative is evaluated at an unknown point cc (depending on xx). For n=0n = 0 it is f(x)=f(x0)+f′(c)(x−x0)f(x) = f(x_0) + f'(c)(x - x_0), the mean value theorem: the formula generalises Rolle's and Lagrange's TheoremsRolle: f continuous on [a,b], differentiable in ]a,b[, f(a) = f(b) implies f'(c) = 0 for some c; Lagrange (mean value theorem): without f(a) = f(b), f'(c) equals the slope of the chord. Consequence: on an interval f is constant if and only if f' = 0, while on a non-interval set f is only piecewise constant (arctan x + arctan(1/x)).Rolle's and Lagrange's Theorems →.

We never know cc, but we know c∈[a,b]c \in [a, b]: if ∣f(n+1)∣|f^{(n+1)}| can be bounded on [a,b][a, b], we get a bound on the error valid for every xx.

Global approximation

Let f∈C∞([a,b])f \in C^\infty([a, b]) with ∣f(k)(x)∣≤M|f^{(k)}(x)| \le M for all x∈[a,b]x \in [a, b] and all kk. Then, since ∣x−x0∣≤b−a|x - x_0| \le b - a, ∣f(x)−Tn,x0(x)∣=∣f(n+1)(c)∣(n+1)!∣x−x0∣n+1≤M(b−a)n+1(n+1)!.|f(x) - T_{n,x_0}(x)| = \frac{|f^{(n+1)}(c)|}{(n+1)!}|x - x_0|^{n+1} \le \frac{M(b - a)^{n+1}}{(n+1)!}. The bound does not depend on xx and tends to 00 as n→+∞n \to +\infty (a factorial grows faster than any exponential). So for every ε>0\varepsilon > 0 there is NN such that for n≥Nn \ge N, ∣f(x)−Tn,x0(x)∣<ε|f(x) - T_{n,x_0}(x)| < \varepsilon for all x∈[a,b]x \in [a, b] simultaneously. Examples: sin⁡x\sin x has M=1M = 1; exe^x on [a,b][a, b] has M=ebM = e^b.

Method: degree guaranteeing error <ε< \varepsilon

  1. Write the Lagrange formula at a convenient x0x_0 (usually 00).
  2. Bound ∣f(n+1)(c)∣|f^{(n+1)}(c)| for cc in the interval and ∣x−x0∣n+1|x - x_0|^{n+1} for xx in the interval.
  3. Get ∣f(x)−Tn(x)∣≤g(n)|f(x) - T_n(x)| \le g(n) independent of xx.
  4. Find the smallest nn with g(n)<εg(n) < \varepsilon by trying n=1,2,3,…n = 1, 2, 3, \dots

Example: exe^x on [0,12][0, \frac12] with error <1100< \frac{1}{100}: the error is ≤e1/2(n+1)!2n+1\le \frac{e^{1/2}}{(n+1)!2^{n+1}} (using e1/2<2e^{1/2} < 2); for n=3n = 3 this is <224⋅16≈0.0052<1100< \frac{2}{24\cdot16} \approx 0.0052 < \frac1{100}, so n=3n = 3 suffices.

Peano or Lagrange?

Peano Lagrange
Hypothesis ff differentiable nn times at x0x_0 f∈Cn+1([a,b])f \in C^{n+1}([a, b])
Error o((x−x0)n)o((x - x_0)^n), value unknown f(n+1)(c)(n+1)!(x−x0)n+1\frac{f^{(n+1)}(c)}{(n+1)!}(x - x_0)^{n+1}
Validity only x→x0x \to x_0 (local) all x∈[a,b]x \in [a, b] (global)
Used for limits, orders of infinitesimals, derivatives at a point numerical error bounds

Common mistakes

  • Forgetting o(xn)o(x^n): sin⁡x=x−x36\sin x = x - \frac{x^3}{6} is false; it is true only with +o(x3)+o(x^3).
  • Stopping at the wrong order: expand until the first non-cancelling term appears.
  • Using the expansion at 00 when x→x0≠0x \to x_0 \ne 0.
  • Confusing ∑f(k)(0)k!xk\sum\frac{f^{(k)}(0)}{k!}x^k with derivatives computed at xx: derivatives are computed at x0x_0.
  • Evaluating the Lagrange remainder's derivative at x0x_0 instead of bounding it on the interval; bounding by its value at one point instead of the maximum (ece^c, c∈[0,12]c \in [0, \frac12]: maximum e1/2e^{1/2}, not e0e^0); forgetting the exponent n+1n + 1 and the factor (n+1)!(n+1)!.

Versione ripasso

Peano. If ff is nn times differentiable at x0x_0, there is a unique polynomial of degree ≤n\le n with f(x)=Tn,x0(x)+o((x−x0)n)f(x) = T_{n,x_0}(x) + o((x - x_0)^n): Tn,x0(x)=∑k=0nf(k)(x0)k!(x−x0)k.T_{n,x_0}(x) = \sum_{k=0}^n\frac{f^{(k)}(x_0)}{k!}(x - x_0)^k.

  • Unique polynomial with T(k)(x0)=f(k)(x0)T^{(k)}(x_0) = f^{(k)}(x_0); if f=a0+⋯+anxn+o(xn)f = a_0 + \dots + a_nx^n + o(x^n) by any means, then ak=f(k)(0)k!a_k = \frac{f^{(k)}(0)}{k!}, i.e. f(k)(0)=k! akf^{(k)}(0) = k!\,a_k.
  • ex=1+x+x22+x33!+o(x3)e^x = 1 + x + \frac{x^2}{2} + \frac{x^3}{3!} + o(x^3); sin⁡x=x−x33!+x55!−⋯+o(x2n+1)\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \dots + o(x^{2n+1}) (odd functions have odd powers only).
  • log⁡x\log x at 11, order 2: (x−1)−12(x−1)2+o((x−1)2)(x - 1) - \frac12(x - 1)^2 + o((x - 1)^2).

Proof sketch. n=2n = 2: lim⁡f(x)−f(0)−f′(0)xx2=Hlim⁡f′(x)−f′(0)2x=12f′′(0)\lim\frac{f(x) - f(0) - f'(0)x}{x^2} \overset{H}{=} \lim\frac{f'(x) - f'(0)}{2x} = \frac12 f''(0) (allowed since f,f′f, f' are continuous at 00); repeat L'Hopital n−1n - 1 times to get 1n!f(n)(0)\frac{1}{n!}f^{(n)}(0). Uniqueness: differentiating akxka_kx^k kk times gives k! akk!\,a_k at 00.

Uses. Limits (sin⁡x−xx3→−16\frac{\sin x - x}{x^3} \to -\frac16), order of infinitesimals, derivatives at a point. Local only.

Lagrange. f∈Cn+1([a,b])f \in C^{n+1}([a, b]), x0∈[a,b]x_0 \in [a, b]: for each xx there is cc between x0x_0 and xx with f(x)=Tn,x0(x)+f(n+1)(c)(n+1)!(x−x0)n+1.f(x) = T_{n,x_0}(x) + \frac{f^{(n+1)}(c)}{(n+1)!}(x - x_0)^{n+1}.

  • n=0n = 0 is the mean value theorem. cc is unknown but lies in [a,b][a, b].
  • If ∣f(k)∣≤M|f^{(k)}| \le M on [a,b][a, b]: ∣f(x)−Tn,x0(x)∣≤M(b−a)n+1(n+1)!→0|f(x) - T_{n,x_0}(x)| \le \frac{M(b - a)^{n+1}}{(n+1)!} \to 0, uniformly in xx.
  • Method: bound ∣f(n+1)∣|f^{(n+1)}| by its maximum on the interval and ∣x−x0∣n+1|x - x_0|^{n+1} by (b−a)n+1(b - a)^{n+1}, get g(n)g(n), find the smallest nn with g(n)<εg(n) < \varepsilon. Example: exe^x on [0,12][0, \frac12], error <1100< \frac1{100}, n=3n = 3.
Peano Lagrange
Hypothesis nn times differentiable at x0x_0 Cn+1([a,b])C^{n+1}([a, b])
Error o((x−x0)n)o((x - x_0)^n) f(n+1)(c)(n+1)!(x−x0)n+1\frac{f^{(n+1)}(c)}{(n+1)!}(x - x_0)^{n+1}
Validity local global

Typical mistakes. Missing o(xn)o(x^n); wrong order; expansion at 00 for x→x0≠0x \to x_0 \ne 0; derivative of the remainder at x0x_0 instead of its maximum; wrong exponent or factorial.

Teoria collegata