# Here we present the solutions of those problems in the # review problems that require MAPLE to be solved. # In problem 1 we have to use Lagrange multipliers. The theory (you # learned in 21D) says that maximum or minimum of a function f # subject to a constraint g=0 is given at the roots of system of # equations # f_x=k g_x, f_y=k g_y, f_z=k g_z. # > restart;f:=(x-1)^2+(y-1)^2+(z-1)^2; 2 2 2 f := (x - 1) + (y - 1) + (z - 1) > g:=x^4+y^2+z^2-1; 4 2 2 g := x + y + z - 1 > eq1:=diff(f,x)-k*diff(g,x); 3 eq1 := 2 x - 2 - 4 k x > eq2:=diff(f,y)-k*diff(g,y); eq2 := 2 y - 2 - 2 k y > eq3:=diff(f,z)-k*diff(g,z); eq3 := 2 z - 2 - 2 k z > with(Groebner); [GB_Internals, MulMatrix, SetBasis, fglm_algo, gbasis, gsolve, hilbertdim, hilbertpoly, hilbertseries, inter_reduce, is_finite, is_solvable, leadcoeff, leadmon, leadterm, normalf, pretend_gbasis, reduce, spoly, termorder, testorder, univpoly ] # Now we compute the lexicographic Grobner bases. > F:=[eq1,eq2,eq3,g]; 3 F := [2 x - 2 - 4 k x , 2 y - 2 - 2 k y, 2 z - 2 - 2 k z, 4 2 2 x + y + z - 1] > G:=gbasis(F,plex(k,x,y,z)); 2 3 4 6 5 7 G := [-8 + 32 z + 4 z - 172 z + 176 z - 471 z + 232 z + 96 z 9 8 10 9 8 - 256 z + 304 z + 64 z , -z + y, 4 x - 192 z + 640 z 7 6 5 4 3 2 - 400 z - 896 z + 1285 z + 54 z - 840 z + 252 z 9 8 7 6 5 + 156 z - 68, 8 k + 64 z - 256 z + 304 z + 96 z - 471 z 4 3 2 + 232 z + 176 z - 172 z + 4 z + 24] > nops(G); 4 > assign({solve(G[2],{y})}); assign({solve(G[3],{x})}); These below are the roots of the first equation (in floating point values) we # will need to subtitute them to obtain all roots > H:=[evalf(solve(G[1],z))]; H := [0.6348187101, 1.235234773 + 0.1439048967 I, 0.4955573659 + 0.1400771672 I, 1.000035403 + 0.6475570597 I, -0.7364766946 + 0.008754698995 I, -0.6235204055, -0.7364766946 - 0.008754698995 I, 1.000035403 - 0.6475570597 I, 0.4955573659 - 0.1400771672 I, 1.235234773 - 0.1439048967 I] # Now to obtain the > for i from 1 to nops(H) do print(op(i,H),subs(z=op(i,H),{y,x})); od; 0.6348187101, {0.6348187101, 0.66367622} 1.235234773 + 0.1439048967 I, {0.92391635 - 0.778842571 I, 1.235234773 + 0.1439048967 I} 0.4955573659 + 0.1400771672 I, {-0.10355154 - 0.879272461 I, 0.4955573659 + 0.1400771672 I} 1.000035403 + 0.6475570597 I, {-1.16493680 + 0.50391547 I, 1.000035403 + 0.6475570597 I} -0.7364766946 + 0.008754698995 I, { -0.7364766946 + 0.008754698995 I, 0.35611404 - 0.4130935828 I } -0.6235204055, {-0.6235204055, -0.68676077} -0.7364766946 - 0.008754698995 I, { -0.7364766946 - 0.008754698995 I, 0.35611404 + 0.4130935828 I } 1.000035403 - 0.6475570597 I, {1.000035403 - 0.6475570597 I, -1.16493680 - 0.50391547 I} 0.4955573659 - 0.1400771672 I, {-0.10355154 + 0.879272461 I, 0.4955573659 - 0.1400771672 I} 1.235234773 - 0.1439048967 I, {0.92391635 + 0.778842571 I, 1.235234773 - 0.1439048967 I} > NOW we are going to solve problem 2 to find whether there are critical points. > > > restart; > f:=(x^2+y^2-4)*(x^2+y^2-1)+(x-3/2)^2+(y-3/2)^2; 2 2 2 2 2 2 f := (x + y - 4) (x + y - 1) + (x - 3/2) + (y - 3/2) > F:=[f,diff(f,x),diff(f,y)]; 2 2 2 2 2 2 F := [(x + y - 4) (x + y - 1) + (x - 3/2) + (y - 3/2) , 2 2 2 2 2 x (x + y - 1) + 2 (x + y - 4) x + 2 x - 3, 2 2 2 2 2 y (x + y - 1) + 2 (x + y - 4) y + 2 y - 3] > with(Groebner); [GB_Internals, MulMatrix, SetBasis, fglm_algo, gbasis, gsolve, hilbertdim, hilbertpoly, hilbertseries, inter_reduce, is_finite, is_solvable, leadcoeff, leadmon, leadterm, normalf, pretend_gbasis, reduce, spoly, termorder, testorder, univpoly ] > gbasis(F,plex(x,y)); [1] # So in conclusion there are no critical points for this polynomial # # Now we solve problem 4 of the review # > FF:=[x^2+y^2+z^2-1,x^2+y^2+z^2-2*x, 2*x-3*y-z]; 2 2 2 2 2 2 FF := [x + y + z - 1, x + y + z - 2 x, 2 x - 3 y - z] > H:=gbasis(FF,plex(x,y,z)); 2 H := [40 z - 8 z - 23, z + 3 y - 1, -1 + 2 x] > assign({solve(H[2],{y})}); > J:=[solve(H[1],z)]; 1/2 1/2 3 26 3 26 J := [1/10 + -------, 1/10 - -------] 20 20 > y; - z/3 + 1/3 > evalf(y); -0.3333333333 z + 0.3333333333 > subs(z=op(1,J),y); 1/2 26 3/10 - ----- 20 >