12.30 Taylor approximation
Approximation of functions: Taylor approximation
Taylor expansion
Let \(f\) be a function on \([a,b]\), \(x_0\in (a,b)\). Assume that \(f\) is \(N\) times differentiable at \(x_0\).
Then Taylor Poly of degree \(N\) based on \(x_0\) is
Which can be expressed as
Example
\(T_{0,x_0}(x)=f\left(x_0\right)\)
\(T_{1,x_0}(x)=f\left(x_0\right)+f^{\prime}\left(x_0\right)\left(x-x_0\right)=\) tangent line at \(x_0\)
\(T_{2,x_0}(x)=f\left(x_0\right)+f^{\prime}\left(x_0\right)\left(x-x_0\right)+\frac{f''\left(x_0\right)}{2}\left(x-x_0\right)^2\) is a parabola
where \(x_0=a\)
Example
-
\(f(x) = a_0 + a_1 x + a_2 x^2 \quad \text{with } a_2 \neq 0\)
\(T_{0, x_0}(x) = a_0 + a_1 x_0 + a_2 x_0^2 = f(x_0)\)
\(T_{1, x_0}(x) = \left(a_0 + a_1 x_0 + a_2 x_0^2\right) + \left(a_1 + 2a_2 x_0\right)(x - x_0)\)
\(T_{2, x_0}(x) = \left(a_0 + a_1 x_0 + a_2 x_0^2\right) + \left(a_1 + 2a_2 x_0\right)(x - x_0) + \frac{2a_2}{2!}(x - x_0)^2=f(x)\)
\(T_{3, x_0}(x) = T_{2, x_0}(x)\)
\(T_{N, x_0}(x) = T_{2, x_0}(x) \quad \forall N \geq 2\)
-
\(f(x) = \sin(x)\), \(a = 0\)
\(f(a) = \sin(0) = 0\)
\(f'(a) = \cos(0) = 1\)
\(f''(a) = -\sin(0) = 0\)
\(f'''(a) = -\cos(0) = -1\)
\(T_{N,0}(x)=0+\frac{1}{1!}x+\frac{0}{2!}x^2+\frac{-1}{3!}x^3+\frac{1}{5!}x^5-\frac{1}{7!}x^7+\dots+\begin{cases}0 & \text{if }N\text{ is even}\\ \frac{1}{N!}x^{N} & \text{if }N\equiv1\mod4\\ \frac{-1}{N!}x^{N} & \text{if }N\equiv3\mod4\end{cases}\)
-
\(f(x) = \sin(x)\), \(a = 0.1\)
\(T_{N, 0.1}(x) = \sin(0.1) + \frac{\cos(0.1)}{1!}(x - 0.1) - \frac{\sin(0.1)}{2!}(x - 0.1)^2 - \frac{\cos(0.1)}{3!}(x - 0.1)^3 + \dots\)
Definition
Let \(f,g:(a-\delta,a+\delta)\to \R\), we say that \(f\) and \(g\) coincide up (are equal) to degree \(N\) at \(a\) if \(\lim_{x\to a}\frac{f\left(x\right)-g\left(x\right)}{\left(x-a\left)^{N}\right.\right.}=0\)
Example
-
\(f\) is equal to \(g\) up to degree \(0\) at \(a\) if \(\lim_{x\to a}f\left(x\right)-g\left(x\right)=0\) (if \(f\) and \(g\) are continuous this means just \(f(a)=g(a)\))
-
\(f\) is equal to \(g\) up to degree \(1\) at \(a\) if \(\lim_{x\to a}\frac{f\left(x\right)-g\left(x\right)}{\left(x-a\left)\right.\right.}=0\Rightarrow\lim_{x\to a}\frac{f\left(x\right)-g\left(x\right)}{\left(x-a\right)}\cdot\left(x-a\right)=0\Rightarrow\lim_{x\to a}f\left(x\right)-g\left(x\right)=0\)
In this case, \((x-a)\) is much slower close to \(0\) than \(f(x)-g(x)\)
If the function is continuous, then \(f(a)=g(a)\), then \(0=\lim_{x\to a}\frac{f\left(x\right)-g\left(x\right)}{\left(x-a\left)\right.\right.}\)
\(\Rightarrow0=\lim_{x\to a}\frac{f\left(x\right)-f\left(a\right)+g\left(a\right)-g\left(x\right)}{\left(x-a\left)\right.\right.}\Rightarrow f\left(a^{\prime}\right)=g^{\prime}\left(a\right)\) * In general, if \(f\) and \(g\) are \(N\) times differentiable at \(a\), then
\(f\) coincides with \(g\) up to degree \(N\iff\)\(f(a)=g(a),f^{\prime}(a)=g^{\prime}(a)....f^{\left(\mathbb{N})\right.}\left(a\right)=g^{\left(\mathbb{N})\right.}\left(a\right)\)
Here we denote "\(f\) coincides with \(g\) up to degree \(N\)" as \(f-g=\mathcal{O}\left(\left(x-a\right)^{N}\right)\)
It is equivalent to \(f=g+\mathcal{O}\left(\left(x-a\right)^{N}\right)\)
In general, we say \(f=\mathcal{O}(h)\) if \(\lim_{x\to a}\frac{f\left(x\right)}{h\left(x\right)}=0\)
Weak Taylor's Theorem
If \(f\) is \(N\)- times differentiable at \(a\) (but we need differentiable at \((a-\delta ,a+\delta)\) to apply the lpt), then \(f(x)-T_{N,a}(x)=\mathcal{O}\left(\left(x-a\right)^{N}\right)=E_{N,a}\left(x\right)\)
That is \(\lim_{x\to a}\frac{f\left(x\right)-T_{N,a}\left(x\right)}{\left(x-a\right)^{N}}=0(\star)\)
Proof
We have \(0/0\) limit, we can apply L'Hopital's Rule
\(\frac{f^{\prime}(x)-\left[f^{\prime}(a)\cdot1+\frac{f''(a)}{2!\cdot}2(x-a)+\frac{f'''(a)}{3!}3(x-a)^2+\dots+\frac{f^{(N)}(a)}{N!}N(x-a)^{N-1}\right]}{(N)(x-a)^{N-1}}\)
\(\left(T_{N, a, f}\right)'(x) = T_{N-1, a, f'}(x).\)
Applying \((N-1)\) times L'Hôpital, you get:
\(\star=\lim_{x\to a}\frac{f^{(N-1)}(x)-\left[f^{(N-1)}(a)+f^{(N)}(a)\cdot(x-a)\right]}{N!\cdot(x-a)}\)
\(= \frac{1}{N!} \lim_{x \to a} \left( \frac{f^{(N-1)}(x) - f^{(N-1)}(a)}{x - a} - f^{(N)}(a) \right)\)
\(= 0\)
Proposition
Let \(P\) and \(Q\) be polynomial of degree \(\leq N\)
- If \(P(x_1)=Q(x_1),\ldots,P\left(x_{N+1}\right)=Q\left(x_{N+1}\right)\) for \(N+1\) differentiable points, then \(P=Q\)
Take \(H(x)=P(x)-Q(x)\) which has \(n+1\) roots, is impossible of degree \(N\) unless \(P-Q=0\) * If \(P\) and \(Q\) are equal up to degree \(N\), then \(P=Q\)
Proof
Let \(\lim_{x\to a}\frac{P\left(x\right)-Q\left(x\right)}{\left(x-a\left)^{N}\right.\right.}=0\), since \(P,Q\) are continuous and their derivatives are continuous
Then \(P(a)=Q(a),P'(a)=Q'(a),...,P^{(N)}(a)=Q^{(N)}(a)\)
Then \(\lim_{x\to a}\frac{P\left(x\right)-Q\left(x\right)}{\left(x-a\left)^{N}\right.\right.}=0\Rightarrow\lim_{x\to a}\frac{P\left(x\right)-Q\left(x\right)}{\left(x-a\left)^{k}\right.\right.}=0,\forall k=0,\ldots,N\)(multiply by \((x-a)^{N-k}\))
Then \(k=0:0=\lim_{x\to a}P\left(x\right)-Q\left(x\right)=P\left(a\right)-Q\left(a\right)\)
\(k=1:0=\lim_{x\to a}\frac{P\left(x\right)-Q\left(x\right)}{x-a}=\lim_{x\to a}\frac{P\left(x\right)-P\left(a\right)+Q\left(a\right)-Q\left(x\right)}{x-a}\Rightarrow P^{\prime}\left(a\right)=Q^{\prime}\left(a\right)\)
.....
Or we can use LHR to the \(\lim_{x\to a}\frac{P\left(x\right)-Q\left(x\right)}{\left(x-a\left)^{N}\right.\right.}=\lim_{x\to a}\frac{P^{\left(k\right)}\left(x\right)-Q^{\left(k\right)}\left(x\right)}{\left(N!-\left(N-k\right)!\right)\left(x-a\left)^{N-k}\right.\right.}=0\Rightarrow P^{\left(k\right)}\left(a\right)=Q^{\left(k\right)}\left(a\right)\)
Let \(R=P-Q\), then \(R\) is a polynomial, \(\deg(R)\leq N\)
\(R(a)=0,R^{\prime}(a)=0,...,R^{(N)}(a)=0\Rightarrow R=0\) why?
Since \(R(x)=c_0+c_1(x-a)+c_2(x-a)^2+...+c_{N}(x-a)^N\), then
\(c_0=R(a)=0,c_1=R^{\prime}(a)=0,\ldots,c_{N}=\frac{R^{\left(N\right)}(a)}{N!}=0\)
Then \(R=0\Rightarrow P=Q\)
Corollary
\(T_{N,a}(x)\) is the only polynomial of \(\deg\leq N\), that coincides with \(f\) up to degree \(N\) at \(a\)
Proof
We know that \(T_{N,a}\) does, if another \(P\) does, then \(P=T_{N,a}\) up to degree \(N\) at \(a\)
By proposition \(P=T_{N,a}\)