\documentclass[compress]{beamer}
%%%%%%%%%%%%%%%%%%%%
% soubor definice.tex 
%%%%%%%%%%%%%%%%%%%%%%%
\useinnertheme[shadow]{rounded}
\setbeamertemplate{navigation symbols}{} 
\beamertemplateshadingbackground{yellow!1}{yellow!4}
\usecolortheme{orchid}
\usepackage{listings}
\lstloadlanguages{[ANSI]C}
\usepackage{pgf,xcolor}
\usepackage{amsmath,amssymb}
\usepackage{hyperref}
\usepackage{graphics}
\usepackage{multimedia}
\usepackage{enumerate}
\usepackage{verbatim}
\newcommand{\mujpokyn}{\hfill\hfill\hfill{ \tiny \color{black} \insertframenumber / \inserttotalframenumber }}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[utf8]{inputenc}
\usepackage[czech]{babel}
\usepackage{verbatim}
\graphicspath{{Fig/}} %\includegraphics{ctu.jpg} ano, ale na titulni - ne
\usepackage{framed}
%======= Titulni strana - podle vzoru ================
\subtitle[M1 TAYLOR] % (optional, use only with long paper titles)
{Semin\'a\v{r} 8}
\title[M1]{Taylor\r{u}v polynom\\
%\scriptsize{Mocninn\'e a Taylorovy \v{r}ady}}%P\v{r}\'{i}klady}
}
\date[M1sem 8 2018] % (optional, should be abbreviation of conference name)
{25. listopadu 2019}
\subject{Mocninn\'e a Taylorovy \v{r}ady}
%http://mat.fs.cvut.cz/wp-content/uploads/2012/01/M3zkpr.pdf Kapitola 2
%http://cgi.math.muni.cz/kriz/pseries/teorie.htm
%http://analyza.kma.zcu.cz/PREDMETY/M2_MA2/zaznamy/MA2_02_Mocninne_rady.pdf
% This is only inserted into the PDF information catalog. 
%%%%%%%%%%%%%%%%%prekladat pdflatex!
%\AtBeginSubsection[]
%{
%  \begin{frame}<beamer>
%    \frametitle{Obsah}
%    \tableofcontents[currentsection,currentsubsection]
%  \end{frame}
%}
\begin{document}
\lstset{basicstyle=\small,
%language=C,
showspaces=false,showtabs=fals,commentstyle=\color[rgb]{0.6,0,0},%
        keywordstyle=\color[rgb]{0.,0.,0.5}\bf,%
        backgroundcolor=\color[rgb]{0.9,1,0.87},emph={main,printf,scanf},emphstyle={\bf},%
       stringstyle=\color[rgb]{0.6,0.6,0},showstringspaces=false}
%%%%%%%%%%%%%%%%%%%
\begin{frame}
  \titlepage
\end{frame}
%%%%%%%%%%%%%%%%
%\begin{frame}
%  \frametitle{Obsah}
%  \tableofcontents
%  % You might wish to add the option [pausesections]
%\end{frame}
%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Taylorův polynom}
%http://cgi.math.muni.cz/kriz/pseries/teorie.htm
{\color{blue}\bf Taylorova věta}\\% z diferenciálního počtu:}\\%, kdy je funkce vyjádřena ve tvaru polynomu a zbytku: \\
Nechť  je funkce, která má derivace až do řádu  $n$ v uzavřeném intervalu $I$, jehož krajní body jsou čísla  $x$ a $x_0$. \\
Pak platí
$$f(x)=
\underbrace{f(x_0)+\frac{f^\prime(x_0)}{1!}(x-x_0)+\dots+\frac{f^{(n)}(x_0)}{n!}(x-x_0)^n}_{\color{blue}T_n(x)}+{\color{blue}R_{n+1}(x)},$$
kde  $R_{n+1}(x)$ je Taylorův zbytek, pro který platí
$$ {\color{blue}R_{n+1}(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}(x-x_0)^{n+1}},\ \mbox{kde }\ \xi\in I, \xi\ne x,x_0$$
\vfill 
\color{blue}\bf
$$
T_n(x)=  c_0 + c_1(x-x_0)+ c_2(x-x_0)^2 + \dots + c_n(x-x_0)^n
$$
$$T_n(x)= \sum_{k=0}^n c_k (x-x_0)^k,\quad c_k=\frac{f^{(k)}(x_0)}{k!}
$$
%{\color{blue}\bf Definice:}\\
%Nechť funkce  má v bodě   derivace všech řádů. Mocninnou řadu
%$$\sum_{n=0}^\infty \frac{f^{(n)}(x_0)}{n!}(x-x_0)^n$$
%nazýváme {\color{blue}\bf Taylorovou řadou funkce}  $f$ v bodě $x_0$ .
%%Je-li , mluvíme o Maclaurinově řadě.
%%Poznámka 1.3.  Dá se ukázat, že lze-li funkci  $f$ na nějakém intervalu , jehož vnitřním bodem je $x_0$, rozvést do mocninné řady o středu $x_0$, pak je takový rozvoj pouze jediný a je současně Taylorovým rozvojem funkce $f$.
\end{frame}
%%%%%%%%%%%%%%%%
%\begin{frame}
%\frametitle{Taylor\r{u}v polynom}
%V okol\'i $x_0\in D(f)$
%$$f(x)\simeq \sum_{k=0}^n c_k (x-x_0)^k,\quad c_k=\frac{f^{(k)}(x_0)}{k!}
%$$
%\end{frame}
\begin{frame}
\frametitle{Příklady}
Koeficienty po\v{c}\'it\'ame {\color{blue}\bf p\v{r}\'im\'ym v\'ypo\v{c}tem}.
\begin{itemize}
\item $\displaystyle {\rm e}^x = \sum_{k=0}^\infty \frac{x^k}{k!},\ x\in\mathbb{R}$
\item $\displaystyle \sin(x) = \sum_{k=0}^\infty (-1)^k\frac{x^{2k+1}}{(2k+1)!},\ x\in\mathbb{R}$
\item $\displaystyle \cos(x)= \sum_{k=0}^\infty (-1)^k\frac{x^{2k}}{(2k)!},\ x\in\mathbb{R}$
%\item $\displaystyle \ln(1+x)= ,\ x\in (-1,1)$
\item $\displaystyle (1+x)^p = \sum_{k=0}^\infty{p\choose k}x^k,\ x\in(-1,1),\ p\in\mathbb{R}$ (binomick\'a \v{r}ada)
\end{itemize}

\end{frame}
%\begin{frame}
%\frametitle{\v{R}ady element\'arn\'ich funkc\'i}
%Koeficienty po\v{c}\'it\'ame {\color{blue}\bf p\v{r}\'im\'ym v\'ypo\v{c}tem}.
%\begin{itemize}
%\item $\displaystyle {\rm e}^x = \sum_{k=0}^\infty \frac{x^k}{k!},\ x\in\mathbb{R}$
%\item $\displaystyle \sin(x) = \sum_{k=0}^\infty (-1)^k\frac{x^{2k+1}}{(2k+1)!},\ x\in\mathbb{R}$
%\item $\displaystyle \cos(x)= \sum_{k=0}^\infty (-1)^k\frac{x^{2k}}{(2k)!},\ x\in\mathbb{R}$
%%\item $\displaystyle \ln(1+x)= ,\ x\in (-1,1)$
%\item $\displaystyle (1+x)^p = \sum_{k=0}^\infty{p\choose k}x^k,\ x\in(-1,1),\ p\in\mathbb{R}$ (binomick\'a \v{r}ada)
%\end{itemize}
%\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Pou\v{z}it\'i zn\'am\'ych rozvoj\r{u}}
V okolí $x_0 = 0$
\begin{enumerate}
\item $\displaystyle{\rm e}^{2x} =1 + (2x) + \frac{(2x)^2}{2} + \frac{(2x)^3}{3!}  + \dots$
\item $\displaystyle \cos 2x = 1 -  \frac{(2x)^2}{2}  +  \frac{(2x)^4}{4!} -  \frac{(2x)^6}{6!} + \dots$
\item $\displaystyle {\rm e}^{-x^2} = 1 + (-x^2) + \frac{(-x^2)^2}{2} + \frac{(-x^2)^3}{3!}  + \dots$
\item $\displaystyle \frac{1}{\sqrt{1-x^2}}$ \hfill(přímým výpočtem)\\
\begin{tabular}{rlc}
$f(x)=$&$\displaystyle \frac{1}{\sqrt{1-x^2}}$&$f(x_0)=1$\\[2mm]
$f^\prime(x)=$&$\displaystyle \frac{x}{\sqrt{(1-x^2)^3}}$&$f^\prime(x_0)=0$\\[2mm]
$f^{\prime\prime}(x)=$&$\displaystyle \frac{1+2x^2}{(1-x^2)^2\sqrt{1-x^2}}$&$f^{\prime\prime}(x)=1$\\
\end{tabular}
\\\vfill$\displaystyle T_2(x) = 1 + \frac12 x^2$
\end{enumerate}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Pou\v{z}it\'i vzorce pro sou\v{c}et geometrick\'e \v{r}ady}
$$
\frac{a}{1-q}\quad \underbrace{\quad = \quad }_{|q|<1}\quad a\cdot \sum_{k=0}^\infty q^k
$$\vfill
\begin{enumerate}
\item $\displaystyle \frac{1}{4-2x} = \frac{1}{4(1-\frac{x}{2})} = \frac14 \sum_{k=0}^\infty \left(\frac x2\right)^k$ = $\small \displaystyle\frac14\left(1+\frac x2 + \frac{x^2}{4} + \dots\right)$\\\hfill pro $|\frac x2|<1$\\\vfill
\item   $\displaystyle \frac{1}{3+2x}= \frac{1}{3(1+\frac{2x}{3})} =\frac 13  \sum_{k=0}^\infty \left(-\frac {2x}{3}\right)^k$ = \\\hfill$\displaystyle\frac13\left(\!\! 1-\frac23 x + \frac 49 x^2 -\frac{8}{27} x^3 +\dots\!\!\right)$
\\\hfill pro $|\frac{2x}{3}|<1$\\
\end{enumerate}
\end{frame}
%
%\begin{frame}
%%\frametitle{Operace a konvergentními řadami}
%\frametitle{Násobení polynomů}
%\begin{enumerate}
%\item $\displaystyle\frac{\ln(1+x)}{1+x}$\\
%$\displaystyle \frac{1}{1+x} = 
%=\dots =x-\frac{3}{2}x^2 + \frac{11}{6}x^3 - \frac{25}{12}x^4 + \dots$\\\vfill
%\item $\displaystyle\frac{{\rm arctg}\ x}{1-x^2}=\dots =x+\frac{2}{3}x^3 + \frac{13}{15}x^5 + \dots$\\\vfill
%\item $\displaystyle x\cos x$\\\vfill
%\item $\displaystyle {\rm e}^x +\frac{\cos x}{1+x}$
%\end{enumerate}
%\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Příklad: Taylorův polynom 3. stupně pro funkci $y={\rm tg} x$ }
%Určete koeficienty Taylorova polynomu 3. stupně pro funkci $y={\rm tg} x$ 
v okolí $x_0 = 0$
%Využijeme i násobení řad.\vfill
\begin{itemize}
%\item $\displaystyle\frac{\ln(1+x)}{1+x}$ %=\dots =x-\frac{3}{2}x^2 + \frac{11}{6}x^3 - \frac{25}{12}x^4 + \dots$
%\item $\displaystyle\frac{{\rm arctg}\ x}{1-x^2}$ %=\dots =x+\frac{2}{3}x^3 + \frac{13}{15}x^5 + \dots$
%\item $\displaystyle x\cos x$
%\item $\displaystyle {\rm e}^x +\frac{\cos x}{1+x}$
\item{\color{blue}$f(x) =$ tg$(x)$}\hfill
tg$(x)\displaystyle = \frac{\sin x}{\cos x}$\hfill$\Rightarrow$\hfill$\cos(x){\rm tg}(x) = \sin x$
\end{itemize}
Koeficienty řady určíme porovnáním koeficientů levé a pravé strany\\% rovnosti řad.\\
%{\small 
tg$(x) = c_0 + c_1 x + c_2 x^2 + c_3x^3 +\dots$\\
$\cos(x) = 1 - \frac{x^2}{2} + \frac{x^4}{4!} + \dots$\hfill$\sin(x) = x -\frac{x^3}{3!} + \dots$
$\displaystyle\begin{array}{lcl}
\cos(x)\cdot{\rm tg}(x) &=& \left(1 - \frac{x^2}{2} + \frac{x^4}{4!} + \dots\right)\left( c_0 + c_1 x + c_2 x^2 + c_3x^3 +\dots\right)\\
&=&c_0 + c_1x + c_2 x^2 + c_3 x^3+ \dots\\
&&\hspace*{13mm}-\displaystyle\frac{c_0}{2}x^2-\frac{c_1}{2}x^3-\dots\\
&&\dots\\
 \sin(x) &=&\hspace*{10mm} x \hspace*{13mm}-\displaystyle\frac{x^3}{3!} + \dots
\end{array}
$\\
Soustava rovnic:\\
$\displaystyle 
\begin{array}{llcl}
x^0:&c_0&=&0\\
x:    &c_1 &=&1\\
x^2:&c_2-\frac{c_0}{2}&=&0\\
x^3:&c_3-\frac{c_1}{2}&=&-\frac{1}{6}
\end{array}
$
%$ \sin(x) = x -\frac{x^3}{3!} + \dots$
%}
\end{frame}
%
\begin{frame}
\frametitle{Výpočet přibližné hodnoty a odhad chyby $f(x) = \ln x,\quad x_0 = 1$}
\small
%$$f(x) = \ln x,\quad x_0 = 1$$
$$
%\begin{array}{rcrrcr}
%f(x)&=& \ln x                   &f(1) &=& 0\\[2mm]
%f^\prime(x) &=&\frac1x  &f^\prime(1) &=& 1 \\[2mm]
%f^{\prime\prime}(x) &=&-\frac{1}{x^2}&f^{\prime\prime}(1) &=& -1\\[2mm]
%f^{\prime\prime\prime}(x) &=&\frac{2}{x^3}&f^{\prime\prime\prime}(1) &=&2\\[2mm]
%%f^{\tiny(IV)}(x) &=& -\frac{6}{x^4}&f^{(IV)}(1) &=& -6\\[2mm]
%%f^{\scriptsize(V)}(x) &=& \frac{24}{x^5}&f^{(V)}(1) &=&24
%\end{array}
\begin{array}{ccccc}
f(x)= \ln x&
f^\prime(x) =\frac1x&
f^{\prime\prime}(x) =-\frac{1}{x^2}&
f^{\prime\prime\prime}(x) =\frac{2}{x^3}&
f^{\mbox{\tiny(IV)}}(x)= -\frac{6}{x^4}
\\
f(1)=0 &
f^\prime(1) = 1 &
f^{\prime\prime}(1)= -1&
f^{\prime\prime\prime}(1) =2&
f^{\mbox{\tiny(IV)}}(1)= -6
%f^{\scriptsize(V)}(x) &=& \frac{24}{x^5}&f^{(V)}(1) &=&24
\end{array}
$$
Výpočet přibližné hodnoty $\ln 0.9$
\begin{itemize}
\item $\displaystyle T_1(x) = x-1$
\hfill $\displaystyle R_2(x) = -\frac{1}{\xi^2}\frac1 2 (x-1)^2$\\
$\displaystyle f(0.9)\doteq T_1(0.9) = -0.1$\hfill
$\displaystyle  R_2(0.9) = -\frac{1}{\xi^2}\frac1 2 (-0.1)^2,\ \xi\in(0.9,\  1)$\\
$\displaystyle | R_2(0.9)|\leq  \frac{1}{0.81}\cdot \frac 12 \cdot 0.01$\hfill
$\displaystyle \left\vert \ln(0.9) - T_1(0.9)\right\vert \leq\frac{1}{162}$
\item $\displaystyle T_2(x) = (x-1) - \frac 12 (x-1)^2$
\hfill $\displaystyle R_3(x) = \frac{2}{\xi^3}\frac1 6 (x-1)^3$\\
$\displaystyle f(0.9)\doteq T_2(0.9) = -0.105$\hfill
$\displaystyle  R_3(0.9) = \frac{2}{\xi^3}\frac1 6 (x-1)^3,\ \xi\in(0.9,\  1)$\\
$\displaystyle | R_3(0.9)|\leq  \frac{1}{0.729}\cdot \frac 13 \cdot 0.001$\hfill
$\displaystyle \left\vert \ln(0.9) - T_2(0.9)\right\vert \leq\frac{1}{2187}$
\item $\displaystyle T_3(x) = (x-1)- \frac 12 (x-1)^2 + \frac 13 (x-1)^3$
\hfill $\displaystyle R_4(x) = -\frac{6}{\xi^4}\frac{1}{24} (x-1)^4$
%\item $\displaystyle T_4(x) = (x-1) - \frac 12 (x-1)^2 + \frac 13 (x-1)^3 -\frac 14 (x-1)^4$
%\hfill $\displaystyle R_5(x) = \frac{24}{\xi^2}\frac{1}{5!} (x-1)^5$
\end{itemize}
\end{frame}
\end{document}
\begin{frame}
\frametitle{Výpočet přibližné hodnoty a odhad chyby}
(sbírka Kračmar, Mráz, Neustupa)\\\vfill
\begin{enumerate}
\item[Př. 661]
$\displaystyle
f(x)=\sqrt{x}+\frac{x^2}{2},\quad x_0=4, \quad n=2,\quad f(4.4)=?
$\\\vfill
\item[Př. 662]
$\displaystyle
f(x)=
\sqrt{x+1}+\frac{x^3}{3},\quad x_0=0,\quad n=2, \quad f(0.5)=?
$\\\vfill
\item[V.,př. 38,]
$\displaystyle
f(x)=\sqrt{2x +1}-\frac{x^2}{2},\quad x_0=0,\quad n=2,\quad f(0.75)= ?
$
\end{enumerate}
\end{frame}

\end{document}
%%%%%%%%%%%%%%%%%%%


