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

%\chapter{Derivace re�ln� funkce}{

\definition{
	Nech� $f$ je re�ln� funkce, $a \in \real$. Pak {\bf derivac� funkce $f$
	v bod� $a$} rozum�me
	$$ f'(a) := \lim_{h\to 0} {f(a+h) - f(a) \over h} $$
	(pokud existuje).

	{\bf Derivac� zprava a zleva} rozum�me
	$$ \eqalign{f_+'(a) &= \lim_{h\to 0_+} {f(a+h)-f(a)\over h}\cr
	            f_-'(a) &= \lim_{h\to 0_-} {f(a+h)-f(a)\over h}} $$

	\notes{
	\list{
		\listItem{
			$$f'(a) \cases{\textbox{existuje}&$\cases{\textbox{vlastn�}&\cr
			                                         \textbox{nevlastn�}&$\cases{+\infty&\cr-\infty&}$}$\cr
				       \textbox{neexistuje}&} $$
		}

		\listItem{$f'(a)$ existuje $\Longleftrightarrow$ existuje $f_+'(a), f_-'(a) \et f_+'(a) = f_-'(a)$}

		\listItem{\M{f'(a) = \lim_{x\to a} {f(x)-f(a)\over x-a}} \DCV}
	}
	}
}

\examples{
\list{
	\listItem{$f(x) \equiv a$
		$$ f'(b) = \lim_{h\to 0} {f(b+h)-f(b)\over h} = \lim_{h\to 0} {a-a\over h} = \lim_{h\to 0} {0\over h} = 0 $$
	}

	\listItem{$f(x) = x^n$
		$$ f'(a) = \lim_{h\to 0} {(a+h)^n - a^n\over h} $$
		$$ = \lim_{h\to 0} {a^n + nha^{n-1} + \cn{n}{2}h^2a^{n-2} + \cdots + h^n - a^n \over h} $$
		$$ = na^{n-1} + \lim_{h\to 0} \left(\cn{n}{2}ha^{n-2} + \cdots h^{n-1}\right) = na^{n-1} $$
	}

	\listItem{$f(x) = e^x$
		$$ f'(a) = \lim_{h\to 0} {e^{a+h} - e^a\over h} = e^a \undernote{\lim_{h\to 0}{e^h-1\over h}}{1} = e^a $$
	}

	\listItem{$f(x) = \sin x$
		$$ f'(a) = \lim_{h\to 0} {\sin(a+h) - \sin a\over h}
			= \lim_{h\to 0}{\sin a \cdot \cos h + \cos a \cdot \sin h - \sin a\over h}{1} $$
		$$ = \lim_{h\to 0}{\sin a \cdot \undernote{\cos h - 1\over h}{\to0} + \cos a \cdot \undernote{\sin h\over h}{\to1}} = \cos a $$
	}

	\listItem{$f(x) = \cos x$ $\Rightarrow$ $ f'(a) = -\sin a$ \DCV}

	\listItem{$f(x) = |x|$
		$$ f'(a) = \cases{1 & $a>0$\cr
		                 -1 & $a<0$} $$

		$f'_+(0) = 1$, $f'_-(0) = -1$ $\Rightarrow$ $f'(0)$ neexistuje.
	}

	\listItem{$f(x) = \sign x$
		$$ f'(a) = 0,\ a\ne0 $$
		$$ f'_+(0) = \lim_{h\to 0}{\sign (0+h) - \sign 0\over h} = \lim_{h\to 0_+}{1\over h} = +\infty $$
		$$ f'_-(0) = \lim_{h\to 0}{\sign (0+h) - \sign 0\over h} = \lim_{h\to 0_-}{-1\over h} = +\infty $$
		$$ \sign\,\!'(0) = +\infty $$
	}
}
}


\theorem{16}{vztah derivace a spojitosti}{

	M�-li funkce $f$ v bod� $a$ {\bf vlastn�} derivaci, pak je $f$ spojit� v bod� $a$.

	\proof{
		$$ \lim_{x\to a} \left(f(x)-f(a)\right) = \lim_{x\to a} \undernote{f(x)-f(a)\over x-a}{f'(a) \in \real}\cdot\undernote{(x-a)}{\to0} = 0 $$

		\qed
	}

}


\theorem{17}{aritmetika derivac�}{
	Nech� existuj� $f'(a)$, $g'(a)$.

	\list{
		\listItem{$(f+g)'(a) = f'(a) + g'(a)$, je-li prav� strana definovan�.}
		\listItem{Je-li $g$ spojit� v $a$, pak $(fg)'(a) = f'(a)g(a) + f(a)g'(a)$, je-li prav� strana definovan�.}
		\listItem{Je-li $g$ spojit� v $a$, $g(a)\ne0$, pak
			$$\left(f\over g\right)'(a) = {f'(a)g(a) - g'(a)f(a)\over g(a)^2}.$$
			}
	}

	\proof{
	\list{
		\listItem{
			$$\lim_{h\to 0}{f(a+g)+g(a+h) - \left(f(a)+g(a)\right)\over h} $$
			$$ = \lim_{h\to 0} {f(a+h) - f(a)\over h} + \lim_{h\to 0} {g(a+h)-g(a)\over h} = f'(a) + g'(a) $$
		}

		\listItem{
			$$\lim_{h\to 0}{f(a+h)g(a+h) - f(a)g(a)\over h} $$
			$$ = \lim_{h\to 0}{f(a+h)g(a+h) - f(a)g(a+h) + f(a)g(a+h) - f(a)g(a) \over h} $$
			$$ = \lim_{h\to 0} \undernote{g(a+h)}{\scriptstyle{\to g(a)}\atop\textnote{spojitost!}}
					\undernote{f(a+h) - f(a) \over h}{\to f'(a)}
					+ f(a)\lim_{h\to 0}{g(a+h)-g(a)\over h} $$
			$$ = g(a)f'(a) + f(a)g'(a) $$
		}

		\listItem{
			$$\lim_{h\to 0}{{f(a+h)\over g(a+h)} - {f(a)\over g(a)}\over h} $$
			$$ = \lim_{h\to 0}{f(a+h)g(a) - f(a)g(a+h) \over g(a+h)g(a)h} $$
			$$ = \lim_{h\to 0}{f(a+h)g(a) - f(a)g(a) + f(a)g(a) - f(a)g(a+h) \over g(a+h)g(a)h} $$
			$$ = {g(a)f'(a) - g'(a)f(a) \over g(a)^2} $$
			(Op�t jsme pou�ili spojitost, tedy $\lim_{h\to 0}g(a+h) = g(a)$.)
		}
	}
	}
}


\theorem{18}{o derivaci slo�en� funkce}{
	Nech� $f$ m� derivaci v bod� $y_0$, $g$ v bod� $x_0$, $g$ je spojit� v $x_0$ a $y_0 = g(x_0)$.
	Potom $(f \circ g)'(x_0) = f'(y_0)g'(x_0) = f'(g(x_0))g'(x_0)$, je-li v�raz na prav� stran�
	definov�n (tedy se nejedn� o $0\cdot\infty$).

	\proof{
		\shortdef{Idea}{
			$$ (f \circ g)'(x_0) = \lim_{x\to x_0} {f(g(x))-f(g(x_0)) \over x-x_0} = $$
			$$ = \lim_{x\to x_0} {f(g(x)) - f(g(x_0)) \over g(x) - g(x_0)} \cdot {g(x)-g(x_0) \over x-x_0}
				= f'(g(x_0)) \cdot g'(x_0) $$
			Ale co kdy� $g(x) - g(x_0) = 0$?
		}

	\list{
		\listItem{Nech� $f'(y_0) \in \real$:

			Definujme funkci $$F(y) := \cases{{f(y)-f(y_0)\over y-y_0}&pokud $y \ne y_0$\cr
			                                  f'(y_0)                 &pokud $y = y_0$}$$
			$F$ definujeme na n�jak�m okol� bodu $y_0$. Potom je $F$ spojit� v bod� $y_0$.

			V�me, �e $f$ je definov�na na n�jak�m okol� $y_0$ a $g$ na n�jak�m okol� $x_0$.
			Tvrd�m tedy, �e
			$$ \lim_{x\to x_0} F(g(x)) = f'(y_0), $$
			nebo�
			$$ \lim_{x\to x_0} g(x) = g(x_0) \et \lim_{y\to g(x_0)} F(y) = F(g(x_0)) $$
			(to vyhovuje p�edpokladu 2 v�ty o spojitosti slo�en� funkce).

			$$ (f \circ g)'(x_0) = \lim_{x\to x_0} {f(g(x)) - f(g(x_0)) \over x - x_0}
				= \lim_{x\to x_0} F(g(x)) \cdot {g(x)-g(x_0)\over x-x_0} = F'(y_0)g'(x_0) $$
			(dle \ref{VOAL}, nebo� v�raz vpravo je definov�n).
		}

		\listItem{Nech� $f'(y_0) = \pm\infty$:

			Proto�e $f'(y_0)g'(x_0)$ je definov�n (dle p�edpokladu) a $f'(y_0) = \pm\infty$,
			pak jist� $g'(x_0) \ne 0$.
			Tedy $\existss \cP(x_0,\delta)$ takov�, �e ${g(x)-g(x_0)\over x-x_0} \ne 0$,
			tedy $g(x) \ne g(x_0)$. Tud��
			$$ (f \circ g)'(x_0) = \lim_{x\to x_0} {f(g(x)) - f(g(x_0)) \over g(x) - g(x_0)}
								\cdot{g(x)-g(x_0)\over x-x_0}
					= f'(g(x_0)) \cdot g'(x_0) $$
		}
	}

		\qed
	}

	\example{
	\list{
		\listItem{$(a^x)' = \left(e^{x\log a}\right)' = e^{x\log a} \cdot \log a = a^x\log a$\hfill $(a>0)$}
		\listItem{$(x^x)' = \left(e^{x\log x}\right)' = e^{x\log x} \cdot (x\log x)' = x^x\cdot(1\log x + x{1\over x}) = x^x(\log x + 1)$\hfill $(x>0)$}
	}
	}
}


\theorem{19}{o derivaci inverzn� funkce}{

	Nech� $f$ je spojit� a ryze monot�nn� na intervalu $I$, $a$ bu� vnit�n� bod $I$.
	Ozna��me $b = f(a)$.

	\list{
		\listItem{Je-li $f'(a) \in \real^*\setminus\{0\}$:
			$$(f^{-1})'(b) = {1\over f'(a)} = {1\over f'(f^{-1}(b))}$$
			}
		\listItem{Je-li $f'(a) = 0$ (nap�. v nule pro $x^3$) a $f$ je rostouc� (klesaj�c�):
			$$(f^{-1})'(b) = +\infty\ (-\infty)$$
			}
	}

	\proof{
		\shortdef{Idea}{
			$$ f^{-1}(y) = x,\ y = f(x) $$
			$$ (f^{-1})'(b) = \lim_{y\to b} {f^{-1}(y) - f^{-1}(b) \over y-b} = \lim_{x\to a} {x-a \over f(x) - f(a)} = {1 \over f'(a)} $$
		}

		\shortdef{V�me}{
			$f^{-1}$ je definovan�, spojit� a ryze monot�nn� na $f(I)$,
			$b$ je vnit�n�m bodem itnervalu $f(I)$, $a = f^{-1}(b)$.
		}

		\list{
			\listItem{ $ (f^{-1})'(b) = \lim_{y\to b} {f^{-1}(y) - f^{-1}(b) \over y-b} $

				Definujme funkci $$F(y) := \cases{{f(x)-f(a)\over x-a}&pokud $x \ne a$\cr
								  f'(a)               &pokud $x = a$}$$
				Tak $\lim_{x\to a} F(x) = f'(a)$ a z�rove� je $F$ spojit� v $a$
				(bude zastupovat vn�j�� funkci).

				D�le $\lim_{y\to b} f^{-1}(y) = f^{-1}(b)$ (vnit�n� funkce),
				nebo� $f^{-1}$ je spojit� na $f(I)$. Tedy dle v�ty o spojitosti
				slo�en� funkce:
				$$ \lim_{y\to b} {f(f^{-1}(y)) - f(a) \over f^{-1}(y) - a} = f'(a) $$
				$$ \eqalign{f'(a) &= \lim_{y\to b} {f(f^{-1}(y)) - f(f^{-1}(b)) \over f^{-1}(y) - f^{-1}(b)}\cr
				                  &= \lim_{y\to b} {y-b \over f^{-1}(y) - f^{-1}(b)}\cr
						  &= {1 \over \lim_{y\to b} {f^{-1}(y) - f^{-1}(b) \over y-b}} } $$
			}

			\listItem{Bez �jmy na obecnosti nech� je $f$ rostouc�, $f'(a) = 0$.

				$$\sesac{
					\eqartalign{
					x>a & \Rightarrow f(x) > f(a) & \Rightarrow y > b & \Rightarrow f^{-1}(y) > f^{-1}(b)\cr
					x<a & \Rightarrow f(x) < f(a) & \Rightarrow y < b & \Rightarrow f^{-1}(y) < f^{-1}(b)
					}
				}{\Rightarrow \lim_{y\to b} {f^{-1}(y) - f^{-1}(b) \over y-b} = +\infty } $$
			}
		}

		\qed
	}

	\note{
		Vyu�ili jsme v�tu:
		$\lim_{x\to a} g(x) = 0$, $g(x) > 0$ na $\cP(a,\delta)$,
		pak $\lim_{x\to a} {1\over g(x)} = +\infty$
		(viz \ias{2}{8} a \ref{Heine}).
	}

	\examples{
	\list{
		\listItem{$(e^x)' = e^x$, $(\log x)' = {1 \over x}$, nebo� $\exp^{-1} = \log$.
		
			$$ e^x = y,\ x = \log y $$
			$$ (e^x)' = {1 \over (\log y)'} = {1 \over {1 \over y } } = y = e^x $$
			$$ (\log y)' = {1 \over (e^x)'} = {1 \over e^x } = {1 \over y} $$
		}

		\listItem{$(\arcsin x)'$

			$$ y = \arcsin x,\ x = \sin y $$
			$$ \cos y = \sqrt{1-\sin^2 y},\ y \in (-{\pi\over2},{\pi\over2}) $$
			$$ (\arcsin x)' \becauseof{\ias{}{19}{}}{=} {1 \over (\sin y)'} = {1 \over \cos y} = {1 \over \sqrt{1-\sin^2 y}}
				= {1 \over \sqrt{1-x^2}},\ x \in (-1,1) $$
		}

		\listItem{$(\arctg x)'$

			$$ y = \arctg x,\ x = \tg y $$
			$$ 1 + \tg^2 y = {\cos^2 y + \sin^2 y \over \cos^2y} = {1 \over \cos^2 y} $$
			$$ (\arctg x)' \becauseof{\ias{}{19}{}}{=} {1 \over (\tg y)'} = {1 \over {1 \over \cos^2 y}}
				= \cos^2 y = {1 \over 1 + \tg^2 y} = {1 \over 1 + x^2},\ x \in \real $$
		}

		\listItem{$(\arccos x)' = {-1 \over \sqrt{1-x^2}},\ x \in (-1,1)$}

		\listItem{$(\arccotg x)' = {-1 \over 1+x^2},\ x \in \real$}
	}
	}

}


\penalty-1000
\theorem{20}{nutn� podm�nka existence lok�ln�ho extr�mu}{

	Nech� $M \subseteq \real$, $f\colon M \to \real$. Nech� $f$ m� v bod� $a \in M$ lok�ln� extr�m. Potom bu�
	$f'(a)$ neexistuje, nebo $f'(a) = 0$ (tedy m� funkce v tomto bod� te�nu rovnob�nou s osou x).

	\proof{
		Sporem: Nech� $f'(a)$ existuje, le� $f'(a) \ne 0$.

		Z existence derivace plyne existence okol� $\cU(a,\delta) \subseteq M$.
		Bez �jmy na obecnosti nech� $f'(a) > 0$. Potom $\existss \xi > 0$ takov�,
		�e ${f(x) - f(a) \over x - a} > 0\quad \forall x \in \cU(a,\xi)$.

		Tedy, je-li $x<a$, pak $x-a < 0$ $\Rightarrow$ $f(x) - f(a) < 0\quad \forall x \in \cP^-(a,\xi)$.

		Naopak, je-li $x>a$, pak $x-a > 0$ $\Rightarrow$ $f(x) - f(a) > 0\quad \forall x \in \cP^+(a,\xi)$.

		$$
		\sesac{\eqalign{f(x) < f(a),\ &x \in \cP^-(a,\xi)\cr
		                f(x) > f(a),\ &x \in \cP^+(a,\xi)}
		      }{\Rightarrow \textbox{$f$ nem� lok�ln� extr�m v $a$}}
		$$

		\XXX
	}

	\scpart{Typick� �loha}{
		$f$ spojit� na $[a,b]$, najd�te maximum (minimum) funkce na $[a,b]$.
		
		Postup:
		\list{
			\tlistItem{$f$ spojit� na $[a,b]$ $\Rightarrow$ $f$ nab�v� maxima, minima}
			\tlistItem{\ias{}{20}{} $\Rightarrow$ tyto extr�my mohou b�t pouze v bodech, kde:
				\list{
				\rlistItem{$f'(x_0) = 0$}
				\rlistItem{$f'(x_0)$ neexistuje}
				\rlistItem{$x_0 = a$, $x_0 = b$}
				}
			}
		}
	}

	\example{
		Tzv. ``ba��v probl�m'' --- ba�a m� k dispozici 100m plotu a chce si s n�m oplotit co nejv�t�� pastvinu.
		Definuje si tedy hodnot�c� funkci pastviny
		$$ f(x) = 50x - x^2,\ x \in [0,50] $$
		a derivac� hled� maximum:
		$$ f'(x) \textbox{existuje pro} \forall x \in (0,50) $$
		$$ f'(x) = 50-2x $$
		$$ f'(x) = 0 \Leftrightarrow x = 25 $$

		Tedy m�me 3 kandid�ty na extr�my:
		$$ \eqalign{x = 25 &\Rightarrow f(x) = 625\rm\,m^2\cr
		            x = 0  &\Rightarrow f(x) = 0\cr
		            x = 50 &\Rightarrow f(x) = 0} $$
	}

}


\bend
