blatt03.mw

Blatt 3 und Vorlesung Kapitel 14.3 Differenzierbarkeit

> restart:

> with(plots):with(linalg):

Warning, the name changecoords has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

Paraboloid

> f:=x^2+y^2;

f := x^2+y^2

> plot3d(f,x=-1..1,y=-1..1,view=-0.11..1,axes=normal, grid=[20,20]);

[Plot]

> plot3d(f,x=-1..1,y=-1..1,view=-0.11..1,axes=normal, grid=[20,20],contours=11, style=patchcontour);

[Plot]

> grad(f,[x,y]);

vector([2*x, 2*y])

> hessian(f,[x,y]);

matrix([[2, 0], [0, 2]])

Hyperbolisches Paraboloid

> f:=x^2-y^2;

f := x^2-y^2

> plot3d(f,x=-1..1,y=-1..1,view=-1..1,axes=normal, grid=[20,20]);

[Plot]

> plot3d(f,x=-1..1,y=-1..1,view=-1..1, axes=normal, grid=[21,21],contours=21, style=patchcontour);

[Plot]

> grad(f,[x,y]);

vector([2*x, -2*y])

> hessian(f,[x,y]);

matrix([[2, 0], [0, -2]])

Motivation für partielle Ableitungen

> f:=2-(x^2+y^2); x0:=0.4; y0:=0.6;

f := 2-x^2-y^2

x0 := .4

y0 := .6

> g:=grad(f,[x,y]);

g := vector([-2*x, -2*y])

> f:=unapply(f,x,y);

f := proc (x, y) options operator, arrow; 2-x^2-y^2 end proc

> g1:=unapply(g[1],x,y); g2:=unapply(g[2],x,y);

g1 := proc (x, y) options operator, arrow; -2*x end proc

g2 := proc (x, y) options operator, arrow; -2*y end proc

> p:=plot3d(f(x,y),x=-1..1,y=-1..1,view=-1..2,axes=normal, grid=[20,20], style=patchnogrid, scaling=constrained):

> p1:=spacecurve([x0+t,y0,f(x0+t,y0)], t=-1..1, thickness=3, color=blue):

> q1:=spacecurve([x0+t,y0,f(x0,y0)+t*g1(x0,y0)], t=-1..1, thickness=3, color=red):

> p2:=spacecurve([x0,y0+t,f(x0,y0+t)], t=-1..1, thickness=2, color=blue):

> q2:=spacecurve([x0,y0+t,f(x0,y0)+t*g2(x0,y0)], t=-1..1, thickness=2, color=red):

> n1:=spacecurve([x0+t*g1(x0,y0),y0+t*g2(x0,y0),f(x0,y0)-t], t=-1..1, thickness=2, color=green):

> Stelle:=spacecurve([x0+0.02*cos(t),y0+0.02*sin(t),f(x0,y0)],t=0..2*Pi,thickness=5,color=red):

> display(p,p1,q1,p2,q2,n1,Stelle);

[Plot]

Tangentenebene

> T:=f(x0,y0)+g1(x0,y0)*(x-x0)+g2(x0,y0)*(y-y0);

T := 2.52-.8*x-1.2*y

> p11:=spacecurve([x0+t,y0,f(x0+t,y0)], t=-1..1, thickness=1, color=blue):

> q11:=spacecurve([x0+t,y0,f(x0,y0)+t*g1(x0,y0)], t=-1..1, thickness=2, color=red):

> p22:=spacecurve([x0,y0+t,f(x0,y0+t)], t=-1..1, thickness=1, color=blue):

> q22:=spacecurve([x0,y0+t,f(x0,y0)+t*g2(x0,y0)], t=-1..1, thickness=2, color=red):

> n1:=spacecurve([x0+t*g1(x0,y0),y0+t*g2(x0,y0),f(x0,y0)-t], t=-1..1, thickness=3, color=green):

> pt:=plot3d(T,x=-2..2,y=-2..2,view=0..1.5,style=PATCHNOGRID,shading=Z,transparency=0.7):

> Stelle:=spacecurve([x0+0.02*cos(t),y0+0.02*sin(t),f(x0,y0)],t=0..2*Pi,thickness=5,color=black):

> display(p,p11,q11,p22,q22,n1,pt,Stelle);

[Plot]

Übungen Blatt 3

T 9 Stehende Welle

> f:=sin(x)*sin(y);

f := sin(x)*sin(y)

> plot3d(f,x=-6..6,y=-6..6,view=-1..1,axes=boxed, grid=[50,50]);

[Plot]

> plot3d(f,x=-6..6,y=-6..6,view=-1..1,axes=boxed, grid=[50,50],contours=11,style=patchcontour,scaling=constrained);

[Plot]

> p1:=implicitplot( sin(x)*sin(y)=1/2,x=-2*Pi..2*Pi,y=-2*Pi..2*Pi,grid=[50,50],thickness=3,color=red):

> p2:=implicitplot( sin(x)*sin(y)=-1/2,x=-2*Pi..2*Pi,y=-2*Pi..2*Pi,grid=[50,50],thickness=3,color=blue):

> p3:=implicitplot( sin(x)*sin(y)=0,x=-2*Pi..2*Pi,y=-2*Pi..2*Pi,grid=[50,50],thickness=3,color=black,scaling=constrained):

> display({p1,p2,p3});

[Plot]

> plot({sin(x),0.5*sin(x),-0.5*sin(x),0.2*sin(x),-0.2*sin(x),0.8*sin(x),-0.8*sin(x),-sin(x)},x=0....4*Pi,thickness=2);

[Plot]

T 11  vgl. Blatt 1 E 01

> f:=(x^3-3*x*y^2)/(x^2+y^2);

f := (x^3-3*x*y^2)/(x^2+y^2)

> f:=unapply(f,x,y);

f := proc (x, y) options operator, arrow; (x^3-3*x*y^2)/(x^2+y^2) end proc

> plot3d(f(x,y),x=-1..1,y=-1..1,view=-1.5..1.5, axes=normal, grid=[50,50]);

[Plot]

grad(f(x,y))=( f_x , f_y ) mit den ersten partiellen Ableitungen von f nach x bzw.y:

> simplify(grad(f(x,y),[x,y]));

vector([-(-x^4+3*y^4-6*x^2*y^2)/(x^2+y^2)^2, -8*x^3*y/(x^2+y^2)^2])

f_x(0,0) durch Grenzwert:

> limit((f(0+h,0)-0)/h , h=0);

1

f_y(0,0) durch Grenzwert:

> limit((f(0,0+h)-0)/h , h=0);

0

=> grad(f(0,0))=(1,0) , aber Grad(f) dort nicht stetig ! Betrachte z.B. y=2x mit x->0

hessian(f(x,y))=[[f_xx , f_xy],[f_yx , f_yy]] ist die Matrix mit den zweiten partiellen Ableitungen von f nach x bzw. y:

> simplify(hessian(f(x,y),[x,y]));

matrix([[8*x*y^2*(-x^2+3*y^2)/(x^2+y^2)^3, -8*x^2*(-x^2+3*y^2)*y/(x^2+y^2)^3], [-8*x^2*(-x^2+3*y^2)*y/(x^2+y^2)^3, 8*x^3*(-x^2+3*y^2)/(x^2+y^2)^3]])

Beachte: f_xy = f_yx sofern (x,y) ungleich (0,0) (dort geht Polardarstellung mit 1/r gegen unendlich)

H 05

> f:=2*x*y/(x^2+y^2);

f := 2*x*y/(x^2+y^2)

> plot3d(f,x=-1..1,y=-1..1,view=-1..1,axes=normal, grid=[20,20]);

[Plot]

> plot3d(f,x=-1..1,y=-1..1,view=-1..1,axes=normal, grid=[20,20],contours=11, style=patchcontour);

[Plot]

> grad(f,[x,y]);

vector([2*y/(x^2+y^2)-4*x^2*y/(x^2+y^2)^2, 2*x/(x^2+y^2)-4*x*y^2/(x^2+y^2)^2])

> hessian(f,[x,y]);

matrix([[-12*y*x/(x^2+y^2)^2+16*x^3*y/(x^2+y^2)^3, 2/(x^2+y^2)-4*x^2/(x^2+y^2)^2-4*y^2/(x^2+y^2)^2+16*x^2*y^2/(x^2+y^2)^3], [2/(x^2+y^2)-4*x^2/(x^2+y^2)^2-4*y^2/(x^2+y^2)^2+16*x^2*y^2/(x^2+y^2)^3, -12...

H 06

> f:=x*y^2/(x^2+y^4);

f := x*y^2/(x^2+y^4)

> plot3d(f,x=-1..1,y=-1..1,view=-0.55..0.55,axes=normal, grid=[20,20]);

[Plot]

> plot3d(f,x=-1..1,y=-1..1,view=-0.55..0.55,axes=normal, grid=[20,20],contours=11, style=patchcontour);

[Plot]

> grad(f,[x,y]);

vector([y^2/(x^2+y^4)-2*x^2*y^2/(x^2+y^4)^2, 2*x*y/(x^2+y^4)-4*x*y^5/(x^2+y^4)^2])

> hessian(f,[x,y]);

matrix([[-6*y^2*x/(x^2+y^4)^2+8*x^3*y^2/(x^2+y^4)^3, 2*y/(x^2+y^4)-4*x^2*y/(x^2+y^4)^2-4*y^5/(x^2+y^4)^2+16*x^2*y^5/(x^2+y^4)^3], [2*y/(x^2+y^4)-4*x^2*y/(x^2+y^4)^2-4*y^5/(x^2+y^4)^2+16*x^2*y^5/(x^2+y...

>

E 03 Zweite partielle Ableitungen, vgl. T 05

> f:=x*y*(x^2-y^2)/(x^2+y^2);

f := x*y*(x^2-y^2)/(x^2+y^2)

> f:=unapply(f,x,y);

f := proc (x, y) options operator, arrow; x*y*(x^2-y^2)/(x^2+y^2) end proc

> plot3d(f(x,y),x=-1..1,y=-1..1,view=-0.5..0.5, axes=normal, grid=[50,50]);

[Plot]

grad(f(x,y))=( f_x , f_y ) mit den ersten partiellen Ableitungen von f nach x bzw.y:

> g:=simplify(grad(f(x,y),[x,y]));

g := vector([-y*(-x^4+y^4-4*x^2*y^2)/(x^2+y^2)^2, -x*(-x^4+y^4+4*x^2*y^2)/(x^2+y^2)^2])

> g1:=unapply(g[1],x,y); g2:=unapply(g[2],x,y);

g1 := proc (x, y) options operator, arrow; -y*(-x^4+y^4-4*x^2*y^2)/(x^2+y^2)^2 end proc

g2 := proc (x, y) options operator, arrow; -x*(-x^4+y^4+4*x^2*y^2)/(x^2+y^2)^2 end proc

f_x(0,0) durch Grenzwert:

> limit((f(0+h,0)-0)/h , h=0);

0

f_y(0,0) durch Grenzwert:

> limit((f(0,0+h)-0)/h , h=0);

0

=> grad(f(0,0))=(1,0) , aber Grad(f) dort nicht stetig ! Betrachte z.B. y=2x mit x->0

hessian(f(x,y))=[[f_xx , f_xy],[f_yx , f_yy]] ist die Matrix mit den zweiten partiellen Ableitungen von f nach x bzw. y:

> simplify(hessian(f(x,y),[x,y]));

matrix([[4*x*y^3*(-x^2+3*y^2)/(x^2+y^2)^3, -(-x^6-9*x^4*y^2+9*x^2*y^4+y^6)/(x^2+y^2)^3], [-(-x^6-9*x^4*y^2+9*x^2*y^4+y^6)/(x^2+y^2)^3, 4*x^3*y*(-3*x^2+y^2)/(x^2+y^2)^3]])

f_xy(0,0) durch Grenzwert:

> limit((g1(0,0+h)-0)/h , h=0);

-1

f_yx(0,0) durch Grenzwert:

> limit((g2(0+h,0)-0)/h , h=0);

1

>

Beachte: f_xy = f_yx sofern (x,y) ungleich (0,0)