Ans

Math 2401  Quiz #3   March  9 Tom Morley

Problem 1 (9 points)

George Mallory needs to know the following :  Using Largrange multipliers solve : Max (5 x^2 + 6 xy + 5y^2) Subject to : x^2 + y^2 = 1.

Ans

f[x_, y_] := 5 x^2 + 6 x y + 5y^2

g[x_, y_] := x^2 + y^2   - 1

gradf = {D[f[x, y], x] , D[f[x, y], y] }

{10 x + 6 y, 6 x + 10 y}

gradg = {D[g[x, y], x] , D[g[x, y], y] }

General :: spell1 : Possible spelling error: new symbol name \"gradg\" is similar to existing symbol \"gradf\".  More…

{2 x, 2 y}

Thread[gradf == λ gradg]

{10 x + 6 y == 2 x λ, 6 x + 10 y == 2 y λ}

Solve[Flatten[{Thread[gradf == λ  gradg], g[x, y] == 0}], {x, y, λ}]

This is an eigenvalue problem

f[x, y] /. {λ→2, x→ -1/2^(1/2), y→1/2^(1/2)}

2

f[x, y] /. {λ→2, x→1/2^(1/2), y→ -1/2^(1/2)}

2

f[x, y] /.{λ→8, x→1/2^(1/2), y→1/2^(1/2)}

8

f[x, y] /. {λ→8, x→ -1/2^(1/2), y→ -1/2^(1/2)}

8

Max is 8. Maximixer is x = 1/2^(1/2), y = 1/2^(1/2) or x = -1/2^(1/2), y = -1/2^(1/2)

Problem 2 (10 points)

For each of the given functions g, find an f such that ∇f = g, or show that no such f exists.
a) g = -2 x y Sin[x y],-x^2 Sin[x^2 y]
b) g = -2 x y z Sin[x^2 y z]  i  + (z Cos[y z] - x^2 z Sin[x^2 y z]) j  + (y Cos[y z] - x^2 y Sin[x^2 y z] k

Ans

Clear[f, g, x, y, z]

g = { -2 x y Sin[x y], -x^2 Sin[x^2 y]}

{-2 x y Sin[x y], -x^2 Sin[x^2 y]}

D[g[[1]], y]

-2 x^2 y Cos[x y] - 2 x Sin[x y]

D[g[[2]], x]

-2 x^3 y Cos[x^2 y] - 2 x Sin[x^2 y]

Therefore g is not the gradient of anything

f := Cos[x^2 y z ] + Sin[y z]

gradf = {D[f, x], D[f, y], D[f, z]}

{-2 x y z Sin[x^2 y z], z Cos[y z] - x^2 z Sin[x^2 y z], y Cos[y z] - x^2 y Sin[x^2 y z]}

So f = Cos[x^2 y z ] + Sin[y z]

Problem 3 (9 points)

Find the max of    xy/((x - 2) (y + 2) )   subject to   -1   ≤ x,1, -1 ≤  y ≤ 1.

Ans

Plot3D[x y/((x - 2) (y + 2)), {x, -1, 1}, {y, -1, 1}, PlotRange → All]

[Graphics:HTMLFiles/index_65.gif]

-SurfaceGraphics -

Actually, we can see that the max is on the corner

Clear[f]

f[x_, y_]    = x y/((x - 2) (y + 2))

(x y)/((-2 + x) (2 + y))

gradf = {D[f[x, y], x], D[f[x, y], y]}

{y/((-2 + x) (2 + y)) - (x y)/((-2 + x)^2 (2 + y)), -(x y)/((-2 + x) (2 + y)^2) + x/((-2 + x) (2 + y))}

Solve[Thread[gradf == 0], {x, y}]

{{x→0, y→0}}

The only critical point is x = 0, y = 0.

Now sonsider the sides :

D[f[1, y], y]

y/(2 + y)^2 - 1/(2 + y)

Solve[% == 0, y]

{}

D[f[-1, y], y]

-y/(3 (2 + y)^2) + 1/(3 (2 + y))

Solve[% == 0, y]

{}

D[f[x, -1], x]

-1/(-2 + x) + x/(-2 + x)^2

Solve[% == 0, x]

{}

D[f[x, 1], x]

1/(3 (-2 + x)) - x/(3 (-2 + x)^2)

Solve[% == 0, x]

{}

So now try the corners

f[-1, -1]

-1/3

f[-1, 1]

1/9

f[1, -1]

1

f[1, 1]

-1/3

f[0, 0]

0

Max is 1, at the corner


Created by Mathematica  (March 6, 2007) Valid XHTML 1.1!