\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{ngerman}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphics}

%eigene definitionen
\newcommand{\abs}[1]{\lvert#1\rvert}

\date{\today{}}
\author{Thomas Kuster}
\title{UMNW, Mathematik 1, Lösung Serie 6}

\begin{document}
\markright{UMNW, Mathematik 1, Lösung Serie 6}
\pagestyle{myheadings}

\maketitle

\section{}
\subsection{}
\begin{verbatim}
> datax := [seq(i/4,i=0..4)];
                        datax := [0, 1/4, 1/2, 3/4, 1]

> datay := evalf(map(exp,datax));
datay := [1., 1.284025417, 1.648721271, 2.117000017,
   2.718281828]

\end{verbatim}

\subsection{}
\begin{eqnarray*}
\sum_{k=1}^{n}{(a+bx_k+cx_k^2-y_k)^2} & = & \sum_{k=1}^{n}{r_k^2} = R(a,b,c)\\
& \Rightarrow &\\
\frac{\partial}{\partial a} R(a,b,c) & \overset{!}{=} & 0\\
\frac{\partial}{\partial b} R(a,b,c) & \overset{!}{=} & 0\\
\frac{\partial}{\partial c} R(a,b,c) & \overset{!}{=} & 0\\
\end{eqnarray*}

\subsection{}
\begin{verbatim}
> with(stats): with(fit): with(plots):
> f := unapply(leastsquare[[x,y], y=a+b*x+c*x^2,{a,b,c}]\
> ([datax, datay]),x);
                                                         2
f := x -> y = 1.005140300 + .8642773549 x + .8435379451 x

\end{verbatim}

\subsection{}
\begin{verbatim}
> d:=map(x->evalf(abs(exp(x)-solve(f(x)))),datax);
d := [.005140300, .010094656, .000557808, .010838393,
   .005326228]

\end{verbatim}

\subsection{}
\includegraphics{./serie6_plot0.eps}

\subsection{}
\begin{displaymath}
\max_{0 \le x \le 1}{\abs{e^x-(1.005140300 + 0.8642773549 x + 0.8435379451 x^2)}}\\
\end{displaymath}
Ableiten und Nullstellen im Intervall $[0,1]$ suchen.
\begin{displaymath}
e^x-(0.8642773549 + 2\cdot0.8435379451 x) \overset{!}{=} 0
\end{displaymath}
\includegraphics{./serie6_plot1.eps}
\begin{verbatim}
> f_1 := x -> y =exp(x); #wie kann man das ohne diesen\
 Murks machen? Also aus f := x -> y = ... wieder ein\
 f := ... machen?
                       f_1 := x -> y = exp(x)

> w_1 := fsolve(diff(f(x)-f_1(x),x),x=0..1);
                         w_1 := .2450253158

> w_2 := fsolve(diff(f(x)-f_1(x),x),x=0.3..1);
                         w_2 := .7774048026

> f(w_1)-f_1(w_1);
                          0 = -.010099696

> f(w_2)-f_1(w_2);
                           0 = .011014509
\end{verbatim}
Der Fehler im Intervall $[0,1]$ ist also bei $x=0.7774048026$ am grössten.

\section{}
\includegraphics{./serie6_plot2.eps}

\section{}
\begin{eqnarray*}
f(x) & = & \frac{2+x^3\cos{x}+1.5^x}{2+x^2}
\end{eqnarray*}

\subsection{}
\includegraphics{./serie6_plot3.eps}

\subsection{}
\begin{displaymath}
\lim_{x \to \infty}{\frac{2+x^3\cos{x}+1.5^x}{2+x^2}} = \underbrace{\lim_{x \to \infty}{\frac{2}{2+x^2}}}_{=0} + \underbrace{\lim_{x \to \infty}{\frac{x^3\cos{x}}{2+x^2}}}_{\rightarrow[-1,1]\cdot\infty} + \underbrace{\lim_{x \to \infty}{\frac{1.5^x}{2+x^2}}}_{\infty}
\end{displaymath}
da jedoch gilt
\begin{displaymath}
\abs{\lim_{x \to \infty}{\frac{x^3\cos{x}}{2+x^2}}} < \abs{\lim_{x \to \infty}{\frac{1.5^x}{2+x^2}}} \Rightarrow \lim_{x \to \infty}{f(x)} = \infty
\end{displaymath}
\begin{displaymath}
\lim_{x \to -\infty}{\frac{2+x^3\cos{x}+1.5^x}{2+x^2}} = \underbrace{\lim_{x \to -\infty}{\frac{2}{2+x^2}}}_{=0} + \underbrace{\lim_{x \to -\infty}{\frac{x^3\cos{x}}{2+x^2}}}_{\rightarrow[-1,1]\cdot\infty} + \underbrace{\lim_{x \to -\infty}{\frac{1.5^x}{2+x^2}}}_{0}
\end{displaymath}
\begin{displaymath}
\Rightarrow \lim_{x \to -\infty}{f(x)} \mbox{ oszilliert zwischen $-\infty$ und $\infty$}
\end{displaymath}

\subsection{}
\begin{verbatim}
> fsolve(f,x=-20..-15); # kann man nicht alle auf einmal\
>  suchen ohne zu programmieren?
                                 -17.27914744

\end{verbatim}
Aus dem Graph der Funktion kann man ablesen, dass es 13 oder 14 Nullstellen geben muss. Durch suchen in weiteren Intervallen findet man folgende 13 Nullstellen:\\
-17.27914744\\
-14.13645783\\
-10.99708682\\
-7.849761028\\
-4.732642621\\
2.075250069\\
4.626169720\\
7.907978386\\
10.92960813\\
14.24973935\\
17.07298153\\
20.98723434\\
22.59175091\\

\subsection{}
\begin{eqnarray*}
\frac{d}{dx}\left(\frac{f}{g}\right) & = & \frac{f'g-fg'}{g^2}\\
f & = & 2+x^3\cos{x}+1.5^x \Rightarrow f' = 3x^2\cos{x}-x^3\sin{x}+1.5^x\ln{1.5}\\
g & = & 2+x^2 \Rightarrow g' = 2x\\
\frac{f'g-fg'}{g^2} & = &\\
\end{eqnarray*}
\begin{displaymath}
\frac{(3x^2\cos{x}-x^3\sin{x}+1.5^x\ln{1.5}) (2+x^2) - (2+x^3\cos{x}+1.5^x) 2x}{(2+x^2)^2} =\\
\end{displaymath}
\begin{displaymath}
\frac{6x^2\cos{x}-x^5\sin{x}+x^4\cos{x}-2x^3\sin{x}-4x+1.5^x(\ln{2.25}+\ln{1.5}x^2-2x)}{(2+x^2)^2}\\
\end{displaymath}
\includegraphics{./serie6_plot4.eps}

\section{}
\subsection{}
\begin{displaymath}
\lim_{x \to 0}{\frac{\tan{x}}{x}} \overset{\mbox{B d' H}}{=} \lim_{x \to 0}{\frac{1}{\cos{^2(x)} \cdot 1}} = 1
\end{displaymath}
oder Taylor Reihe für $\tan{x} = x +\hdots \Rightarrow \frac{x}{x} = 1$

\subsection{}
\begin{eqnarray*}
\frac{f(a+h)-f(a-h)}{2h} & \mbox{ da } & (a+h)-(a-h) = 2h\\
\frac{f(a+2h)-f(a-h)}{3h} & \mbox{ da } & (a+2h)-(a-h) = 3h\\
\end{eqnarray*}
mit Octave
\begin{verbatim}
> a = 1
a = 1
> i = (1:8)
i =
  1  2  3  4  5  6  7  8

> h = 10.^-i
h =
   1.0000e-01   1.0000e-02   1.0000e-03   1.0000e-04
   1.0000e-05   1.0000e-06   1.0000e-07   1.0000e-08

> y_r = cos(a) # echter Wert
y_r = 0.54030

> y_0 = (sin(a.+h)-sin(a.-h))./h # müsste um Faktor 2 falsch
sein
y_0 =
  1.0788  1.0806  1.0806  1.0806  1.0806  1.0806  1.0806
  1.0806

> y_1 = (sin(a.+h)-sin(a.-h))./(2.*h)
y_1 =
   0.53940  0.54029  0.54030  0.54030  0.54030  0.54030
   0.54030  0.54030

> y_2 = (sin(a.+h)-sin(h))./h # muss sinnlos sein
y_2 =
   7.9137e+00   8.3683e+01   8.4101e+02   8.4143e+03
   8.4147e+04   8.4147e+05   8.4147e+06   8.4147e+07

> y_3 = (sin(a.+2.*h)-sin(a.-h))./(3.*h)
y_3 =
   0.49571  0.53607  0.53988  0.54026  0.54030  0.54030
   0.54030  0.54030

> y_4 = (sin(a.+h)-sin(a))./h # korrekt Fromel
y_4 =
  0.49736  0.53609  0.53988  0.54026  0.54030  0.54030
  0.54030  0.54030

\end{verbatim}

\subsection{}
\begin{eqnarray*}
\cos{(1+h)} & \approx & \cos{1} - \sin{1}\cdot h + a h^2 \qquad \mbox{suche }\frac{d}{dh^2}\\
-\sin{(1+h)} & \approx & - \sin{1} + 2 a h\\
-\cos{(1+h)} & \approx & 2 a\\
-\frac{\cos{(1+h)}}{2} & \approx & a\\
\end{eqnarray*}
\includegraphics{./serie6_plot5.eps}

\section{}
\begin{eqnarray*}
\dot{w}(t) & = & w(t) - w^2(t)\\
x(t) & := & kw(akt) \quad  a,k \in \mathbb{R}
\end{eqnarray*}
\begin{eqnarray*}
\dot{x}(t) & = & ax(t) \left( k-x(t) \right)\\
\dot{x}(t) & = & akx(t) - ax^2(t)\\
k\dot{w}(akt)ak & = & ak^2kw(akt) - ak^2w^2(akt)\\
\dot{w}(akt) & = & w(akt) - w^2(akt) \quad \mbox{ mit } t_n = akt\\
\dot{w}(t_n) & = & w(t_n) - w^2(t_n) \qquad \blacksquare\\
\end{eqnarray*}

\end{document}
