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

\scpart{Normovan� vektorov� prostor}{
	Normovan� vektorov� prostor (nad $\real$) $X$:
	$||\cdot||\colon X \to \real$ spl�uj�c� (pro $y,x \in X$, $\lambda \in \real$)
	\list{
	\listItem{$||x|| \ge 0$, $||x|| = 0 \Leftrightarrow x = 0$}
	\listItem{$||\lambda x|| = |\lambda| ||x||$}
	\listItem{$||x+y|| \le ||x|| + ||y||$}
	}

	$d(x,y) := || x - y ||$ je metrika.

	\example{
		$\real^n$ s metrikou $d_p$ je normovan� vektorov� prostor,
			$$ ||x||_p = (|x_1|^p+\cdots+|x_n|^p)^{1/p} $$
			$$ ||x||_\infty = \max_{1\le i \le n} |x_i $$
		Podobn� pro $C[a,b]$.
	}

	\shortdef{Banach�v prostor}{Normovan� vektorov� prostor, pro n�j� je metrika $d(x,y) = || x - y ||$ �pln�.}
}

\scpart{Vektorov� prostor se skal�rn�m sou�inem}{

	M�jme $X$ vektorov� prostor nad $\real$
	se zobrazen�m $\left<\cdot,\cdot\right>\colon X \times X \to \real$:
	\list{
	\listItem{$\left<x,x\right>\ge 0$, $\left<x,x\right> = 0 \Leftrightarrow x=0$}
	\listItem{$\left<\kappa x + \lambda x', y\right> = \kappa\left<x,y\right> + \lambda\left<x',y\right>$\hfill$\forall x,x',y \in X,\ \forall \kappa,\lambda \in \real$}
	\listItem{$\left<x,y\right> = \left<y,x\right>$}
	}

	\example{
		M�jme $\real^n$, pak
		$$ \left<x,y\right> = x_1y_1 + x_2y_2 + \cdots + x_my_m $$

		M�jme $C[a,b]$, pak
		$$ \left<f,g\right> = \int_a^b f(x)g(x)\,dx $$
	}

	Ka�d� vektorov� prostor se skal�rn�m sou�inem
	je normovan� vektorov� prostor
	(tedy i metrick�, tedy i topologick� prostor), nebo�:
	$$ || x || := \sqrt{\left<x,x\right>} $$
	Dle Cauchyho--Schwarzovy nerovnosti (vezm�me ji jako {\bf V1})
	plat� troj�heln�kov� nerovnost:
	$$ X\hskip0.25em \hbox{m� skal. sou�in},\ x,y \in X \Rightarrow \left<x,y\right>^2 \le \left<x,x\right>\left<y,y\right> $$
	(rovnost nast�v� pr�v�, kdy� $x = cy$ kde $c \in \real$).

	$$ \Longrightarrow \left<x,y\right> \le \sqrt{\left<x,x\right>\left<y,y\right>} \Longleftrightarrow $$
	$$ \eqalign{
	   \left<x,x\right> + \left<y,y\right> + 2\left<x,y\right>
		&\le \left(\sqrt{\left<x,x\right>}+\sqrt{\left<y,y\right>}\right)^2 \cr
	 \left<x+y,x+y\right>
		&\le \left(\sqrt{\left<x,x\right>}+\sqrt{\left<y,y\right>}\right)^2 \cr
	 \sqrt{\left<x+y,x+y\right>}
		&\le \sqrt{\left<x,x\right>}+\sqrt{\left<y,y\right>} \cr
	 ||x+y|| &\le ||x||+||y||} $$

	\shortdef{Hilbert�v prostor}{�pln� vektorov� prostor se skal. sou�inem (tj. $d(x,y) = \sqrt{\left<x-y,x-y\right>}$).}
}

\penalty-200

Budeme uva�ovat $\real^m$,
$$ \left<x,y\right> = x_1y_1 + \cdots + x_my_m $$
$$ ||x||_2 = ||x|| = |x| = \sqrt{\left<x,x\right>} = \sqrt{x_1^2 + \cdots + x_m^2} $$
a d�le otev�enou $D \subset \real^m$, $f\colon D \to \real$, $a \in D$.


\list{
\listItem{Derivace funkce $f$ v bod� $a$ ve sm�ru $v$ ($v \in \real^m$, $v \ne 0$)
	je limita
	$$ \lim_{t\to0} {f(a+vt)-f(a)\over t} =: D_vf(a) $$

	Nap�. vezmeme ��stici a po�leme ji ve sm�ru $v$ skrz $D$
	(tedy polet� po p��mce $a+vt$, $t \in \real$),
	$f$ bude m��it teplotu v $D$. Pak okam�it� zm�na teploty
	��stice v bod� $a$ je pr�v� $D_vf(a)$.
	$$ f(a+vt) = f(a) + D_vf(a)\cdot t + o(t)\qquad t \to 0 $$
	(kde $o(t)$ je n�jak� mr�av� chyba,
	kter� je�t� nav�c jde sama taky k nule).
}

\listItem{Parci�ln� derivace funkce $f$ v bod� $a$ podle prom�nn� $x_i$ ($1\le i \le m$)
	je limita
	$$ \lim_{h\to0} {f(a_1,\ldots,a_{i-1},a_i+h,a_{i+1},\ldots,a_m)-f(a_1,a_2,\ldots,a_m)\over h} =: {\delta f \over \delta x_i}(a) $$

	$$ {\delta f \over \delta x_i}(a) = Df_{e_i}(a) $$

	{\bf Gradientem} funkce $f$ v bod� $a$ nazveme
	$$ \grad f(a) = \left({\delta f \over \delta x_1}(a), {\delta f \over \delta x_2}(a),\ldots, {\delta f \over \delta x_m}(a)\right) $$

	\example{
		$$ {\delta (yx^2e^y - z^3 \arctg x) \over \delta y} = x^2(e^y + ye^y) $$
	}
}

\listItem{Funkce $f$ m� v bod� $a$ {\bf (tot�ln�) diferenci�l}
	(neboli je $f$ v $a$ {\bf diferencovateln�}),
	existuje-li linearn� zobrazen� $L\colon \real^m \to \real$ takov�, �e
	$$ \lim_{v\to\overline{0}} {f(a+v) - f(a) - L(v) \over ||v||} = 0 $$
	$$ \Longleftrightarrow f(a+v) = f(a) + L(v) + o(||v||) \qquad v \to \overline{0} $$
	($v \to \overline{0}$ p�itom znamen�, �e jeho euklidovsk� vzd�lenost od nulov�ho vektoru jde k nule).
	
	Mohu vz�t $L$ podle $a$, tedy $L = L_a$, nebo tak� $L := Df(a)$, $L(v) = Df(a)(v)$.

	\smallskip

	M�jme $f\colon D \to \real^n$, tj. $f = (f_1,f_2,\ldots,f_n)$, $f_i\colon D \to \real$.
	Pak $f$ m� v $a$ (tot�ln�) diferenci�l,
	existuje-li line�rn� zobrazen� $L\colon \real^m\to\real^n$ takov�, �e
	$$ \lim_{v\to\overline{0}} {||f(a+v)-f(a)-L(v)|| \over ||v||} = 0 $$
	$$ \Longleftrightarrow f(a+v) = f(a) + L(v) + \alpha(v) \qquad v \to \overline{0} $$

	P�itom $\alpha\colon \real^m \to \real^n$, kde
	$$ || \alpha(v) || = o(||v||) \qquad v \to \overline{0} = \undernote{(0,0,\ldots,0)}{m} $$
}
}

\penalty-500

\theorem{2}{vlastnosti tot�ln�ho diferenci�lu}{

	M�jme $D \subset \real^m$, $f = (f_1,\ldots,f_n)$.

	\list{
	\listItem{$f\colon D \to \real^n$ je diferencovateln� v bod� $a \in D$,
		pr�v� kdy� ka�d� $f_i\colon D \to \real$ je diferencovateln� v bod� $a$.
	}
	\listItem{Je-li $f\colon D \to \real^n$ diferencovateln� v bod� $a \in D$,
		je v $a$ tak� spojit�.
	}
	\listItem{Je-li $f\colon D \to \real$ diferencovateln� v bod� $a \in D$,
		m� v $a$ v�echny parci�ln� derivace ${\delta f \over \delta x_i}(a)$,
		$$ Df(a)(h) = {\delta f \over \delta x_1}(a)h_1 + {\delta f \over \delta x_2}(a)h_2
			+ \cdots + {\delta f \over \delta x_m}(a)h_m $$
	}
	\listItem{Je-li $f\colon D \to \real$ diferencovateln� v bod� $a \in D$
		a m�me-li $0 \ne v \in \real^m$, pak
		$$ D_vf(a) = Df(a)(v) $$
	}
	}

	\proof{
	\list{
		\listItem{Cvi�en� na definice.}
		\listItem{Z�ejm�.}
		\listItem{Vezm�me $L = Df(a)$, to znamen�:
			$$ L(h) = L(\sum_{i=1}^m h_ie_i) = \sum_{i=1}^m h_iL(e_i)
				= \alpha_1h_1 + \cdots + \alpha_mh_m $$
			$$ f(a+te_i) - f(a) = L(te_i) + o(||te_i||) = tL(e_i) + o(|t|)
				= t\alpha_i + o(|t|) \derived \alpha_i - {\delta f \over \delta x_i}(a) $$
		}
		\listItem{Podobn�, \DCV.}
	}
		\qed
	}

	\shortimpl{$Df(a)$ je jednozna�n� ur�en�.}

	\ias{}{2}{(iii)} m��eme d�le zobecnit jako
	$$ \left<\grad f(a),h\right> = \left(\diff{f}{x_1}(a),\ldots,\diff{f}{x_m}(a)\right)
		\cdot \pmatrix{h_1 \cr h_2 \cr \vdots \cr h_m} $$

}

\definition{

	M�jme $D \subset \real^m$, $f\colon D \to \real^n$.
	Pak definujme {\bf Jacobiho matici zobrazen�} $f$ v bod� $a$ jako
	$$ Df(a) = \left(\diff{f_i}{x_j}(a)\right)_{i = 1\ldots n \atop j=1 \ldots m} $$

	\shortdef{Jakobi�n}{Determinant Jacobiho matice, postav�me-li $m=n$.}

}

\penalty-500

\impl{ % 3
	$$ Df(a)(h) = \pmatrix{
		l_{1,1} & l_{1,2} & \ldots & l_{1,m} \cr
		l_{2,1} & l_{2,2} & \ldots & l_{2,m} \cr
		\vdots & & & \vdots \cr
		l_{n,1} & l_{n,2} & \ldots & l_{n,m}
	} \cdot \pmatrix{h_1 \cr h_2 \cr \vdots \cr h_m} = (\ldots) \in \real^n$$
	$$l_{i,j} = \left(\diff{f_i}{x_j}(a)\right)$$

	\shortnote{V�imn�me si, �e ��dky tvo�� gradienty $f_i$.}
}

\examples{
\list{
	\listItem{Vezm�me $f\colon \real^2 \to \real$ a definujme ji jako
		$$ f = \cases{1 & $y = x^2$ \cr 0 & jinak} $$

		Pak pro $a = \overline{0}$ plat�
		$$ D_vf(\overline{0}) = 0 \qquad \forall v $$
		ale $f$ nen� spojit� v $\overline{0}$.
	}
	\listItem{Na os�ch $f=1$, jinak $f=0$. Pak pro $a=0$ plat�
		$$ \diff{f}{x}(\overline{0}) = \diff{f}{y}(\overline{0}) = 0 $$
		ale $f$ nem� ��dnou jinou sm�rovou derivaci.
	}
}
}


\theorem{4}{o vztahu parci�ln�ch derivac� a diferenciovatelnosti}{
	M�jme $f\colon V \to \real$ a $U \subset \real^m$ okol� $a$.
	$f$ nech� m� na $U$ v�echny parci�ln� derivace
	a ka�d� $\diff{f}{x_i}$ nech� je spojit� v $a$.
	Pak $f$ je v bod� $a$ diferencovateln�.

	\proof{
		Hlavn� my�lenka (podrobn� v u�ebn�m textu):

		$m = 2$, vezm�me $a = (0,0)$.
		Spojme $a$ s n�jak�m bodem $h$ v $U$ lomenou �se�kou $s_1,\ldots,s_n$.
		Pak dle Lagrangovy v�ty o st�edn� hodnot�
		p��r�stek $f$ na $s_i$ bude $\diff{f}{x_i}(\zeta)\cdot h_i$.

		$$ f(h) - f(\overline{0}) = \sum_{i=1}^m \textbox{p��r�stek $f$ na $s_i$}
			= \sum_{i=1}^m \diff{f}{x_i}(\zeta_i)h_i = $$
		(kde bod $\zeta_i$ le�� n�kde na �se�ce $s_i$).
		$$ = \sum_{i=1}^m \diff{f}{x_i}(\overline{0}) + o(||h||) $$
		\qed
	}
}

\penalty -500

\theorem{5}{}{
	Nech� $f$ je spojit� na �se�ce $u$
	a diferenciovateln� v ka�d�m vnit�n�m bod� $u$.  Pak
	$$\existss \zeta \in u: f(b) - f(a) = Df(\zeta)(b-a)$$

	\proof{
		Vezm�me $F\colon [0,1]\to\real$
		a nadefinujme si ji jako $F(t) = f(a+th)$,
		$h = b-a$, $t \in [0,1]$.

		$F$ je z p�edpokladu spojit� na $[0,1]$,
		$$ F' = \lim_{\Delta\to 0} {f(a+th+\Delta h) - f(a+th) \over \Delta} = $$
		$$ = \lim_{\Delta\to 0} {Df(a+th)(\Delta h) + o(\overbrace{||\Delta h||}^{|\Delta|\cdot||h||}) \over \Delta} =
			Df(a+th)(h) $$

		Lagrangova v�ta o st�edn� hodnot� tvrd�, �e
		$$ \existss t_0 \in (0,1): F(1) - F(0) = F'(t_0) = Df(\undernote{a+t_0h}{\zeta})(h) $$
		\qed
	}

	\impl{
		$D \subset \real^m$ bu� otev�en� a souvisl�,
		$f\colon D \to \real$,
		$Df(a) = {\tilde 0}$ (nulov� line�rn� zobrazen�) pro $\forall a \in D$.
		Pak $f$ je na $D$ konstantn�.

		\proof{
			Vezm�me n�jak� dva body $a$ a $b$ a spojme je lomenou �arou
			(to um�me z \ias{1}{15}{}).
			Pak hodnoty v ``bodech zlomu'' (nazv�me je $c_1,\ldots,c_n$)
			budou dle \ias{}{5}{} v�echny stejn�:
			$$f(a) = f(c_1) = f(c_2) = f(c_3) = \cdots = f(b)$$
			$$ f(c_2) - f(c_1) = \undernote{Df(\zeta)}{\tilde 0}(c_2-c_1)=0 \Rightarrow f(c_2) = f(c_3) $$
			\qed
		}
	}
}

\example{
	M�jme $a \in U \subset \real^m$, $f\colon V \to \real$, $v \in \real^m$, $||v||=1$

	$$ D_vf(a) = \lim_{t\to0} {f(a+tv)-f(a) \over t} $$

	Pro jak� sm�r $v$ je $|D_vf(a)|$ $c_0$ nejv�t��?
	P�edpokl�dejme, �e existuje $Df(a)$.
	Pak $D_vf(a) = Df(a)(v)$.
	$$ |D_vf(a)| = |Df(a)(v)|=|\left<\grad f(a),v \right>| $$
	To ale um�me odhadnout Cauchy--Schwarzovou nerovnost� jako
	$$ \le || \grad f(a)|| \cdot ||v|| = ||\grad f(a)|| $$
	a nav�c v�me, �e rovnost nast�v�,
	pr�v� kdy� $v$ je n�jak� n�sobek gradientu.
	Proto�e $v$ je jednotkov� vektor,
	takov� jsou pr�v� dva:
	$$ v^+ = {1 \over || \grad f(a) ||} \grad f(a) $$
	$$ v^- = - {1 \over || \grad f(a) ||} \grad f(a) $$

	$v^+$ a $v^-$ jsou ony sm�ry nejv�t��ho r�stu,
	resp. poklesu funkce $f$ v bod� $a$.
	Ten je tedy ur�en gradientem.
}


\penalty-500


\scpart{Te�n� (nad)rovina}{

	M�jme $D \subset \real^2$ otev�enou, $f \colon D \to \real$, $(x_0,y_0) \in D$.
	Pak {\bf plocha} bude $\{(x,y,f(x,y)): (x,y) \in D\}$.

	Nech� $f$ m� v bod� $(x_0,y_0)$ diferenci�l:
	$$ f(x,y) = f(x_0,y_0) + \diff{f}{x}(x_0,y_0)(x-x_0) + \diff{f}{y}(x_0,y_0)(y-y_0) + o(\sqrt{(x-x_0)^2+(y-y_0)^2}) $$
	Zapome�me na chybu a vezm�me pouze afinn� funkci:
	$$ z(x,y) = \undernote{f(x_0,y_0)}{z_0} + \diff{f}{x}(x_0,y_0)(x-x_0) + \diff{f}{y}(x_0,y_0)(y-y_0) $$
	Graf $T$ t�to funkce pak nazveme {\bf te�nou rovinou} $T$ k plo�e $P$
	v bod� $(x_0,y_0,z_0=f(x_0,y_0))$.

	\medskip

	V�imn�me si, �e $T$ je jedin� rovina $L=L(x,y)=z_0+A(x-x_0)+B(y-y_0)$,
	kter� spl�uje
	$$ f(x,y) = L(x,y) + o(\sqrt{(x-x_0)^2+(y-y_0)^2}) $$

	$$ \diff{f}{x}(x_0,y_0)(x-x_0) + \diff{f}{y}(x_0,y_0)(y-y_0) - (z-z_0) = 0 $$
	$$ \grad f((x_0,y_0)) = \left(\diff{f}{x}(x_0,y_0),\diff{f}{y}(x_0,y_0)\right) $$
	$$ V \in \real^3 = \left(\diff{f}{x}(x_0,y_0),\diff{f}{y}(x_0,y_0),-1\right) $$
	$$ \left<V,(x-x_0,y-y_0,z-z_0)\right> = 0\qquad \forall (x,y,z) \in T $$

	Tedy $V$ je kolm� na $T$,
	neboli $V$ je norm�lov� vektor roviny $T$.

}

\theorem{7}{}{

	M�jme otev�enou $U \subset \real^m$,
	funkce $f,g\colon U \to \real$
	a n�jak� bod $a \in U$.
	Nech� $f,g$ jsou definovan�~v~$a$:
	\list{
	\listItem{Pak i $\kappa f + \lambda y$ je diferencovateln� v $a$ a m� v $a$ diferenci�l:
		$$ \kappa Df(a) + \lambda Dg(b) $$
	}
	\listItem{I $fg$ je diferencovateln� v $a$ a m� v $a$ diferenci�l:
		$$ g(a) \cdot Df(a) + f(a) \cdot Dg(a) $$
	}
	\listItem{Pokud $g(a) \ne 0$, pak i $f/g$ je diferencovateln� v $a$ a m� v $a$ diferenci�l:
		$$ 1/g(a)^2(f(a)\cdot Df(a) - f(a)\cdot Dg(a)) $$
	}
	}

	\shortproof{Nebudeme d�lat, vyjde se z definice diferenci�lu. \sqed}

	\shortnote{(i) plat� i v situaci $f,g\colon U \to \real^k$}

	\medskip

	\penalty-500

	Podobn� i pro parci�ln� derivace:
	\list{
	\listItem{\M{ \diff{(\kappa Df(a) + \lambda Dg(b))}{x_i}(a) = \kappa \diff{f}{x_i}(a)+\lambda\diff{g}{x_i}g(a) }}
	\medskip
	\listItem{\M{ \diff{fg}{x_i}(a) = \diff{f}{x_i}(a)\cdot g(a) + f(a)\cdot\diff{g}{x_i}(a) }}
	\medskip
	\listItem{\M{ \diff{f/g}{x_i}(a) = {\diff{f}{x_i}(a)\cdot g(a) - f(a)\cdot\diff{g}{x_i}(a) \over g(a)^2} }}
	}

}

\theorem{8}{o diferenci�lu slo�en�ho zobrazen�}{

	M�jme otev�en� $U \subset \real^m$ a $V \subset \real^n$,
	$f\colon U \to V$, $g\colon V \to \real^k$.
	Vezm�me $a \in U$, $b = f(a) \in V$.

	P�edpokl�d�me, �e $f$ je diferencovateln� v $a$
	a $g$ je diferencovateln� v $b$.
	Pak $h = g \circ f\colon U \to \real^k$
	je diferenci�l v bod� $a$
	a pro diferenci�l $h$ v $a$ m�me:
	$$ Dh(a) = Dg(b) \circ Df(a) $$

	\lemma{ 9}{
		V �e�i Jacobiho matic:
		$$ \left(\diff{h_i}{x_j}(a)\right)_{i,j=1}^{k,m}
			= \left(\diff{g_i}{x_j}(b)\right)_{i,j=1}^{k,n}
			  \left(\diff{f_i}{x_j}(a)\right)_{i,j=1}^{n,m} = $$
		$$ \left(\sum_{v=1}^n \diff{g_i}{x_v}(b)\cdot\diff{f_v}{x_j}(a) \right)_{i,j=1}^{k,m} $$

		V p��pad� $k=1$ je to pak zvl�t� zaj�mav�, proto�e
		$f_i\colon U \subset \real^m \to \real$,
		$g\colon V \to \real$,
		$h\colon U \subset \real^m \to \real$:

		$$ h = g(f_1,f_2,\ldots,f_n) $$
		$$ \diff{h}{x_i}(a) = \sum_{j=1}^n \diff{g}{x_j}(f(a))\cdot\diff{f_j}{x_i}(a) $$

		Pro po��t�n� se slo�en�mi funkcemi se v praxi hod� tzv. {\bf �et�zkov� pravidlo}:
		$$ = \left<\grad g(f(a)),f'(a)\right> $$
		$$ f=(f_1,\ldots,f_n), \quad f'=(f_1',\ldots,f_n') $$

		\example{
			Jak souvis� �et�zkov� pravidlo a z�kon zachov�n� energie?

			Vezm�me otev�enou $U \subset \real^m$
			a na n� zobrazen� $F\colon U \to \real^m$.
			Toto zobrazen� si p�edstavme jako {\it silov� pole},
			kter� n�m ��k�,
			jak velk� s�la (a~jak�m sm�rem)
			p�sob� ve~v�ech bodech $U$.

			Po�leme mno�inou $U$ n�jakou ��stici
			po dr�ze $\gamma\colon [0,1]\to U$
			($\gamma = (\gamma_1(t),\ldots,\gamma_m(t))$).
			P�edpokl�dejme, �e dr�ha bude pln� ur�ena silov�m polem $F$.

			Vyjd�me z {\it Newtonova z�kona s�ly}
			(s�la = hmotnost $\times$ zrychlen�):
			$$ F(\gamma(t)) = m\gamma''(t) $$
			$$ \gamma'' = (\gamma_1''(t),\ldots,\gamma_m''(t)) $$
			(v�imn�me si, �e $\gamma''$ p�edstavuje vektor zrychlen�).

			Druh� fyzik�ln� p�edpoklad bude,
			�e existuje funkce $f\colon U \to \real$
			takov�, �e
			$$ a \in U\colon F(a) = -\grad f(a) $$
			(tzv. konzervativn� pole).
			Potenci�l $f(a)$ definujme jako potenci�ln� energii ��stice,
			je-li v~bod� $a$.
			Kinetick� energie ��stice v �ase $t \in [0,1]$ bude:
			$$ m/2\cdot v(t)^2 = m/2\cdot \gamma'(t)^2
				= m/2\cdot \left<\gamma'(t),\gamma'(t)\right>
				= m/2\cdot || \gamma'(t) ||^2 $$

			Z�kon zachov�n� energie n�m ��k�, �e sou�et potenci�ln�
			a kinetick� energie je konstantn�:

			$$ f(\gamma(t)) + m/2\cdot\gamma'(t)^2 =: s(t)\qquad t \in [0,1] $$
			$$ \eqalign{
				s'(t) &= \left<\grad f(\gamma(t)), \gamma'(t)\right>
					+ m\left<\gamma'(t),\gamma''(t)\right>\cr
				&= \left<\grad f(\gamma(t)), \gamma'(t)\right>
					+ \left<\gamma'(t),m\gamma''(t)\right>\cr
				&= \left<\grad f(\gamma(t)), \gamma'(t)\right>
					+ \left<\gamma'(t),F(\gamma(t))\right>\cr
				&= \left<\grad f(\gamma(t)), \gamma'(t)\right>
					+ \left<\gamma'(t),- \grad f(\gamma(t))\right>\cr
				&= \left<\grad f(\gamma(t)), \gamma'(t)\right>
					- \left<\grad f(\gamma(t)), \gamma'(t)\right>
				= 0
			} $$

			Tedy $s(t)$ je konstantn�.
			\qed
		}
	}

% \proof{
% 	Vezm�me Jacobiho matici zobrazen� $f$ v bod� $a$,
% 	tedy matici line�rn�ho zobrazen� $Df(a)$
% 	vzhledem ke kanonick� b�zi...
% 
% 	{\it Pokra�ov�n� p���t�.}
% 
% }


}


\scpart{Parci�ln� derivace vy���ch ��d�}{

	Vezm�me $f\colon U \subset \real^m \to \real$.
	$f$ m� $\delta_i f(a)$ pro $\forall a \in U$,
	tedy $\delta_i f \colon U \to \real$.
	Parci�ln� derivaci druh�ho ��du v $a$ podle $x_i$ a $x_j$ pak bude
	$$ \delta_j(\delta_i f)(a) =: {\delta^2 f \over \delta x_j \delta x_i}(a) $$

	Obdobn� se pak zav�d�j� i parci�ln� derivace vy���ch ��d�.

	Pozor, obecn� m��e z�le�et na po�ad� derivov�n�, nap�.:
	$$ f(x,y) = \cases{xy {x^2 - y^2 \over x^2 + y^2} & $x^2+y^2 \ne 0$ \cr 0 & $x^2+y^2 = 0$ } $$
	$$ \eqalign{ {\delta^2 f \over \delta x \delta y}(0,0) &= 1\cr
		{\delta^2 f \over \delta y \delta x}(0,0) &= -1 } $$


	\theorem{10}{o po�ad� parci�ln�ch derivac�}{

		M�jme $f\colon U \subset \real^m \to \real$
		a bod $a \in U$.
		Nech� $f$ m� nad $U$ parci�ln� derivace
		$\delta_j\delta_i f$, $\delta_i\delta_j f$
		(v~z�pisu $\delta_j\delta_i f$ derivujeme nejd��v podle $i$, pak podle $j$)
		a ob� nech� jsou spojit� v $a$.
		Potom
		$$ {\delta^2 f \over \delta x_j \delta x_i} (a) = {\delta^2 f \over \delta x_i \delta x_j} (a) $$

		\proof{
			P�edpokl�dejme $m = 2$, tedy $f(x,y)$. Polo�me $a = (0,0)$.
			Sta�� uk�zat, �e pro $\forall h > 0$
			ve �tverci $[0,h] \times [0,h]$ existuj� body
			$\sigma$ a $\tau$ takov�, �e
			$$ { \delta^2 f \over \delta x \delta y } (\sigma) = { \delta^2 f \over \delta y \delta x } (\tau) $$
			(ze spojitosti v po��tku pak plyne zbytek).

			\penalty-500

			Ozna�me si rohy �tverce jako
			$$ a = (0,0) \quad b = (0,h) \quad c = (h,0) \quad d = (h,h) $$
			a d�le si ozna�me d�lku �se�ky
			z n�jak�ho $\alpha$ do $\beta$ jako:
			$$ f(u) = f(\alpha\beta) := f(\beta) - f(\alpha) $$

			$$ � = f(d) - f(b) - f(c) + f(a) = \cases{f(cd) - f(ab) = \varphi(h) - \varphi(0) & $\varphi(t) := f(u_t)$\cr
								  f(bd) - f(ac) = \psi(h) - \psi(0) & $\psi(t) := f(v_t)$}$$

			Na to si m��eme p�ivolat pana Lagrange s v�tou o st�edn� hodnot�:
			$$\varphi(h) - \varphi(0) = \varphi'(t_0)\cdot h \qquad 0 < t_0 < h $$
			Uva�me $\varphi'(t) = \delta_x f(u_t)$,
			$$ = \delta_x f(u_{t_0}) \cdot h = (\delta_x f(t_0,h) - \delta_x f(t_0,0))h $$
			a dle Lagrangeho st�edn� hodnoty
			$$ = \delta_y \delta_x f(\undernote{t_0,t_1}{\tau})h^2 \qquad 0 \le t_1 < h $$

			Analogicky:
			$$ � = \delta_x \delta_y f(\undernote{s_0,s_1}{\sigma})h^2 \qquad 0 < s_0, s_1 < h $$

			$$ \delta_y \delta_x (\tau) = \delta_x \delta_y (\sigma) $$
			\qed
		}

		\shortnote{Rovnost lze dok�zat i se slab��mi p�edpoklady.}

	}

	K $U \subset \real^m$ definujme $C^k(U)$
	jako mno�inu v�ech $f\colon U \to \real$,
	kde $f$ m� na $U$ v�echny parci�ln� derivace ��d� $\le k$,
	a to spojit�.

	\impl{ % 11
		M�jme $f \in C^k(U)$, bod $a \in U$
		a dva vektory $(i_1,\ldots,i_n)$ a $(j_1,\ldots,j_n)$,
		kter� se li�� jen permutac� ($n \le k$).  Pak plat�:
		$$ {\delta^n f \over \delta x_{i_n} \cdots \delta x_{i_1}}(a) = 
			{\delta^n f \over \delta x_{j_n} \cdots \delta x_{j_1}}(a) $$

		$$ {\delta^4 f \over \delta x \delta y \delta z \delta x}(a)
			= {\delta^4 f \over \delta x^2 \delta y \delta z}(a)
			= {\delta^4 f \over \delta z \delta x^2 \delta y}(a) = \cdots $$
	}

	\theorem{12}{Taylor�v rozvoj funkc� v�ce prom�nn�ch}{

		M�jme $f\colon U \subset \real^m \to \real$, $f \in C^n(U)$
		a bod $a \in U$.
		Pak v okol� $a$ m�me rozvoj
		$$ f(a+h) = \sum_{i=0}^n {1 \over i!}(h_1\delta_1 + h_2\delta_2 + \cdots + h_m\delta_m)^i f(a)
				+ o(||h||^h) $$
		$$ = \sum_{i_1,\ldots,i_m \ge 0 \atop i_1 + \cdots + i_m \le n}
			{1 \over i_1! \cdots i_m!}
			\cdot {\delta^{i_1 + \cdots + i_m} f \over \delta x_{i_1} \cdots x_{i_m}}(a)
			\cdot h_1^{i_1} \cdots h_m^{i_m}
			+ o(||h||^h) $$
		(Tato rovnost plyne z multinomick� v�ty.)

		\penalty-500
		\medskip

		M�jme $i_1 + \cdots + i_m = 0$, jdeme $\to f(a)$.
		Uva�me $(h_1\delta_1 + \cdots + h_m\delta_m)^i f$, vezm�me nap�. $i=2$:
		$$ (h_1\delta x + h_2\delta y)^2 f
			= (h_1^2 \delta x \delta x + h_2^2 \delta y \delta y + 2 h_1h_2\delta x\delta y)f
			= h_1^2 {\delta^2 f \over \delta x^2} + h_2^2 {\delta^2 f \over \delta y^2}
			  + 2h_1h_2 {\delta^2 f \over \delta x \delta y} $$

	}

}

\scpart{Lok�ln� extr�my}{
	M�jme $f\colon U \subset \real^m \to \real$ a bod $a \in U$.
	Nech� existuj� $\delta_1f(a),\ldots,\delta_mf(a)$.
	Jak� jsou podm�nky lok�ln�ho extr�mu funkce $f$ v $a$?

	P�ipome�me si, �e neostr� lok�ln� minimum v $a$ definujeme jako
	$$ \existss \delta > 0 : || x - a || < \delta \Rightarrow f(x) \ge f(a) $$
	zat�mco ostr� lok�ln� minimum v $a$ bude
	$$ \existss \delta > 0 : 0 < || x - a || < \delta \Rightarrow f(x) > f(a) $$

	V�imn�me si, �e m�-li $f$ v $a$ lok�ln� extr�m, $\grad f(a) = 0$
	(nebo� pro $\forall x_i,\ 1 \le i \le m: \diff{f}{x_i}(a) = 0$).

	Definujme {\bf stacion�rn� body} (nebo tak� {\bf kritick� body})
	jako $\{a \in U: \grad f(a) = 0\}$.

	Vezmu $f \in C^2(U)$. Pak matice
	$$ H_f(a) = \left({\delta^2 f \over \delta x_i \delta x_j}(a)\right)_{i,j=1}^m $$
	(tzv. {\bf Hessova matice}) bude symetrick�.

	\smallskip

	Nech� matice $A \in \real^{n\times n}$ je symetrick�.
	Vezm�me jej� kvadratickou formu:
	$$ xAx^T = P(x_1,\ldots,x_n) = \sum_{i,j=1}^n a_{ij}x_ix_j \colon\ \real^n \to \real $$
	Pak $A$ je pozitivn� (negativn�) definitn�, pokud
	$$ \forall x \in \real^n \setminus \{\overline{0}\}: P(x) > 0 $$
	(resp. $P(x) < 0$), a pozitivn� (negativn�) semidefinitn�, pokud:
	$$ \forall x \in \real^n: P(x) \ge 0 $$
	Matice $A$ je indefinitn�,
	pokud nen� pozitivn� ani negativn� semidefinitn�, tedy:
	$$ \existss x,y \in \real^n: P(x) > 0 \et P(y) < 0 $$

\theorem{13}{}{
	M�jme $U \subset \real^m$, $f\colon U \to \real$, $f \in C^2(U)$.
	Pak vezmeme-li n�jak� bod $a \in U$:
	\list{
	\listItem{$\grad f(a) \ne \overline{0} \Rightarrow f$ nem� v $a$ lok�ln� extr�m (ani neostr�).}
	\listItem{$\grad f(a) = \overline{0}, H_f(a)$ je pozitivn� (resp. negativn�) definitn�
		$\Rightarrow f$ m� v $a$ ostr� lok�ln� minimum (resp. maximum).}
	\listItem{$\grad f(a) = \overline{0}, H_f(a)$ je indefinitn�
		$\Rightarrow f$ nem� v $a$ (zase) ani neostr� lok�ln� extr�m.}
	}
	Ne��k�me v�ak nic o semidefinitn�ch matic�ch.

	\penalty-500

	\proof{
		\list{
		\listItem{Nech� nap�. $\delta_1 f(a) \ne 0$.
			Pak $$ f(a_1+h_, a_2, \ldots, a_m) = f(a) + \delta_1 f(a) h + o(h) $$
			a existuje $\delta > 0$ takov�, �e
			$$- \delta < h < 0 \Rightarrow f(a_1+h,a_2,\ldots,a_m) < 0$$
			nebo naopak
			$$0 < h < \delta \Rightarrow f(a_1+h,a_2,\ldots,a_m) > 0$$
		}
		\listItem{Nech� $\grad f(a) = 0$.
			$f$ rozvineme v okol� $a$
			pomoc� Taylorova rozvoje (\ias{}{12}{}) do �ady $n=2$:
			$$ f(a+h) = \sum_{i=0}^2 {\delta_1 h_1 + \cdots + \delta_m h_m)^i \over i!} f(a) + o(||h||^2)
				\qquad h \in \real^m $$
			$$ i=1 \to \grad f(a) h = 0 $$
			$$ f(a+h) - f(a) = {1\over2}(\delta_1h_1 + \cdots + \delta_mh_m)^2f(a) + o(||h||^2) $$
			$$ = {1\over2} \sum_{i,j=1}^m {\delta^2 f \over \delta x_i \delta x_j}(a)h_ih_j + o(||h||^2) $$
			$$ = {1\over2} P(h_1,\ldots,h_m) + o(||h||^2) $$
			(kde $P(\ldots)$ je kvadratick� forma odpov�daj�c� $H_f(a)$)
			$$ = {1\over2} ||h||^2 (P(h_1/||h||,\ldots,h_m/||h||) + o(1)) $$
			$$ = {1\over2} ||h||^2 (P(e) + o(1)) \qquad e = e(h) = (h_1/||h||,\ldots,h_m/||h||) $$
			V�imn�me si, �e $||e|| = 1$, tedy $e \in S = \{ x \in \real^m: ||x|| = 1 \}$.
			$$ \mu = P(\alpha) = \min_S P(x) $$
			$$ M = P(\beta) = \max_S P(x) $$
			$$ \mu \le P(e) \le M $$
			P�itom $H_f(a)$ (tj. $P$) je pozitivn� definitn�, pr�v� kdy� $0 < \mu$,
			a negativn� definitn�, pr�v� kdy� $M < 0$.

			Nech� $H_f(a)$ je pozitivn� definitn�. Pak
			$$\forall e \in S: P(e) \ge \mu > 0$$
			$$\Rightarrow \existss \delta > 0,\ \existss h \in \real^m: 0 < ||h-a|| < \delta$$
			$$\Rightarrow P(e) + o(1) \ge \mu/2 > 0 $$
			$$\Rightarrow f(a+h) - f(a) > 0 $$
			a v $a$ je ostr� lok�ln� minimum.
			Stejn� pro negativn� definitn� $H_f(a)$.
		}
		\listItem{$H_f(a)$ je indefinitn�, pr�v� kdy� $\mu < 0 < M$.
			$$ \existss \delta > 0,\ \forall t,\ 0<t<\delta,\ ||t\alpha||=t:
				f(a+t\alpha) - f(a) = {1\over2}t^2(P(\alpha)+o(1))
				< {t^2\over2}\cdot{\mu^2\over2} < 0 $$
			Podobn� $f(a+t\beta)-f(a)-\cdots > 0$.
		}
		}
		\qed
	}
}

	Vezm�me $D \subset \real^m$, $f\colon D \to \real$.
	$D$ bu� ``kruhovit� �tvar'' skl�daj�c� se z $D = U \disjoin H$
	($U$ je vnit�ek, $H$ je hranice).
	Jak� jsou lok�ln� a glob�ln� extr�my funkce $f$?

	\ias{}{13}{} n�m pom��e naj�t lok�ln� extr�my na $U$
	($S = \{a \in U: \grad f(a) = \overline{0} \}$),
	mus� ale platit, �e $f \in C^2(U)$.

	Naj�t lok�ln� extr�my na $H$ n�m pom��ou naj�t
	\ref{Lagrangovy multiplik�tory},
	o kter�ch si pov�me bl��e zanedlouho.

	Je-li $D$ kompaktn�, $f$ (spojit�) na $D$ nab�v� maximum i minimum.
	Nen�-li $D$ kompaktn�, v�imneme si, �e um�me-li naj�t glob�ln� maximum,
	na�li jsme i lok�ln� maximum.

\example{
	M�me $f\colon \real^2 \to \real$ definovanou jako:
	$$ f(x,y) = y^2 + y\cos x - \sin x - 2 $$

	Pak plat�:
	$$ \grad f(x,y) = (\delta_x f, \delta_y f) = (-y\sin x - \cos x, 2y+\cos x) $$
	$$ H_f(x,y) = \pmatrix{ -y\cos x + \sin x & -\sin x \cr -\sin x & 2 } $$
	$$ S: \grad f(x,y) = (0,0) \Rightarrow S = \{(\pi/2 + k\pi,0): k \in \intgr\} $$
	$$ H_f(\Delta_k) = \pmatrix{-1 & 1 \cr 1 & 2} \qquad n \in \nat,\ k = 2n+1 $$
	$$ H_f(\Delta_k) = \pmatrix{1 & -1 \cr -1 & 2} \qquad n \in \nat,\ k = 2n $$

	$$ k \hbox{lich�}: P = -x^2 + 2xy + 2y^2 = -(x-y)^2 + 3y^2 \textnote{indef.} $$
	$$ k \hbox{sud�}: P = x^2 0 2xy + 2y^2 = (x-y)^2 + y^2 \textnote{poz. def.} $$

	Tud�� pro lich� $k$ lok�ln� extr�m nem�me,
	zato sud� $k$ m� ostr� lok�ln� minimum: $f(s_{2k}) = -3$.

	$f$ nem� glob�ln� maximum --- nap�. pro
	$f(\pi/2,y) = y^2-3 \to_{y \to \pm\infty} +\infty$
	($f$ nen� shora omezen�).
	Alternativn� to plyne z toho, �e $f$ nem� lok�ln� maximum.

	Ale co glob�ln� minimum? $f$ je $2\pi$-periodick� v $x$,
	sta�� se tedy na $f(x,y)$ d�vat jen v p�su $0\le x \le 2\pi$:
	$$ f(0,y) = f(2\pi,y) = y^2 + y - 2 = (y+1/2)^2 - 9/4 \ge - 9/4 > -3 \textnote{hranice p�su} $$
	$$ x \in \real,\ |y| \ge 2 \Rightarrow f(x,y) \ge y^2 - |y| - 3 = (y\pm1/2)^2 - 13/4 \ge 9/4 \ge -1 > -3 $$

	Tedy $s_{2k}$ jsou v�echny body, v nich� $f$ nab�v� sv� glob�ln� minimum $-3$.
}

}

\bend
