ws03.mw

>
 

Assignment 

Worksheet 3 

 

Problem 1. 

In each part, you are given a symmetric matrix Typesetting:-mrow(Typesetting:-mi( 

 

 

 

 

Part A. 

> A := Matrix(4, 4, {(1, 1) = 1, (1, 2) = 2/3, (1, 3) = -1/3, (1, 4) = 4/3, (2, 1) = 2/3, (2, 2) = 1/3, (2, 3) = 0, (2, 4) = -2/3, (3, 1) = -1/3, (3, 2) = 0, (3, 3) = 8/3, (3, 4) = -1/3, (4, 1) = 4/3, (4, 2) = -2/3, (4, 3) = -1/3, (4, 4) = 1});
 

Typesetting:-mprintslash([`:=`(A, Matrix([[1, `/`(2, 3), -`/`(1, 3), `/`(4, 3)], [`/`(2, 3), `/`(1, 3), 0, -`/`(2, 3)], [-`/`(1, 3), 0, `/`(8, 3), -`/`(1, 3)], [`/`(4, 3), -`/`(2, 3), -`/`(1, 3), 1]])...
 

>
 

Part B. 

> A := Matrix(4, 4, {(1, 1) = 4/3, (1, 2) = 1/3, (1, 3) = 1/3, (1, 4) = 0, (2, 1) = 1/3, (2, 2) = 16/9, (2, 3) = -1/9, (2, 4) = 2/9, (3, 1) = 1/3, (3, 2) = -1/9, (3, 3) = 16/9, (3, 4) = -2/9, (4, 1) = 0, (4, 2) = 2/9, (4, 3) = -2/9, (4, 4) = 10/9});
 

Typesetting:-mprintslash([`:=`(A, Matrix([[`/`(4, 3), `/`(1, 3), `/`(1, 3), 0], [`/`(1, 3), `/`(16, 9), -`/`(1, 9), `/`(2, 9)], [`/`(1, 3), -`/`(1, 9), `/`(16, 9), -`/`(2, 9)], [0, `/`(2, 9), -`/`(2, ...
 

>
 

Part C. 

> A := Matrix(4, 4, {(1, 1) = 11/6, (1, 2) = 0, (1, 3) = 1/3, (1, 4) = -1/6, (2, 1) = 0, (2, 2) = 2, (2, 3) = 0, (2, 4) = 0, (3, 1) = 1/3, (3, 2) = 0, (3, 3) = 4/3, (3, 4) = 1/3, (4, 1) = -1/6, (4, 2) = 0, (4, 3) = 1/3, (4, 4) = 11/6})
 

 

Warning, inserted missing semicolon at end of statement
Typesetting:-mprintslash([`:=`(A, Matrix([[`/`(11, 6), 0, `/`(1, 3), -`/`(1, 6)], [0, 2, 0, 0], [`/`(1, 3), 0, `/`(4, 3), `/`(1, 3)], [-`/`(1, 6), 0, `/`(1, 3), `/`(11, 6)]]))], [Matrix(%id = 13680540...
 

>
 

Instructions:  

For the rest of this assignment you can use the commands "Eigenvalues" and "Eigenvectors" when you need to find eigenvalues and eigenvectors. 

 

Problem 2. 

In each part you are given a quadratic form in two variables.   In each part, use the discriminant (Typesetting:-mrow(Typesetting:-mi() test to determine the signs of the eigenvalues.  Determine if the form is degenerate or nondegenerate.  Is it postive definite, postive semi-definite, indefinite, negative semi-definite or negative definite?  Check your result by computing eigenvalues. 

 

Part A. 

> q := (14/5)*x^2-(4/5)*x*y+(11/5)*y^2;
 

Typesetting:-mprintslash([`:=`(q, `+`(`*`(`/`(14, 5), `*`(`^`(x, 2))), `-`(`*`(`/`(4, 5), `*`(x, `*`(y)))), `*`(`/`(11, 5), `*`(`^`(y, 2)))))], [`+`(`*`(`/`(14, 5), `*`(`^`(x, 2))), `-`(`*`(`/`(4, 5),...
 

>
 

Part B. 

> q := (8/5)*x^2-(8/5)*x*y+(2/5)*y^2;
 

Typesetting:-mprintslash([`:=`(q, `+`(`*`(`/`(8, 5), `*`(`^`(x, 2))), `-`(`*`(`/`(8, 5), `*`(x, `*`(y)))), `*`(`/`(2, 5), `*`(`^`(y, 2)))))], [`+`(`*`(`/`(8, 5), `*`(`^`(x, 2))), `-`(`*`(`/`(8, 5), `*...
 

>
 

Part C. 

> q:= -(11/5)*x^2+(4/5)*x*y-(14/5)*y^2;
 

Typesetting:-mprintslash([`:=`(q, `+`(`-`(`*`(`/`(11, 5), `*`(`^`(x, 2)))), `*`(`/`(4, 5), `*`(x, `*`(y))), `-`(`*`(`/`(14, 5), `*`(`^`(y, 2))))))], [`+`(`-`(`*`(`/`(11, 5), `*`(`^`(x, 2)))), `*`(`/`(...
 

>
 

Part D. 

> q := -(29/17)*x^2+(40/17)*x*y+(46/17)*y^2;
 

Typesetting:-mprintslash([`:=`(q, `+`(`-`(`*`(`/`(29, 17), `*`(`^`(x, 2)))), `*`(`/`(40, 17), `*`(x, `*`(y))), `*`(`/`(46, 17), `*`(`^`(y, 2)))))], [`+`(`-`(`*`(`/`(29, 17), `*`(`^`(x, 2)))), `*`(`/`(...
 

>
 

Problem 3. 

In each part, describe the shape of the graph of the given equation.  Check that you're right by using the "implicitplot" command. 

(The command "completesquare" may be useful). 

Part A. 

> x^2+3*x*y-5*y^2+y+x-3 =0;
 

`+`(`*`(`^`(x, 2)), `*`(3, `*`(x, `*`(y))), `-`(`*`(5, `*`(`^`(y, 2)))), y, x, `-`(3)) = 0
 

>
 

Part B. 

> x^2-2*x*y+3*y^2+x-2*y+5 = 0;
 

`+`(`*`(`^`(x, 2)), `-`(`*`(2, `*`(x, `*`(y)))), `*`(3, `*`(`^`(y, 2))), x, `-`(`*`(2, `*`(y))), 5) = 0
 

>
 

Part C. 

> -(3/2)*x^2+3*x*y-(3/2)*y^2+y+x-1 =0;
 

`+`(`-`(`*`(`/`(3, 2), `*`(`^`(x, 2)))), `*`(3, `*`(x, `*`(y))), `-`(`*`(`/`(3, 2), `*`(`^`(y, 2)))), y, x, `-`(1)) = 0
 

>
 

Part D. 

> -(3/2)*x^2+9*x-23/2+3*x*y-9*y-(3/2)*y^2 =0;
 

`+`(`-`(`*`(`/`(3, 2), `*`(`^`(x, 2)))), `*`(9, `*`(x)), `-`(`/`(23, 2)), `*`(3, `*`(x, `*`(y))), `-`(`*`(9, `*`(y))), `-`(`*`(`/`(3, 2), `*`(`^`(y, 2))))) = 0
 

>
 

Problem 4. 

Consider the quadratic form Typesetting:-mrow(Typesetting:-mi( in 4 variables given below.  Diagonalize this form, i.e., find a change of coordinates Typesetting:-mrow(Typesetting:-mi( where Typesetting:-mrow(Typesetting:-mi( is an orthongonal matrix, so that the expression for Typesetting:-mrow(Typesetting:-mi( in the Typesetting:-mrow(Typesetting:-mi(-coordinates is a linear combination of squares. 

> q := (1/6)*x[1]^2+(4/3)*x[1]*x[2]-2*x[1]*x[3]+(1/3)*x[1]*x[4]-(1/3)*x[2]^2+(4/3)*x[2]*x[4]+x[3]^2+2*x[3]*x[4]+(1/6)*x[4]^2;
 

Typesetting:-mprintslash([`:=`(q, `+`(`*`(`/`(1, 6), `*`(`^`(x[1], 2))), `*`(`/`(4, 3), `*`(x[1], `*`(x[2]))), `-`(`*`(2, `*`(x[1], `*`(x[3])))), `*`(`/`(1, 3), `*`(x[1], `*`(x[4]))), `-`(`*`(`/`(1, 3...
 

>
 

Instructions and Examples. 

Here is an procedure to compute the hessian matrix of a function.  You can use it anywhere below. 

> Hessian := proc(f, varList)
 

> Matrix(nops(varList), nops(varList), (i,j)-> diff(f, varList[i], varList[j]));
 

> end;
 

Typesetting:-mprintslash([`:=`(Hessian, proc (f, varList) Matrix(nops(varList), nops(varList), proc (i, j) options operator, arrow; diff(f, varList[i], varList[j]) end proc) end proc)], [proc (f, varL...
 

> f :='f';
 

Typesetting:-mprintslash([`:=`(f, f)], [f])
 

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

Typesetting:-mprintslash([Matrix([[diff(f(x, y), `$`(x, 2)), diff(f(x, y), x, y)], [diff(f(x, y), x, y), diff(f(x, y), `$`(y, 2))]])], [Matrix(%id = 137803740)])
 

> Hessian(f(x,y,z), [x,y,z]);
 

Typesetting:-mprintslash([Matrix([[diff(f(x, y, z), `$`(x, 2)), diff(f(x, y, z), x, y), diff(f(x, y, z), x, z)], [diff(f(x, y, z), x, y), diff(f(x, y, z), `$`(y, 2)), diff(f(x, y, z), y, z)], [diff(f(...
 

> Hessian(x^2*y*z+z^3+y*x*z^2, [x,y,z]);
 

Typesetting:-mprintslash([Matrix([[`+`(`*`(2, `*`(y, `*`(z)))), `+`(`*`(2, `*`(x, `*`(z))), `*`(`^`(z, 2))), `+`(`*`(2, `*`(x, `*`(y))), `*`(2, `*`(y, `*`(z))))], [`+`(`*`(2, `*`(x, `*`(z))), `*`(`^`(...
 

>
 

A nice maple command to find the solutions of a system of polynomial equations is the command "Isolate".   For example, let's find the critical points of the following function. 

> f := x^2*y+y^2+x^3+x^2-y^3-2*x+5*y;
 

Typesetting:-mprintslash([`:=`(f, `+`(`*`(`^`(x, 2), `*`(y)), `*`(`^`(y, 2)), `*`(`^`(x, 3)), `*`(`^`(x, 2)), `-`(`*`(`^`(y, 3))), `-`(`*`(2, `*`(x))), `*`(5, `*`(y))))], [`+`(`*`(`^`(x, 2), `*`(y)), ...
 

> fx := diff(f,x);
 

Typesetting:-mprintslash([`:=`(fx, `+`(`*`(2, `*`(x, `*`(y))), `*`(3, `*`(`^`(x, 2))), `*`(2, `*`(x)), `-`(2)))], [`+`(`*`(2, `*`(x, `*`(y))), `*`(3, `*`(`^`(x, 2))), `*`(2, `*`(x)), `-`(2))])
 

> fy := diff(f,y);
 

Typesetting:-mprintslash([`:=`(fy, `+`(`*`(`^`(x, 2)), `*`(2, `*`(y)), `-`(`*`(3, `*`(`^`(y, 2)))), 5))], [`+`(`*`(`^`(x, 2)), `*`(2, `*`(y)), `-`(`*`(3, `*`(`^`(y, 2)))), 5)])
 

> solve({fx=0, fy=0}, {x,y});
 

{y = `+`(`-`(`*`(4, `*`(`^`(RootOf(`+`(`*`(23, `*`(`^`(_Z, 4))), `*`(48, `*`(`^`(_Z, 3))), `-`(`*`(36, `*`(`^`(_Z, 2)))), `-`(`*`(32, `*`(_Z))), 12)), 2)))), `/`(5, 3), `-`(`*`(`/`(23, 12), `*`(`^`(Ro...
{y = `+`(`-`(`*`(4, `*`(`^`(RootOf(`+`(`*`(23, `*`(`^`(_Z, 4))), `*`(48, `*`(`^`(_Z, 3))), `-`(`*`(36, `*`(`^`(_Z, 2)))), `-`(`*`(32, `*`(_Z))), 12)), 2)))), `/`(5, 3), `-`(`*`(`/`(23, 12), `*`(`^`(Ro...
{y = `+`(`-`(`*`(4, `*`(`^`(RootOf(`+`(`*`(23, `*`(`^`(_Z, 4))), `*`(48, `*`(`^`(_Z, 3))), `-`(`*`(36, `*`(`^`(_Z, 2)))), `-`(`*`(32, `*`(_Z))), 12)), 2)))), `/`(5, 3), `-`(`*`(`/`(23, 12), `*`(`^`(Ro...
{y = `+`(`-`(`*`(4, `*`(`^`(RootOf(`+`(`*`(23, `*`(`^`(_Z, 4))), `*`(48, `*`(`^`(_Z, 3))), `-`(`*`(36, `*`(`^`(_Z, 2)))), `-`(`*`(32, `*`(_Z))), 12)), 2)))), `/`(5, 3), `-`(`*`(`/`(23, 12), `*`(`^`(Ro...
 

>
 

Not so nice.  Try "Isolate" to get numerical approximations. 

> with(RootFinding):
 

> critpoints := Isolate({fx,fy}, [x,y]);
 

Typesetting:-mprintslash([`:=`(critpoints, [[x = .8458822000, y = -1.086625590], [x = -.7915117461, y = -1.076137510], [x = .3169917571, y = 1.679168527], [x = -2.458318733, y = 2.280696022]])], [[[x ...
Typesetting:-mprintslash([`:=`(critpoints, [[x = .8458822000, y = -1.086625590], [x = -.7915117461, y = -1.076137510], [x = .3169917571, y = 1.679168527], [x = -2.458318733, y = 2.280696022]])], [[[x ...
 

>
 

Let's check the first one. 

> subs(critpoints[1], fx);
 

0.
 

> subs(critpoints[1], fy);
 

-0.3e-8
 

Pretty close.  We could tell maple to use more accuracy if we needed it. 

 

Let's evaluate the hessian at the first critical point. 

> H := Hessian(f, [x,y]);
 

Typesetting:-mprintslash([`:=`(H, Matrix([[`+`(`*`(2, `*`(y)), `*`(6, `*`(x)), 2), `+`(`*`(2, `*`(x)))], [`+`(`*`(2, `*`(x))), `+`(2, `-`(`*`(6, `*`(y))))]]))], [Matrix(%id = 134617572)])
 

> H1:=subs(critpoints[1], H);
 

Typesetting:-mprintslash([`:=`(H1, Matrix([[4.902042020, 1.691764400], [1.691764400, 8.519753540]]))], [Matrix(%id = 137287864)])
 

>
 

Problem 5. 

In each part, find the critical points of the function.  Classify each critical point as a local max, local min, saddle point, or degenerate critical point.   

Part A. 

> f := x^3/3 +x*y+y^2-5*x -1;
 

Typesetting:-mprintslash([`:=`(f, `+`(`*`(`/`(1, 3), `*`(`^`(x, 3))), `*`(x, `*`(y)), `*`(`^`(y, 2)), `-`(`*`(5, `*`(x))), `-`(1)))], [`+`(`*`(`/`(1, 3), `*`(`^`(x, 3))), `*`(x, `*`(y)), `*`(`^`(y, 2)...
 

>
 

Part B. 

> f := x^3+3*x*y+2*x^2+x*y^2-x+y+1;
 

Typesetting:-mprintslash([`:=`(f, `+`(`*`(`^`(x, 3)), `*`(3, `*`(x, `*`(y))), `*`(2, `*`(`^`(x, 2))), `*`(x, `*`(`^`(y, 2))), `-`(x), y, 1))], [`+`(`*`(`^`(x, 3)), `*`(3, `*`(x, `*`(y))), `*`(2, `*`(`...
 

>
 

Part C. 

> f := z^4+x^2*y^2+4*y^2*z^2+x^4-10*y^2*x+y*x+x+y+z;
 

Typesetting:-mprintslash([`:=`(f, `+`(`*`(`^`(z, 4)), `*`(`^`(x, 2), `*`(`^`(y, 2))), `*`(4, `*`(`^`(y, 2), `*`(`^`(z, 2)))), `*`(`^`(x, 4)), `-`(`*`(10, `*`(x, `*`(`^`(y, 2))))), `*`(x, `*`(y)), x, y...
 

>
 

Part D. 

For one of the functions in Part A or Part B, try to plot graphs of the function near the critical points to illustrate the behaviour you found. 

It may help to translate the coordinates so the critical point is at the origin.