# use lagrange multipliers to find the max and min subject to given constrain.?

1.f(x,y)=x^2+y^2;xy=1

2.f(x,y)=x^2+y^2;2x^2+2xy+3y^2=1

3.f(x,y)=(x^2)y;x^2+2y^2=6

4.f(x,y,z)=x^2+y^2+z^2;x-y=1,y^2-z^2=1

### 1 個解答

• 最佳解答

20160529

1. f(x,y) = x² + y²；xy = 1

Let g(x,y) = xy - 1 = 0

∇f = (2x,2y)

∇g = (y,x)

(2x,2y) = λ(y,x)

{ 2x = λy ...... ①

{ 2y = λx ...... ②

{ xy = 1 ...... ③

x ① - y ②：(x - y)(x + y) = 0，x = y or x = -y

If x = y, x² = 1, x = ±1

If x = -y. x² = -1, no solutions

f(1,1) = 2

f(-1,-1) = 2

The min = f(1,1) = f(-1,-1) = 2

Let y = 1/x

As x→∞, f(x,y)→∞

The max does not exist.

🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘

2. f(x,y) = x² + y²；2x² + 2xy + 3y² = 1

Let g(x,y) = 2x² + 2xy + 3y² - 1 = 0

∇f = (2x,2y)

∇g = (4x + 2y,2x + 6y)

(2x,2y) = λ(4x + 2y,2x + 6y)

{ 2x = λ(4x + 2y) ...... ①

{ 2y = λ(2x + 6y) ...... ②

{ 2x² + 2xy + 3y² = 1 ...... ③

y ① - x ②：λ(2y² - 2x² - 2xy) = 0，λ(5y² - 1) = 0，λ = 0 or y = ±1/√5

If λ = 0, x = y = 0, 2x² + 2xy + 3y² ≠ 1, no solutions

If y = 1/√5, 2x² + 2x/√5 + 3(1/√5)² = 1, x = (-1/√5 ± 1)/2

If y = -1/√5, 2x² - 2x/√5 + 3(1/√5)² = 1, x = (1/√5 ± 1)/2

f( (-1/√5 + 1)/2,1/√5 ) = 1/2 - 1/(2√5)

f( (-1/√5 - 1)/2,1/√5 ) = 1/2 + 1/(2√5)

f( (1/√5 + 1)/2,-1/√5 ) = 1/2 + 1/(2√5)

f( (1/√5 - 1)/2,-1/√5 ) = 1/2 - 1/(2√5)

The min = f( (-1/√5 + 1)/2,1/√5 ) = f( (1/√5 - 1)/2,-1/√5 ) = 1/2 - 1/(2√5)

The max = f( (-1/√5 - 1)/2,1/√5 ) = f( (1/√5 + 1)/2,-1/√5 ) = 1/2 + 1/(2√5)

🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘

3. f(x,y) = x²y；x² + 2y² = 6

Let g(x,y) = x² + 2y² - 6 = 0

∇f = (2xy,x²)

∇g = (2x,4y)

(2xy,x²) = λ(2x,4y)

{ 2xy = 2λx ...... ①

{ x² = 4λy ...... ②

{ x² + 2y² = 6 ...... ③

2y ① - x ②：x(2y - x)(2y + x) = 0，x = 0 or x = 2y or x = -2y

If x = 0，y = ±√3

If x = 2y，y = 1 and x = 2　　　or　　　y = -1 and x = -2

If x = -2y，y = 1 and x = -2　　　or　　　y = -1 and x = 2

f(0,±√3) = 0

f(2,1) = 4

f(-2,-1) = -4

f(-2,1) = 4

f(2,-1) = -4

The min = f(-2,-1) = f(2,-1) = -4

The max = f(2,1) = f(-2,1) = 4

🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘

4. f(x,y,z) = x² + y² + z²；x - y = 1, y² - z² = 1

Let g(x,y) = x - y - 1 = 0 and h(x,y,z) = y² - z² - 1

∇f = (2x,2y,2z)

∇g = (1,-1,0)

∇h = (0,2y,-2z)

(2x,2y,2z) = λ(1,-1,0) + μ(0,2y,-2z)

{ 2x = λ ...... ①

{ 2y = -λ + 2μy ...... ②

{ 2z = -2μz ...... ③

{ x - y = 1 ...... ④

{ y² - z² = 1 ...... ⑤

From ③, z = 0 or μ = -1

If z = 0, y = 1 and x = 2　　　or　　　y = -1 and x = 0

If μ = -1,

{ 2x = λ

{ 4y = -λ

x = -2y，y = -1/3，x = 2/3，z² = -8/9 < 0, no solutions

f(2,1,0) = 5

f(0,-1,0) = 1

The min = f(0,-1,0) = 1

Let y = x - 1 and z = √(y² - 1)

As x→∞, f(x,y,z)→∞

The max does not exist

🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘

Lagrange Multipliers with one constraint

Suppose f(x,y) and g(x,y) are differentiable and ∇g ≠ 0 when g(x,y) = 0

The local maximum and local minimum point of f(x,y) (if exist) subject to the constraint g(x,y) = 0 are satisfied the equations

{ ∇f = λ∇g

{ g(x,y) = 0

For the function of three independent variables, the condition is similar.

🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘

Lagrange Multipliers with two constraints

Suppose f(x,y,z), g(x,y,z), h(x,y,z) are differentiable and ∇g is not parpallel to ∇h when g(x,y,z) = 0 and h(x,y,z) = 0

The local maximum and local minimum point of f(x,y,z) (if exist) subject to the constraints g(x,y,z) = 0 and h(x,y,z) = 0 are satisfied the equations

{ ∇f = λ∇g + μ∇h

{ g(x,y,z) = 0

{ h(x,y,z) = 0

🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘🔘

相片：

我們發生某些問題，請再試一次。
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://tw.answers.yahoo.com/question/index?qid=20160528200853AAa9tWD", "fetch_time": 1597195777000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2020-34/segments/1596439738858.45/warc/CC-MAIN-20200811235207-20200812025207-00112.warc.gz", "warc_record_offset": 515990711, "warc_record_length": 28814, "token_count": 2752, "char_count": 3539, "score": 4.21875, "int_score": 4, "crawl": "CC-MAIN-2020-34", "snapshot_type": "latest", "language": "en", "language_score": 0.3262379765510559, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00016-of-00064.parquet"}