Computermathematik2_10

366 days ago by PatrickHammer

Übungsblatt_10
SS 2010/11


BEISPIEL 29
Es sei g, f ∈ R[X] ein Polynome über R und man nennt g einen Teiler von f wenn es ein q ∈ R[x], gibt sodass f = qg. Teilt ein Polynom q sowohl f als auch g so nennt man q einen gemeinsamen Teiler von f und g. Der größte (bzgl. Grad des Polynoms q) gemeinsame normierte (Koeffizient der höchsten Potenz von X ist 1) Teiler q wird mit ggT(f, g) bezeichnet. Es gilt
ggT(f, g) = ggT(g, f mod g) und ggT(f, 0) = f.
Schreiben Sie einen Algorithmus der ggT(f, g) für f, g ∈ R[X] berechnet.
P.<x>=QQ[] def ggt(f,g): return f/f[f.degree()] if g==0 else ggt(g,f%g) view(ggt((x+1)*(x+2)*(x+3),(x+1)*(x+2)).factor()) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}(x + 1) \cdot (x + 2)
\newcommand{\Bold}[1]{\mathbf{#1}}(x + 1) \cdot (x + 2)

BEISPIEL 30
Sei f ∈ R[X] und sei p ein Teiler von f sodass auch p²|f , dann gilt p|ggT(f, f'). Der größte normierte Teiler Rad(f) von f, sodass kein Teiler p mit deg p ≥ 1 von Rad(f) die Eigenschaft p²|Rad(f) hat, nennt man das Radikal von f. Man schreibe einen Algorithmus der Rad(f) berechnet.
def radical(f): return f//f.gcd(f.derivative()) a=34*x^7+32*x^6+333*x^5+x^3+3*x^2 view(a); view(radical(a)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}34 x^{7} + 32 x^{6} + 333 x^{5} + x^{3} + 3 x^{2}
\newcommand{\Bold}[1]{\mathbf{#1}}34 x^{6} + 32 x^{5} + 333 x^{4} + x^{2} + 3 x
\newcommand{\Bold}[1]{\mathbf{#1}}34 x^{7} + 32 x^{6} + 333 x^{5} + x^{3} + 3 x^{2}
\newcommand{\Bold}[1]{\mathbf{#1}}34 x^{6} + 32 x^{5} + 333 x^{4} + x^{2} + 3 x

BEISPIEL 31
Es sei f(x,y)=e^(sin(x)+y)/(x^2+y^3+3*x-4). Man entwickle f nach dem Taylorschen Satz um den Punkt (1, −1) bis zu den Gliedern dritter Ordnung.
f(x,y)=e^(sin(x)+y)/(x^2+y^3+3*x-4) view(taylor(f,(x,1),(y,-1),3)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left( x, y \right) \ {\mapsto} \ -{\left(4 \, {\left(y + 1\right)} e^{\sin\left(1\right)} + {\left(x - 1\right)} {\left(e^{\sin\left(1\right)} \cos\left(1\right) + 5 \, e^{\sin\left(1\right)}\right)}\right)} e^{\left(-1\right)} - \frac{1}{2} \, {\left(19 \, {\left(y + 1\right)}^{2} e^{\sin\left(1\right)} + 2 \, {\left(y + 1\right)} {\left(x - 1\right)} {\left(4 \, e^{\sin\left(1\right)} \cos\left(1\right) + 35 \, e^{\sin\left(1\right)}\right)} + {\left(x - 1\right)}^{2} {\left(e^{\sin\left(1\right)} \cos\left(1\right)^{2} - e^{\sin\left(1\right)} \sin\left(1\right) + 10 \, e^{\sin\left(1\right)} \cos\left(1\right) + 52 \, e^{\sin\left(1\right)}\right)}\right)} e^{\left(-1\right)} - \frac{1}{6} \, {\left(106 \, {\left(y + 1\right)}^{3} e^{\sin\left(1\right)} + 3 \, {\left(y + 1\right)}^{2} {\left(x - 1\right)} {\left(19 \, e^{\sin\left(1\right)} \cos\left(1\right) + 275 \, e^{\sin\left(1\right)}\right)} + 6 \, {\left(y + 1\right)} {\left(x - 1\right)}^{2} {\left(2 \, e^{\sin\left(1\right)} \cos\left(1\right)^{2} - 2 \, e^{\sin\left(1\right)} \sin\left(1\right) + 35 \, e^{\sin\left(1\right)} \cos\left(1\right) + 257 \, e^{\sin\left(1\right)}\right)} + {\left(x - 1\right)}^{3} {\left(e^{\sin\left(1\right)} \cos\left(1\right)^{3} + 15 \, e^{\sin\left(1\right)} \cos\left(1\right)^{2} - 3 \, {\left(e^{\sin\left(1\right)} \cos\left(1\right) + 5 \, e^{\sin\left(1\right)}\right)} \sin\left(1\right) + 155 \, e^{\sin\left(1\right)} \cos\left(1\right) + 810 \, e^{\sin\left(1\right)}\right)}\right)} e^{\left(-1\right)} - e^{\left(\sin\left(1\right) - 1\right)}
\newcommand{\Bold}[1]{\mathbf{#1}}\left( x, y \right) \ {\mapsto} \ -{\left(4 \, {\left(y + 1\right)} e^{\sin\left(1\right)} + {\left(x - 1\right)} {\left(e^{\sin\left(1\right)} \cos\left(1\right) + 5 \, e^{\sin\left(1\right)}\right)}\right)} e^{\left(-1\right)} - \frac{1}{2} \, {\left(19 \, {\left(y + 1\right)}^{2} e^{\sin\left(1\right)} + 2 \, {\left(y + 1\right)} {\left(x - 1\right)} {\left(4 \, e^{\sin\left(1\right)} \cos\left(1\right) + 35 \, e^{\sin\left(1\right)}\right)} + {\left(x - 1\right)}^{2} {\left(e^{\sin\left(1\right)} \cos\left(1\right)^{2} - e^{\sin\left(1\right)} \sin\left(1\right) + 10 \, e^{\sin\left(1\right)} \cos\left(1\right) + 52 \, e^{\sin\left(1\right)}\right)}\right)} e^{\left(-1\right)} - \frac{1}{6} \, {\left(106 \, {\left(y + 1\right)}^{3} e^{\sin\left(1\right)} + 3 \, {\left(y + 1\right)}^{2} {\left(x - 1\right)} {\left(19 \, e^{\sin\left(1\right)} \cos\left(1\right) + 275 \, e^{\sin\left(1\right)}\right)} + 6 \, {\left(y + 1\right)} {\left(x - 1\right)}^{2} {\left(2 \, e^{\sin\left(1\right)} \cos\left(1\right)^{2} - 2 \, e^{\sin\left(1\right)} \sin\left(1\right) + 35 \, e^{\sin\left(1\right)} \cos\left(1\right) + 257 \, e^{\sin\left(1\right)}\right)} + {\left(x - 1\right)}^{3} {\left(e^{\sin\left(1\right)} \cos\left(1\right)^{3} + 15 \, e^{\sin\left(1\right)} \cos\left(1\right)^{2} - 3 \, {\left(e^{\sin\left(1\right)} \cos\left(1\right) + 5 \, e^{\sin\left(1\right)}\right)} \sin\left(1\right) + 155 \, e^{\sin\left(1\right)} \cos\left(1\right) + 810 \, e^{\sin\left(1\right)}\right)}\right)} e^{\left(-1\right)} - e^{\left(\sin\left(1\right) - 1\right)}

BEISPIEL 32
Man finde alle lokalen Minima und Maxima der Funktion f(x,y)=(x^4+2*y*x^3+y^2+3*x^2*y)/(x^4+x^2*y+y^2+7)
f(x,y)=(x^4+2*y*x^3+y^2+3*x^2*y)/(x^4+x^2*y+y^2+7) fx=f.diff(x); fy=f.diff(y); fxx=fx.diff(x); g=fxx*fy.diff(y)-fx.diff(y)^2 sols=solve([fx==0,fy==0],(x,y),solution_dict=True) for s in sols: if "I" not in str(s) and g(s[x],s[y])>0: print "max" if fxx(s[x],s[y])>0 else "min" if fxx(s[x],s[y])<0 else "",s[x],s[y] 
       
max -0.39579002079 -0.172901756669
min -0.665615282097 47.6212624585
max -0.39579002079 -0.172901756669
min -0.665615282097 47.6212624585