\documentclass[10pt]{article}
\usepackage[slovene]{babel}
%\usepackage{amsvega}
%\usepackage{hyperref}
\pagestyle{empty}

\begin{document}
\begin{center}
    \Large Izpit iz Numeri"cnih metod\vspace*{3mm} \\
    \normalsize 18. junij 2008
\end{center}
\bigskip\medskip
\large
\raggedright
\begin{enumerate}
 \item Sestavite formulo za pribli"zno ra"cunanje integralov oblike:
    $$\int_0^{\pi/6} \frac{f(x)\,dx}{x^{3/4}}\approx \omega f(\xi) $$
    kjer je $0 \le \xi \le \frac{\pi}{6}$. Formula naj bo to"cna za konstanto in
    polinom prve stopnje. Po gornji formuli izra"cunaj pribli"zno vrednost integrala:
        $$\int_0^{\pi/6} \frac{\cos(x)\,dx}{x^{3/4}}$$

\emph{Re"sitev:} \\[1mm]
Najprej dolo"cimo ute"z $\omega$ in vozel $\xi$ tako, da bo formula to"cna za $f(x) = 1, x$:
\begin{eqnarray*}
f(x) = 1 & : & \omega = \int_0^{\frac{\pi}{6}} \frac{1}{x^{3/4}} \, dx =
  4x^{1/4}\Big|_0^{\frac{\pi}{6}} = 4 \sqrt[4]{\frac{\pi}{6}} \\
f(x) = x & : & \omega \xi = \int_0^{\frac{\pi}{6}} \frac{x}{x^{3/4}} \, dx =
  \frac{4}{5} x^{5/4}\Big|_0^{\frac{\pi}{6}} = \frac{4}{5} \sqrt[4]{\left(\frac{\pi}{6}\right)^5}
\end{eqnarray*}
Sledi:
\[
\omega = 4 \sqrt[4]{\frac{\pi}{6}} = 3.40259, \quad \xi = \frac{\pi}{30} = 0.10472
\]
Izra"cunamo integral:
\[
I = \int_0^{\pi/6} \frac{\cos(x)\,dx}{x^{3/4}} = 4 \sqrt[4]{\frac{\pi}{6}} \cos{\frac{\pi}{30}} = 3.38395
\]
Za primerjavo: to"cna vrednost integrala je $3.35106$.

\item Poi"s"ci re"sitev  $A\,x\approx B$ v smislu najmanj"sih kvadratov.
$$
    A=\left [
        \begin {array}{ccc}
    1&2\\\noalign{\medskip}
    4&1\\\noalign{\medskip}
        1&1\end {array}
    \right ] \quad B=
    \left [
    \begin {array}{ccc}
        1\\\noalign{\medskip}
        1\\\noalign{\medskip}
        1
    \end {array}
    \right ]
$$
\newpage

\emph{Re"sitev:} \\[1mm]
Re"sujemo normalni sistem $A^TAx = A^TB$, ki ima re"sitev $x = (A^TA)^{-1}A^TB$.
\begin{small}
\begin{eqnarray*}
A^TA & = & \left[ \begin{array}{cc} 18 & 7 \\ 7 & 6 \end{array} \right] \\
(A^TA)^{-1} & = & \frac{1}{59} \left[ \begin{array}{cc} 6 & -7 \\ -7 & 18 \end{array} \right] \\
A^TB & = & \left[ \begin{array}{c} 6 \\ 4 \end{array} \right]
\end{eqnarray*}
\end{small}
Sledi:
\begin{small}
\[
x = \frac{1}{59} \left[ \begin{array}{cc} 6 & -7 \\ -7 & 18 \end{array} \right]
  \left[ \begin{array}{c} 6 \\ 4 \end{array} \right] = \left[ \begin{array}{c} 8/59 \\ 30/59 \end{array} \right]
\]
\end{small}

\item Zapi"si iteracijsko shemo Newtonove metode za re"sevanje sistema nelinearnih ena"cb:
    $$x^2+y^2=1,\quad  x+y=-\frac{1}{2}$$
        Naredi en korak metode, "ce je za"cetni pribli"zek $[x,y]=[1/2,3/2]$.

\emph{Re"sitev:} \\[1mm]
I"s"cemo prese"ci"s"ca kro"znice in premice, ki se sekata v dveh to"ckah: $x_1 = \frac{-1-\sqrt{7}}{4}$,
$y_1 = \frac{-1+\sqrt{7}}{4}$ in $x_2 = \frac{-1+\sqrt{7}}{4}$, $y_2 = \frac{-1-\sqrt{7}}{4}$. \\
Iteracijska shema se glasi:
\begin{small}
\[
\left[ \begin{array}{c} x_{n+1} \\ y_{n+1} \end{array} \right] = \left[ \begin{array}{c} x_n \\ y_n \end{array} \right] -
  J^{-1}(x_n, y_n) \left[ \begin{array}{c} f(x_n,y_n) \\ g(x_n,y_n) \end{array} \right]
\]
\end{small}
Imamo $f(x,y) = x^2+y^2-1$ in $g(x,y) = x+y+\frac{1}{2}$, zato je Jacobijeva matrika enaka
\begin{small}
\[
J = \left[ \begin{array}{cc} 2x & 2y \\ 1 & 1 \end{array} \right]
\]
\end{small}
Ra"cunamo en korak za $x_0 = 1/2$, $y_0 = 3/2$:
\begin{small}
\begin{eqnarray*}
\left[ \begin{array}{c} x_1 \\ y_1 \end{array} \right] & = & \left[ \begin{array}{c} x_0 \\ y_0 \end{array} \right] -
  J^{-1}(x_0, y_0) \left[ \begin{array}{c} f(x_0,y_0) \\ g(x_0,y_0) \end{array} \right] \\
& = & \left[ \begin{array}{c} 1/2 \\ 3/2 \end{array} \right] - \left[ \begin{array}{cc} 1 & 3 \\ 1 & 1 \end{array} \right]^{-1}
  \left[ \begin{array}{c} 3/2 \\ 5/2 \end{array} \right] \\
& = & \left[ \begin{array}{c} 1/2 \\ 3/2 \end{array} \right] + \frac{1}{2} \left[ \begin{array}{cc} 1 & -3 \\ -1 & 1 \end{array} \right]
  \left[ \begin{array}{c} 3/2 \\ 5/2 \end{array} \right] \\
& = & \left[ \begin{array}{c} -5/2 \\ 2 \end{array} \right]
\end{eqnarray*}
\end{small}
\end{enumerate}
\end{document}
