\input /home/pasky/school/fastex/lib.tex

\chapter{Taylor�v polynom}{

\scpart{Opakov�n�}{
	{\bf Polynom} je ka�d� funkce tvaru
	$$a_nx^n + a_{n-1}x^{n-1} + \cdots + a_1x + a_0$$

	$a_0,\ldots,a_n \in \real$ pevn� --- koeficienty. $x \in \real$ je prom�nn�.

	\notes{
	\list{
	\listItem{
		V�echny polynomy jsou definov�ny a spojit� na $\real$.
	}
	\listItem{
		Jestli�e $a_n \ne 0$, pak $n = $ stupe� polynomu.
	}
	\listItem{
		Je-li $\cP$ polynom, stupe� $\cP = n$, pokud $\cP'$ je polynom, stupe� $\cP' = n-1$.
	}
	}

	\examples{
		$$\eqalign{ \deg \cP = 0 & \Rightarrow \cP \textbox{konstantn�},\ \cP(x) \equiv a_0 \cr
		            \deg \cP = 1 & \Rightarrow \cP(x) = a_0x + a_0 \textbox{line�rn�} \cr
		            \deg \cP = 2 & \Rightarrow \textbox{kvadratick� funkce, atd.} }$$
	}
	}

}

\scpart{Motivace}{
	Aproximace funkc� pomoc� polynom�.

	M�jme $f$, $a \in \real$, $\existss f'(a) \in \real$. Te�na $t(x) = f(a) + f'(a)(x-a)$.
	Potom
	$$\eqalign{f(a) &= t(a)\cr
		   f'(a)&= t'(a)}$$

	Nav�c
	$$\eqalign{ \lim_{x\to a} (f(x)-t(x)) &= 0 \textbox{(trivi�ln�), ale i}\cr
		   \lim_{x\to a} {f(x)-t(x)\over x-a} \becauseof{L'H}{=} \lim_{x\to a} (f'(x)-t'(x)) &= 0 \textbox{(aproximace je lep�� ne� line�rn�)}}$$

	Chceme aproximace vy���ch ��d�.
}

\scpart{Idea}{
	M�jme $f$, $a \in \real$, $\existss f'(a) \in \real$. Chceme funkci $f$
	aproximovat polynomem v bod� $a$.

	\scpart{Aproximace polynomem stupn� 1}{
		$$P_1(x) = \a x + \beta$$

		Polynom by m�l proch�zet bodem $a$:
		$$P_1(a) = f(a) \Rightarrow P_1(x) = c(x-a) + f(a)$$
		(tedy hodnota funkce a aproximuj�c�ho polynomu spl�vaj�).

		Z�rove� chci:
		$$ P_1'(a) = f'(a) \Rightarrow P_1(x) = f(a) + f'(a)(x-a)$$
		Nejlep�� aproximace polynomem stupn� $\le 1$ je toti�
		{\bf te�na} $t(x) = f(a) + f'(a)(x-a)$.
		Potom $$\lim_{x\to a} {f(x)-t(x) \over x-a} = 0$$

		Ukazuje se, �e tyto dva po�adavky jsou ekvivalentn�.
	}

	\scpart{Aproximace polynomem stupn� 2}{
		P��klad: $\cos x$ --- line�rn� aproximace nic moc, kvadratick� aproximace
		je u� lep��. $P_2(x) = f(a) + f'(a)(x-a) + c(x-a)^2$, $c = ?$.

		Chci: $$\eqalign{P_2(a) &= f(a)\cr
		                 P_2'(a) &= f'(a)} \et P_2''(a) = f''(a)$$

		$$\Rightarrow P_2'(x) = f'(a) + 2c(x-a) \Rightarrow P_2'(a) = f'(a) $$
		(prvn� derivace spl�v�)
		$$\Rightarrow P_2''(x) = 2c \Rightarrow c = {f''(a) \over 2}$$
		$$\Rightarrow P_2(x) = f(a) + f'(a)(x-a) + {f''(a) \over 2}(x-a)^2$$
		To je nejlep�� kvadratick� aproximace $f$ v bod� $a$.

		Nav�c plat�: $$\lim_{x\to a} {f(x)-P_2(x) \over (x-a)^2} = 0$$
		(D�kaz: \DCV)
	}
}


\definition{
	Nech� $f$ je re�ln� funkce, $a \in \real$, $n \in \nat$.
	Pak funkci
	$$ T_n^{f,a}(x) = f(a) + f'(a)(x-a) + \cdots + {f^{(n)}(a)\over n!}(x-a)^n $$
	naz�v�me {\bf Taylorov�m polynomem funkce $f$ ��du $n$ v bod� $a$}.
}

\notes{
\list{
	\listItem{$T_n^{f,a}$ je polynom, $\deg T_n^{f,a} \le n$.}
	\listItem{P��klad: $f(x) = \sin x$, $a = 0$, potom:
		$$ \eqalign{T_1^{\kern0.8pt \sin,0}(x) &= x \cr
		            T_2^{\kern0.8pt \sin,0}(x) &= x\qquad \textnote{nebo� $\sin''(0)=0$} \cr
		            T_3^{\kern0.8pt \sin,0}(x) &= x - {x^3\over6}\qquad \textnote{cvi�en�} \cr
		            T_4^{\kern0.8pt \sin,0}(x) &= x - {x^3\over6}} $$

		Pou�en�: $\deg T_n^{f,a}$ nemus� b�t roven $n$.
	}
	\listItem{Derivace Taylorova polynomu:
		$$ \left(T^{f,a}_n\right)'(x) = 0 + f'(a) + f''(a)(x-a) + {f'''(a)\over2}(x-a)^2 + $$
			$$ + \cdots + {f^{(n)}(a)\over(n-1)!}(x-a)^{n-1} = T^{f',a}_{n-1} $$

		Tedy $\left(T^{f,a}_n\right)'(x) = T^{f',a}_{n-1}$. (!)
	}
	\listItem{Spl�v�n� polynomu a funkce:
		$$ \sesac{\eqalign{T^{f,a}_n(a) &= f(a)\cr
		            \left(T^{f,a}_n\right)'(a) &= f'(a)\cr
			    &\vdots\cr
		            \left(T^{f,a}_n\right)^{(n)}(a) &= f^{(n)}(a)}}{(n+1) \textbox{po�adavk�.}} $$
	}
}
}

\scpart{Ot�zka}{
	$$ \lim_{x\to a}{f(x) - T^{f,a}_n(x) \over (x-a)^n} \hypothetically{=} 0 $$
}


\theorem{33}{o aproximaci funkce Taylorov�m polynomem}{
	Nech� $f$ je re�ln� funkce, $a \in \real$ a nech� existuje vlastn� $f^{(n)}(a)$.
	Nech� $\cP$ je polynom, $\deg \cP \le n$. Pak plat�:
	$$ \lim_{x\to a} {f(x)-\cP(x) \over (x-a)^n} = 0 \Longleftrightarrow \cP = T^{f,a}_n $$

	\note{
		\proofleftimpl{
			$$ \lim_{x\to a}{f(x) - T^{f,a}_n(x) \over (x-a)^n} = 0 $$
			(odpov�� na ot�zku je kladn�)
		}
		\proofrightimpl{
			Tuto vlastnost m� mezi polynomy stupn� $\le n$ jen Taylor�v.
		}
	}

	\proof{
		\proofleftimpl{
			Indukc�:
			\list{
			\namedListItem{$n=1$}{
				$$ \lim_{x\to a}{f(x) - T^{f,a}_1 \over x-a} = \lim_{x\to a}{f(x)-f(a)-f'(a)(x-a)\over x-a} $$
				$$ \lim_{x\to a}\left({f(x)-f(a)\over x-a} - f'(a)\right) = 0 $$
			}
			\namedListItem{$n-1 \derived n$}{
				$$ \lim_{x\to a}{f(x) - T^{f,a}_n(x) \over (x-a)^n} \becauseof{L'H ``${0\over0}$''}{=}
					\lim_{x\to a}{f'(x) - \left(T^{f,a}_n\right)'(x) \over n(x-a)^{n-1}} = $$
				$$ = {1\over n}\lim_{x\to a}{f'(x)-T^{f',a}_{n-1}(x) \over (x-a)^{n-1}} = 0
					\textnote{dle induk�n�ho p�edp.} $$
			}
			}
		}

		\proofrightimpl{
			\list{
			\namedListItem{1. krok}{
				$$ \lim_{x\to a}{\cP(x) - T^{f,a}_n(x) \over (x-a)^n}
					= \undernote{\lim_{x\to a}{\cP(x) - f(x) \over (x-a)^n}}{0 \textnote{p�edp.}}
					+ \undernote{\lim_{x\to a}{f(x) - T^{f,a}_n(x) \over (x-a)^n}}{0 \textnote{pr�v� dok.}}
				$$
			}
			\lemma{}{
				$Q$ polynom, $\deg Q \le n$, $a \in \real$ a plat�
				$$\lim_{x\to a}{Q(x) \over (x-a)^n} = 0 $$
				pak $Q \equiv 0$.

				\proof{
					Indukc�:
					\list{
					\nlistItem{$n=1$:

						$Q$ je line�rn�, $Q(a) = 0$ (viz n��e)
						$\Rightarrow$ $Q(x) = c(x-a)$, $c \in \real$.

						V�me:
						$$ \eqalign{\lim_{x\to a}{Q(x)\over x-a} &= 0 \cr
						 \Rightarrow 0 = \lim_{x\to a}{c(x-a)\over x-a} &= c
						   \Rightarrow c = 0 \Rightarrow Q(x) \equiv 0 } $$
					}
					\nlistItem{$n-1 \derived n$:
						$$ \sesac{\eqalign{\deg Q &\le n\cr
						                   \lim_{x\to a}{Q(x) \over (x-a)^n} &= 0}
							}{\Rightarrow Q(a) = 0} $$
						$$\Rightarrow \textbox{$a$ je ko�en polynomu $Q$}$$
						$$\Rightarrow Q(x) = (x-a)R(x), \textbox{$R$ je polynom, $\deg R \le n-1$}$$

						Potom
						$$ 0 = \lim_{x\to a}{Q(x)\over(x-a)^n} = \lim_{x\to a}{(x-a)R(x)\over(x-a)^n}
							= \lim_{x\to a}{R(x)\over (x-a)^{n-1}} $$
						$$ \becauseof{ind. p�edp.}{\Longrightarrow} R \equiv 0
							\Rightarrow Q(x) = (x-a)\cdot0 \Rightarrow Q \equiv 0 $$
					}
					}

					\sqed\  (d�kaz lemmatu)
				}
			}
			\penalty-1000
			\namedListItem{2. krok}{

				V�me:
				$$ \lim_{x\to a}{\cP(x) - T^{f,a}_n(x) \over (x-a)^n} = 0 $$
				($\cP(x) - T^{f,a}_n(x)$ je polynom, $\deg \le n$)
				$$ \becauseof{lemma}{\Longrightarrow} \cP(x) - T^{f,a}_n(x) \equiv 0 \Rightarrow \cP = T^{f,a}_n $$
			}
			}
			\qed
		}
	}

	\example{
		$$ \sesac{\eqalign{f &= \sin\cr x &= 0}}{\Rightarrow \lim_{x\to 0}{x-\sin x\over x^3} = {1\over6}} $$
		(plyne z implikace ``$\Leftarrow$'')
	}
}


\theorem{34}{obecn� tvar zbytku}{

	Nech� $f$ m� vlastn� $(n+1)$-n� derivaci v intervalu $[a,x]$, $a,x\in\real$, $x>a$.

	Nech� $\varphi$ je spojit� funkce na $[a,x]$, kter� m� na $(a,x)$ vlastn� a nenulovou derivaci.

	Pak existuje $\xi \in (a,x)$ takov�, �e
		$$ R^{f,a}_n(x) \defined f(x) - T^{f,a}_n(x) = {1\over n!}{\varphi(x)-\varphi(a)\over \varphi'(\xi)}
			f^{(n+1)}(\xi)(x-\xi)^n $$
	(obr�zek)

	\scpart{D�sledek 1 (Lagrange�v tvar zbytku):}{
		$$R^{f,a}_n(x) = {1\over (n+1)!}f^{(n+1)}(\xi)(x-a)^{n+1}\qquad (\existss\xi \in (a,x))$$
		\proof{
			Vol�m $\varphi(t) = (x-t)^{n+1}$. \DCV
		}
	}

	\scpart{D�sledek 2 (Cauchy�v tvar zbytku):}{
		$$R^{f,a}_n(x) = {1\over n!}f^{(n+1)}(\xi)(x-\xi)^n(x-a)\qquad (\existss\xi \in (a,x))$$
		\proof{
			Vol�m $\varphi(t) = t$. \DCV
		}
	}

	\proof{
		Pro $t \in [a,x]$ definujeme
		$$ F(t) := f(x) - T^{f,t}_n(x) = f(x) - \left(f(t) + {f'(t)\over1!}(x-t) + \cdots + {f^{(n)}(t)\over n!}(x-t)^n\right) $$

		\penalty-100
		Potom:
		\list{
			\listItem{$F$ je spojit� na $[a,x]$ a m� vlastn� derivaci na $(a,x)$.}
		        \listItem{$F(a) = f(x) - T^{f,a}_n(x) = R^{f,a}_n(x)$}
			\listItem{$F(x) = 0$}
			\listItem{$\varphi$ je spojit�, $\existss \varphi' \ne 0$ vlastn� na $(a,x)$}
		}

		Tedy podle \ias{}{23}{} (Cauchy o st�edn� hodnot�):
		$$ \existss \xi \in (a,x):\qquad {F(x)-F(a) \over \varphi(x) - \varphi(a)} = {F'(\xi) \over \varphi'(\xi)} $$

		P�itom:
		$$ F'(t) = -\left(f'(t) + f''(t)(x-t) + f'(t)(-1) + {f'''(t)\over2}(x-t)^2 + {f''(t)\over2}2(x-t)(-1) +\right.$$
			$$ \left. + \cdots + {f^{(n)}\over n!}n(x-t)^{n-1}(-1) + {f^{(n+1)}(t)\over n!}(x-t)^n\right) $$
		$$ \becauseof{po��r�n�}{\Longrightarrow} F'(t) = -{f^{(n+1)}(t)\over n!}(x-t)^n\qquad \forall t\in(a,x) $$
		$$ \Rightarrow F'(t) = -{f^{(n+1)}(\xi)\over n!}(x-\xi)^n $$

		Plat� tedy:
		% Customized to make the middle equal signs centered
		$$ \vcenter{\ialign{\strut\hfil #&# \hfil\cr
		             $\displaystyle{{F(x) - F(a)\over \varphi(x) - \varphi(a)}}$
				     &$\displaystyle{= {0-R^{f,a}_n(x)\over \varphi(x)-\varphi(a)}}$\cr
			     \hfill $=$ \hfill & \hfill $=$ \hfill\cr
			     $\displaystyle{{F'(\xi)\over \varphi'(\xi)}}$
				     &$\displaystyle{= {-{f^{(n+1)}(\xi)\over n!}(x-\xi)^n\over \varphi'(\xi)}}$\cr
			   }} $$
		
		To znamen�:
		$$ R^{f,a}_n(n) = {1\over n!}{\varphi(x)-\varphi(a)\over \varphi'(\xi)}f^{(n+1)}(\xi)(x-\xi)^n $$

		\qed
	}

	\shortnote{\ias{}{32}{} plat� i pro $x < a$.}
}

\example{
	Rozvoj funkce $e^x$:
	$$ f'(x) = e^x,\ f(x) = e^x, \ldots ,\ f^{(n)}(x) = e^x $$
	$$ a = 0 \Rightarrow f(a) = f'(a) = \cdots = f^{(n)}(a) = 1 $$

	Zave�me si:
	$$ T^{\hskip1pt\exp,0}_{\hskip1pt n} = \sum_{j=0}^n {x^j \over j!} $$

	Pak:
	$$ e^x = \sum_{j=0}^n {x^j\over j!} + R^{\exp,0}_n(x) = \sum_{j=0}^n {x^j\over j!} + e{\xi n\over(n+1)!}x^{n+1} $$

	Pro ka�d� pevn� $x$ je $\xi n \in (a,x)\quad \forall n \in N$, tedy $e^{\xi n} \le e^x$.  Tud��
	$$ |R^{\exp,0}_n(x)| \le {e^x|x|^{n+1}\over(n+1)!} $$
	a plat�
	$$ \lim_{n\to \infty} |R^{\exp,0}_n(x)| = 0 $$
	$$ \Rightarrow \lim_{n\to\infty}\sum_{j=0}^n {x^j\over j!} = e^x
		\Rightarrow e^x = \sum_{j=0}^\infty {x^j\over j!}\qquad \forall x \in \real$$
}

\impl{
	$$ \sum_{j=0}^\infty {x^j\over j!} = \lim_{n\to\infty}\left(1+{x\over n}\right)^n $$
	a speci�ln� pro $x = 1$:
	$$ e = \sum_{j=0}^\infty {1\over j!} = \lim_{n\to\infty}\left(1 + {1\over n}\right)^n $$
	$$ e = 1 + 1 + {1\over2} + {1\over6} + {1\over24} + {1\over120} + \cdots $$

	Chceme-li spo��tat $e$ s p�esnost� $0,001$:
	$$ e = \sum_{j=0}^n {1\over j!} + \sum_{j=n+1}^\infty {1\over j!}
		= \sum_{j=0}^n {1\over j!} + \sum_{j=0}^\infty {1\over (n+1+j)!} \le $$
	$$ \le \sum_{j=0}^n {1\over j!} + {1 \over (n+1)!}\sum_{j=0}^\infty {1\over(n+1)^j}
		= \sum_{j=0}^n {1\over j!} + {1 \over (n+1)!}{1 \over 1-{1\over n+1}}
		= \sum_{j=0}^n {1\over j!} + {1 \over n\cdot n!}$$

	Tedy:
	$$ \sum_{j=0}^n {1\over j!} < e < \sum_{j=0}^n {1\over j!} + {1 \over n\cdot n!}\qquad \forall n \in \nat $$
	(na p�enost $0,001$ sta�� $n = 6$)
}

\scpart{D�kaz iracionality e}{
	Nech� $e = {p / q}$, kde $p,q\in\nat$. Potom pro
	$$m = \sum_{j=0}^n {1\over j!}$$
	m�me
	$$m < {p \over q} < m + {1\over n\cdot n!}$$
	$$qmn! < pn! < qmn! + {q\over n}$$

	Nyn� sta�� zvolit $n > q$.

	\XXX
}

\scpart{Rozvoj funkce sin}{
	M�jme $\sin$, $a = 0$:

	$$ \eqalign{\eqalign{\sin'(x) &= \cos(x)\cr
	                     \sin''(x) &= -\sin(x)\cr
			     \sin'''(x) &= -\cos(x)\cr
			     \sin''''(x) &= \sin(x)}
		  & \eqalign{\sin'(0) &= 1\cr
		             \sin''(0) &= 0\cr
			     \sin'''(0) &= -1\cr
			     \sin''''(0) &= 0}} $$

	$$ \Rightarrow T^{\hskip1pt\sin,0}_{\hskip1pt 2n+1}(x) = \sum_{j=1}^n (-1)^{j+1} {x^{2j+1}\over(2j+1)!} $$
	$$ R\hskip1pt^{\sin,0}_{2n+1}(x) = {1\over(2n+2)!}\sin^{(2n+2)}(\xi n)\cdot x^{2n+2} $$
	$$ |R\hskip1pt^{\sin,0}_{2n+1}(x)| \le {|x|^{2n+2}\over(2n+2)!} \to 0\qquad \forall x,\ n\to\infty $$
	$$ \Rightarrow \sin x = \sum_{j=1}^\infty (-1)^{j+1} {x^{2j+1}\over(2j+1)!},\qquad x \in \real $$

	Obdobn�
	$$ \cos x = \sum_{j=0}^\infty (-1)^j {x^{2j}\over(2j)!},\qquad x \in \real $$
}

\scpart{Rozvoj funkce log(x+1)}{
	M�jme $f(x)\colon y=\log(x+1)$. Pro $x=0$ pak $f(0)=0$.

	$$ \eqalign{f'(x) &= {1\over1+x}\cr
	            f''(x) &= -{1\over(1+x)^2}\cr
		    f'''(x) &= {2\over(1+x)^3}\cr
		    &\ \vdots\cr
		    f^{(n)}(x) &= {(n-1)!\over(1+x)^n}(-1)^{n+1}} $$
	$$ f^{(n)}(0) = (-1)^{n-1}(n-1)! $$
	$$ \Rightarrow T^{\log(x+1),0}_n(x) = \sum_{j=1}^n {1\over j!}(-1)^{j-1}(j-1)!\cdot x^j
		= \sum_{j=0}^n(-1)^{j-1}{x^j\over j} $$
	$$ R^{\log(x+1),0}_n(x) = {1\over(n+1)!} {(-1)^n\cdot n!\over(1+\xi)^{n+1}}x^{n+1}
		= {(-1)^n\cdot x^{n+1}\over n(1+\xi)^{n+1}} $$
	To nelze odhadnout pro $|x|\ge1$, pro $|x|<1$ ano:
	$$ \Rightarrow \log(x+1) = \sum_{j=1}^\infty (-1)^{j-1} {x^j\over j},\qquad x \in (-1,1] $$
}

\definition{
	�ekneme, �e funkce $f$ je v bod� $a$ zprava {\bf mal� ��du $n$}, jestli�e
	$$ \lim_{x\to a_+}{f(x)\over(x-a)^n} = 0. $$
	P��eme
	$$ f(x) = \sigma\left((x-a)^n\right),\qquad x \to a_+ $$
	(Lauda�v symbol).

	\shortdef{Pozor}{Jde pouze o symboliku, {\it neplat�} �adn� rovnost!}
}

\examples{
\list{
	\listItem{$e^x = \sum_{j=0}^n {x^j\over j!} + \sigma(x^n),\quad x\to0_+$}
	\listItem{$x-\sin x = \sigma(x^2),\quad x\to0$}
	\listItem{$\cos x = 1 - {x^2\over2} + \sigma(x^3),\quad x\to0$}
}
}

\example{
	M�jme sumu
	$$ \sum_{n=1}^\infty {n! e^n\over n^{n+p}} $$
	Pro kter� $p$ konverguje?

	Raabe:
	$$ \lim_{n\to\infty} n\left({a_n\over a_{n+1}}-1\right)
		= \lim_{n\to\infty} n\left({1\over e}\left(1+{1\over n}\right)^{n+p} - 1\right) = $$
	$$ = \lim_{n\to\infty} n\left({1\over e}\cdot e^{(n+p)\log\left(1+{1\over n}\right)}-1\right)
		= \lim_{n\to\infty} n\left({1\over e}\cdot e^{(n+p)\left({1\over n}-{1\over2n^2}+\sigma\left(1\over n^2\right)\right)}-1\right) = $$
	$$ = p - {1\over2} - 1 + \sigma\undernote{\left(1\over n\right)}{\to0},$$
	tedy konverguje pro $p > {3\over2}$.
}



}


\bend
