Taylor's theorem #
This file defines the Taylor polynomial of a real function f : ℝ → E
,
where E
is a normed vector space over ℝ
and proves Taylor's theorem,
which states that if f
is sufficiently smooth, then
f
can be approximated by the Taylor polynomial up to an explicit error term.
Main definitions #
taylorCoeffWithin
: the Taylor coefficient usingiteratedDerivWithin
taylorWithin
: the Taylor polynomial usingiteratedDerivWithin
Main statements #
taylor_mean_remainder
: Taylor's theorem with the general form of the remainder termtaylor_mean_remainder_lagrange
: Taylor's theorem with the Lagrange remaindertaylor_mean_remainder_cauchy
: Taylor's theorem with the Cauchy remainderexists_taylor_mean_remainder_bound
: Taylor's theorem for vector valued functions with a polynomial bound on the remainder
TODO #
- the Peano form of the remainder
- the integral form of the remainder
- Generalization to higher dimensions
Tags #
Taylor polynomial, Taylor's theorem
The k
th coefficient of the Taylor polynomial.
Equations
- taylorCoeffWithin f k s x₀ = (↑k.factorial)⁻¹ • iteratedDerivWithin k f s x₀
Instances For
The Taylor polynomial with derivatives inside of a set s
.
The Taylor polynomial is given by
$$∑_{k=0}^n \frac{(x - x₀)^k}{k!} f^{(k)}(x₀),$$
where $f^{(k)}(x₀)$ denotes the iterated derivative in the set s
.
Equations
- taylorWithin f n s x₀ = ∑ k ∈ Finset.range (n + 1), (PolynomialModule.comp (Polynomial.X - Polynomial.C x₀)) ((PolynomialModule.single ℝ k) (taylorCoeffWithin f k s x₀))
Instances For
The Taylor polynomial with derivatives inside of a set s
considered as a function ℝ → E
Equations
- taylorWithinEval f n s x₀ x = (PolynomialModule.eval x) (taylorWithin f n s x₀)
Instances For
The Taylor polynomial of order zero evaluates to f x
.
Evaluating the Taylor polynomial at x = x₀
yields f x
.
If f
is n
times continuous differentiable on a set s
, then the Taylor polynomial
taylorWithinEval f n s x₀ x
is continuous in x₀
.
Calculate the derivative of the Taylor polynomial with respect to x₀
.
Version for arbitrary sets
Calculate the derivative of the Taylor polynomial with respect to x₀
.
Version for open intervals
Calculate the derivative of the Taylor polynomial with respect to x₀
.
Version for closed intervals
Taylor's theorem with mean value type remainder estimate #
Taylor's theorem with the general mean value form of the remainder.
We assume that f
is n+1
-times continuously differentiable in the closed set Icc x₀ x
and
n+1
-times differentiable on the open set Ioo x₀ x
, and g
is a differentiable function on
Ioo x₀ x
and continuous on Icc x₀ x
. Then there exists an x' ∈ Ioo x₀ x
such that
$$f(x) - (P_n f)(x₀, x) = \frac{(x - x')^n}{n!} \frac{g(x) - g(x₀)}{g' x'},$$
where $P_n f$ denotes the Taylor polynomial of degree $n$.
Taylor's theorem with the Lagrange form of the remainder.
We assume that f
is n+1
-times continuously differentiable in the closed set Icc x₀ x
and
n+1
-times differentiable on the open set Ioo x₀ x
. Then there exists an x' ∈ Ioo x₀ x
such
that $$f(x) - (P_n f)(x₀, x) = \frac{f^{(n+1)}(x') (x - x₀)^{n+1}}{(n+1)!},$$
where $P_n f$ denotes the Taylor polynomial of degree $n$ and $f^{(n+1)}$ is the $n+1$-th iterated
derivative.
Taylor's theorem with the Cauchy form of the remainder.
We assume that f
is n+1
-times continuously differentiable on the closed set Icc x₀ x
and
n+1
-times differentiable on the open set Ioo x₀ x
. Then there exists an x' ∈ Ioo x₀ x
such
that $$f(x) - (P_n f)(x₀, x) = \frac{f^{(n+1)}(x') (x - x')^n (x-x₀)}{n!},$$
where $P_n f$ denotes the Taylor polynomial of degree $n$ and $f^{(n+1)}$ is the $n+1$-th iterated
derivative.
Taylor's theorem with a polynomial bound on the remainder
We assume that f
is n+1
-times continuously differentiable on the closed set Icc a b
.
The difference of f
and its n
-th Taylor polynomial can be estimated by
C * (x - a)^(n+1) / n!
where C
is a bound for the n+1
-th iterated derivative of f
.
Taylor's theorem with a polynomial bound on the remainder
We assume that f
is n+1
-times continuously differentiable on the closed set Icc a b
.
There exists a constant C
such that for all x ∈ Icc a b
the difference of f
and its n
-th
Taylor polynomial can be estimated by C * (x - a)^(n+1)
.