\documentclass[a4paper, 12pt]{article}
\usepackage[slovene]{babel}
\textwidth17cm
\oddsidemargin-8mm\evensidemargin-8mm
\topmargin-24mm\textheight+740pt

\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsxtra}

\setlength{\parindent}{0pt}

\def\ee{\textrm{e}}
\def\dd{\textrm{d}}

\begin{document}

\Large \centerline{\textbf{IZPIT IZ NUMERI"CNIH METOD}}
\centerline{\textbf{21. junij 2013}}

\normalsize
\begin{enumerate}
  \item Zapi"site tri korake sekantne metode za ena"cbo
    $$
      x + \frac{x^3+3}{2} = 0,
    $$
    kjer za za"cetna pribli"zka vzamete $x_0 = -3$ in $x_1 = -2$. \\[2mm]
    \textbf{Re"sitev:}
    Korak sekantne metode je
    $$
      x_{n+1} = x_n - f(x_n) \cdot \frac{x_n - x_{n-1}}{f(x_n) - f(x_{n-1})},
    $$
    kjer je $f(x) = x + \frac{x^3+3}{2}$. Dobimo
    \begin{eqnarray*}
      x_2 & = & x_1 - f(x_1) \cdot \frac{x_1 - x_0}{f(x_1) - f(x_0)} = - 1.5714, \\
      x_3 & = & x_2 - f(x_2) \cdot \frac{x_2 - x_1}{f(x_2) - f(x_1)} = - 1.5714, \\
      x_4 & = & x_3 - f(x_3) \cdot \frac{x_3 - x_2}{f(x_3) - f(x_2)} = - 1.5714.
    \end{eqnarray*}
  \item Izra"cunajte integral
    $$
      \int_{-2}^1 2x\ee^x \, \dd x
    $$
    z uporabo trapezne in Simpsonove tretjinske formule za $n = 6$. Rezultate primerjajte s to"cno vrednostjo integrala (per partes). \\[2mm]
    \textbf{Re"sitev:} Ker je $h = \frac{b-a}{n} = \frac{1}{2}$ in $f(x) = 2x\ee^x$, dobimo s trapezno metodo
    $$
      I_t = \frac{h}{2} \left( f(-2) + 2f(-3/2) + 2f(-1) + 2f(-1/2) + 2f(0) + 2f(1/2) + f(1) \right) = 1.04233,
    $$
    s Simpsonovo tretjinsko metodo pa
    $$
      I_s = \frac{h}{3} \left( f(-2) + 4f(-3/2) + 2f(-1) + 4f(-1/2) + 2f(0) + 4f(1/2) + f(1) \right) = 0.819151.
    $$
    To"cna vrednost integrala je
    $$
      I = \int_{-2}^1 2x\ee^x \, \dd x = 2x\ee^x \Big|_{-2}^1 - 2\int_{-2}^1 \ee^x \, \dd x  = 2x\ee^x \Big|_{-2}^1 - 2\ee^x  \Big|_{-2}^1 =
        6\ee^{-2} = 0.812012.
    $$
  \item Re"site robni problem
    $$
      y''(x) = -2x, \quad y(0) = 0, \quad y(1) = 2,
    $$
    kjer interval $[0,1]$ razdelite na $n = 4$ enako dolge podintervale. Ali lahko gornji sistem ena"cb re"simo z Gauss-Seidlovo iteracijo? \\[2mm]
    \textbf{Re"sitev:} Dobimo sistem treh ena"cb
    $$
      \frac{y_{i-1} - 2y_i + y_{i+1}}{h^2} = -2x_i, \qquad i = 1,2,3,
    $$
    kjer je $h = \frac{b-a}{n} = \frac{1}{4}$, $y_0 = 0$ in $y_4 = 2$. Sistem ima re"sitev $y_1 = \frac{37}{64}$, $y_2 = \frac{9}{8}$ in
    $y_3 = \frac{103}{64}$. Sistem lahko re"simo z Gauss-Seidlovo iteracijo, saj je diagonalno dominanten, ni pa strogo diagonalno dominanten.
\end{enumerate}

\end{document}
