lecture 17 - wednesday, may 7 - university of washingtonrothvoss/126d... · lecture 17 - wednesday,...

6
Lecture 17 - Wednesday, May 7 MORE ON OPTIMIZATION (§14.7) Example (Midterm II, Lieblich, Spring 2013, Ex 1) For f (x,y) = sin(x ) · cos(y) a) Calulate f x (a, b) and f y (a, b) b) Find all critical points of f and classify them accord- ing to their type (max, min, saddle point) For a), f x (a, b) = cos(a) · cos(b) f y (a, b)= sin(a) · sin(b) Let us first solve b) only for 0 a, b < π . f x (a, b)=0 cos(a) · cos(b)=0 cos(a) = 0 or cos(b)=0 f y (a, b)=0 ⇔− sin(a) · sin(b)=0 sin(a) = 0 or sin(b)=0 Observe: There is no a R where sin(a) = 0 = cos(a). Only options where both derivatives are 0 simultaneuosly are (cos(a) = 0 and sin(b) = 0) or (sin(a) = 0 and cos(b) = 0) (a, b)=( π 2 , 0) or (a, b) = (0, π 2 ) 122

Upload: others

Post on 18-Jun-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 17 - Wednesday, May 7 - University of Washingtonrothvoss/126D... · Lecture 17 - Wednesday, May 7 MORE ON OPTIMIZATION (§14.7)Example (Midterm II, Lieblich, Spring 2013,

Lecture 17 - Wednesday, May 7

MORE ON OPTIMIZATION (§14.7)

Example (Midterm II, Lieblich, Spring 2013, Ex 1)

For f (x, y) = sin(x) · cos(y)

a) Calulate fx(a, b) and fy(a, b)

b) Find all critical points of f and classify them accord-

ing to their type (max, min, saddle point)

For a),

fx(a, b) = cos(a) · cos(b) fy(a, b) = − sin(a) · sin(b)

Let us first solve b) only for 0 ≤ a, b < π.

fx(a, b) = 0⇔ cos(a) · cos(b) = 0⇔ cos(a) = 0 or cos(b) = 0

fy(a, b) = 0⇔ − sin(a) · sin(b) = 0⇔ sin(a) = 0 or sin(b) = 0

Observe: There is no a ∈ R where sin(a) = 0 = cos(a).

Only options where both derivatives are 0 simultaneuosly

are

(cos(a) = 0 and sin(b) = 0) or (sin(a) = 0 and cos(b) = 0)

⇔ (a, b) = (π

2, 0) or (a, b) = (0,

π

2)

122

Page 2: Lecture 17 - Wednesday, May 7 - University of Washingtonrothvoss/126D... · Lecture 17 - Wednesday, May 7 MORE ON OPTIMIZATION (§14.7)Example (Midterm II, Lieblich, Spring 2013,

Example (cont). The 2nd derivatives are

fxx = − sin(x) cos(y) fxy = − cos(x) sin(y) fyy = − sin(x) cos(y)

D(π

2, 0) =

∣∣∣∣∣

− sin(π2 ) cos(0) − cos(π

2 ) sin(0)

− cos(π2 ) sin(0) − sin(π

2 ) cos(0)

∣∣∣∣∣

=

∣∣∣∣∣

−1 0

0 −1

∣∣∣∣∣

= 1

D(0,π

2) =

∣∣∣∣∣

−sin(0) cos(π2 ) − cos(0) sin(π

2 )

− cos(0) sin(π2 ) − sin(0) cos(π

2 )

∣∣∣∣∣

=

∣∣∣∣∣

0 −1

−1 0

∣∣∣∣∣

= −1

⇒ (π2 , 0) is local maximum, (0, π

2 ) is saddle point.

Observation:

f is periodic, i.e. f (x + 2π, y) = f (x, y) = f (x, y + 2π).

Moreover f (x + π, y) = f (x, y + π) = −f (x, y).

• {(π2 + π · s, π · t) : s, t ∈ Z, s + t even} are local maxima

• {(π2 + π · s, π · t) : s, t ∈ Z, s + t odd} are local minima

• {(π · s, π2 + π · t) : s, t ∈ Z} are saddle points

0 π 2π0

π

123

Page 3: Lecture 17 - Wednesday, May 7 - University of Washingtonrothvoss/126D... · Lecture 17 - Wednesday, May 7 MORE ON OPTIMIZATION (§14.7)Example (Midterm II, Lieblich, Spring 2013,

Example (Midterm II, Aut. 2012, Bekyel)

Find the points on the cone given by z2 = x2 + y2

that are closest to the point (4, 2, 0).

Goal: Minimize h(x, y, z) = (x−4)2 +(y−2)2 +z2 over cone.

Idea: Better optimize

f (x, y) = h(x, y, x2 + y2) = (x − 4)2 + (y− 2)2 + x2 + y2

= 2x2 − 8x + 2y2 − 4y + 20

over (x, y) ∈ R2. Take partial derivatives

fx(x, y) = 4x − 8!= 0⇒ x = 2

fy(x, y) = 4y− 4!= 0⇒ y = 1

Hence (x, y) = (2, 1) is a critical point.

fxx = 4, fxy = 0, fyy = 4

Then

D(2, 1) =

∣∣∣∣∣

4 0

0 4

∣∣∣∣∣

= 16 > 0

hence (2, 1) is minimum for f . Hence (2, 1,√

5) and (2, 1,−√

5)

are points on cone that are closest to (4, 2, 0).

Remark:

• Instead of minimizing√

f (x, y), better minimize f (x, y)

124

Page 4: Lecture 17 - Wednesday, May 7 - University of Washingtonrothvoss/126D... · Lecture 17 - Wednesday, May 7 MORE ON OPTIMIZATION (§14.7)Example (Midterm II, Lieblich, Spring 2013,

Example (Midterm II, Spring 2011, Loveless,1b)

Find the absolute maximum and minimum value of

f (x, y) = xy2 + x + 2 over the region

R = {(x, y) : y ≥ 0, x2 + y2 ≤ 8}.

• Step 1: Draw the region R

x

y

√8−

√8

√8

• Step 2: Find critical points in R .

fx = y2 + 1, fy = 2xy

But y2 + 1 > 0⇒ no critical point in the interior of R .

• Step 3: Optimize

g(x) = f (x, 0) = x + 2 for −√

8 ≤ x ≤√

8.

Since g′(x) = 2, the only candidate extrema are the

interval boundaries x = ±√

8 (i.e. (−√

8, 0) and (√

8, 0)).

125

Page 5: Lecture 17 - Wednesday, May 7 - University of Washingtonrothvoss/126D... · Lecture 17 - Wednesday, May 7 MORE ON OPTIMIZATION (§14.7)Example (Midterm II, Lieblich, Spring 2013,

Example (cont)

• Step 4: Optimize f (x, y) over x2 +y2 = 8. Equivalently,

optimize h(x) = x(8− x2) + x + 2 = −x3 + 9x + 2.

h′(x) = −3x2 + 9 = 0⇒ x2 = 3⇒ x = ±√

3.

Candidate points (√

3,√

5) and (−√

3,√

5)

• Step 5: Compare candidates

point value

(−√

8, 0) 2− 2√

2 ≈ −0.828

(√

8, 0) 2 + 2√

2 ≈ 4.828

(−√

3,√

5) 2− 6√

3 ≈ −8.392

(√

3,√

5) 2 + 6√

3 ≈ 12.392

Thus

abs. maximum = 2 + 6√

3, abs. mininum = 2− 6√

3

126

Page 6: Lecture 17 - Wednesday, May 7 - University of Washingtonrothvoss/126D... · Lecture 17 - Wednesday, May 7 MORE ON OPTIMIZATION (§14.7)Example (Midterm II, Lieblich, Spring 2013,

Optimization Summary:

Task: Find and classify critical points of f (x, y).

(1) Find critical points (a, b) with fx(a, b) = 0 = fy(a, b)

(2) Apply 2nd derivative test

D(a, b) =

∣∣∣∣∣

fxx(a, b) fxy(a, b)

fxy(a, b) fyy(a, b)

∣∣∣∣∣

< 0 ⇒ saddle point

> 0 ⇒ fxx(a, b)

< 0 local max

> 0 local min

Task: Maximize f (x, y, z) on some 2D surface z = z(x, y)

(1) Eliminate one variable and write g(x, y) := f (x, y, z(x, y))

(2) Compute gx, gy, find critical points

(3) Classify using 2nd derivative test

Task: Maximize f (x, y) on a region R ⊆ R2

(1) Find critical points of f over R2

(2) Write boundary of R as 1-dim function, say g(x).

(3) Find critical points of g

WARNING: one might need to split boundary into sev-

eral segments

(4) Compare candidates

127