> # sfb 10 Oct, 2002 > restart: > #maple help > #try a gradient of sin(x)cos(y) > with(linalg); > grad(sin(x)*cos(y));#I need help on how to do grad > #help function suggests > grad(sin(x)*cos(y),vector([x,y])); > grad(sin(x)*cos(y),[x,y]); > #dotprod--topic search for help. > #hw > #u(x,t)=f(x+ct)+g(x-ct) show it solves the wave equation# > Diff(u,x,x)=Diff(u,t,t)/c^2; > #u_x=f'(x+ct)*1+g'(x-ct)*1;u_xx=f''(x+ct)*1+g''(x-ct)*1 > #u_t=f'(x+ct)*c+g'(x-ct)*c;u_xx=f''(x+ct)*c^2+g''(x-ct)*c^2 > #Is f''(x+ct)*1+g''(x-ct)*1 =? [f''(x+ct)*c^2+g''(x-ct)*c^2]/c^2 ? YES > #14.7#14 > mtaylor(exp(x)*cos(y),[x=0,y=0],3); > #15.1#12 > f:=(x+y)*(x*y+1);expand(f); > expand(diff(f,x));expand(diff(f,y));solve({diff(f,x)=0,diff(f,y)=0},{x,y}); > plot3d(f,x=-2..2,y=-2..2,view=[-2..2,-2..2,-1..1]); > #15.2#16 3x+2y+z=1; > implicitplot3d(3*x+2*y+z=1,x=0..1,y=0..1,z=0..1);# > #solve for z, z = 1-3x-2y the distanced squared function of x and y the point is (x,y,1-3x-2y) > f:=x^2+y^2+(1-3*x-2*y)^2;diff(f,x);diff(f,y); > #15.3#8 > F:=x+3*y+5*z-lambda*(x^2+y^2+z^2-1);diff(F,x);diff(F,y);diff(F,z);diff(F,lambda); > with(plots);with(plottools);with(linalg); > x=r*cos(theta);y=r*sin(theta);coordplot(polar,color=[red,black],scaling=constrained); > a:=polarplot(1+cos(theta),theta=0..2*Pi,scaling=constrained,color=blue):a; > b:=plot({x,x/sqrt(3)},x=-0.5..2,color=green):b; > c:=polarplot({1, 1.2},theta=0..2*Pi,color=green):c; > display(a,b,c); > # dA = dx dy = r dr dtheta > > time(int(int(1,y=-sqrt(1-x^2)..sqrt(1-x^2)),x=-1..1)); > time(int(int(1*r,r=0..1),theta=0..2*Pi)); > time(int(int(sqrt(1-x^2-y^2),y=-sqrt(1-x^2)..sqrt(1-x^2)),x=-1..1)); > time(int(int(sqrt(1-r^2)*r,r=0..1),theta=0..2*Pi)); > # cylindrical coordinates (r, theta, z) [Polar with z] > x=r*cos(theta);y=r*sin(theta);z=z;coordplot3d(cylindrical); > # cylinderplot assume r = r(theta,z); > # dV = dx dy dz = r dr dtheta dz > cylinderplot(1+z*sin(theta),theta=0..2*Pi,z=0..2); > cylinderplot(2,theta=0..2*Pi,z=0..2); > coordplot3d(spherical); > sphereplot(2,theta=0..2*Pi,phi=0..Pi); > a:=sphereplot(2,theta=0..2*Pi,phi=0..Pi/4,scaling=constrained):a; > b:=cylinderplot(z,theta=0..2*Pi,z=0..sqrt(2)):b; > display(a,b); > #dV = rho^2 sin (phi) d pho d phi d theta > 'int(int(int(rho^2*sin(phi),rho=0..1),phi=0..Pi),theta=0..2*Pi)'=int(int(int(rho^2*sin(phi),rho=0..1),phi=0..Pi),theta=0..2*Pi); > 'int(int(int(1*r,z=-sqrt(1-r^2)..sqrt(1-r^2)),r=0..1),theta=0..2*Pi)'=int(int(int(1*r,z=-sqrt(1-r^2)..sqrt(1-r^2)),r=0..1),theta=0..2*Pi); > 'int(int(int(1,z=-sqrt(1-x^2-y^2)..sqrt(1-x^2-y^2)),y=-sqrt(1-x^2)..sqrt(1-x^2)),x=-1..1)'=int(int(int(1,z=-sqrt(1-x^2-y^2)..sqrt(1-x^2-y^2)),y=-sqrt(1-x^2)..sqrt(1-x^2)),x=-1..1); > x=rho*sin(phi)*cos(theta);y=rho*sin(phi)*sin(theta);z=rho*cos(phi);r=rho*sin(phi); > #1. normal dot (X - X_0) > F:=x+y^2+z^3+x*y*z; > gF:=grad(F,[x,y,z]); > gfp:=eval([gF[1],gF[2],gF[3]],{x=3,y=2,z=1}); > xmx0:=vector([x-3,y-2,z-1]); > dotprod(gfp,xmx0,orthogonal)=0; > #2 directional derivative > F:=sin(x)*cos(y)*ln(z); > gF:=grad(F,[x,y,z]); > gfp:=eval([gF[1],gF[2],gF[3]],{x=Pi/4,y=Pi/3,z=3}); > u:=vector([4/6,-4/6,2/6]); > dotprod(gfp,xmx0,orthogonal); > Z:=(x+y)*ln(x+y);diff(Z,x);diff(Z,y); > X:=u*sin(v);Y:=u^2+v^(-2);diff(X,u);diff(X,v);diff(Y,u);diff(Y,v); > Z_u:=diff(Z,x)*diff(X,u)+diff(Z,y)*diff(Y,u); > Z_v:=diff(Z,x)*diff(X,v)+diff(Z,y)*diff(Y,v); > r:=[t*cos(2*Pi*t),t*sin(2*Pi*t)]; > diff(r,t); > diff(r,t,t); > plot([t*cos(2*Pi*t),t*sin(2*Pi*t),t=0..2],x=-2..2); > > int(sqrt(diff(r[1],t)^2+diff(r[2],t)^2),t=0..2); > evalf(int(sqrt(diff(r[1],t)^2+diff(r[2],t)^2),t=0..2)); > #8 > F:=x+2*y-lambda*(x^2+4*y^2-1); > diff(F,x)=0;diff(F,y)=0;diff(F,lambda)=0;; > #5 > f:=8*x*y-(x+y)^4/4; > diff(f,x)=0;diff(f,y)=0; > diff(f,x,x);diff(f,x,y);diff(f,y,y); > f:=int(x*(x-1),x); > plot(f,x=-1..2); > g:=int((x-3)*(x-4)*(x-5),x); > plot(g,x=2..6); > plot3d(f+subs(x=y,g),x=-1..2,y=2..6); >