0% found this document useful (0 votes)
36 views21 pages

Theory of Optimization-2

The document discusses the Lagrange Multiplier method in mathematical optimization, which is used to find local maxima or minima of a function subject to equality constraints. It outlines the steps involved in applying the method, provides examples of optimization problems, and demonstrates how to derive solutions using the Lagrangian function. Additionally, it touches on multiple constraint optimization and includes specific examples with detailed calculations.

Uploaded by

nasira9545
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views21 pages

Theory of Optimization-2

The document discusses the Lagrange Multiplier method in mathematical optimization, which is used to find local maxima or minima of a function subject to equality constraints. It outlines the steps involved in applying the method, provides examples of optimization problems, and demonstrates how to derive solutions using the Lagrangian function. Additionally, it touches on multiple constraint optimization and includes specific examples with detailed calculations.

Uploaded by

nasira9545
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

GOVT COLLEGE WOMEN UNIVERSITY FAISALABAD

SUBMITTED TO:-
Mam Hira Khalid
SUBMITTED BY:-
Group 8
Anam Shehnaz (08)
Aresha Abid (13)
Ifra Safdar (27)
Momina javed (50)
Nasira Batool (51)
Tehreem Fatima (60)
Zunaira Ilyas (65)
COURSE TITLE:-
Theory of Optimization
COURSE CODE:-
MTH - 465
TOPIC:-
Lagrange Multiplier
DEPARTMENT:-
BS Mathematics
SECTION:-
8th ( MA )

Lagrange Multiplier Method


(applicable on equality constraints)

In mathematical optimization the method of Lagrange multiplier


named after Joseph- Louis Lagrange.

The Lagrange Multiplier method is a technique used to find the local


maxima or local minima of a function subject to the equality
constraint i.e subject to the condition that one or more equations have
to be satisfied exactly by the choosen value of the variables.

The method of Lagrange Multiplier is widely used to solve


challenging constraint optimization.

The method can be summarized as follows:

I. Formulate the Lagrange function


II. Find partial derivative of L with respect to x, y and λ and putting
them equal to zero
III. Solve for x,y and λ
IV. writing the Stationary points (x,y, λ)
V. Putting the Stationary points in function and observe that
whether our function is local maxima or minima or saddle points
VI. Check that the solution satisfies the constraint g(x) = 0
Single Constraint:-

For case of only one constraint with two variables, consider the
optimization problem

Max f(x,y) subject to g(x,y) = 0


We assume that both f and g have fist order partial derivatives we
introduce a new variable called Lagrange multiplier and study the
Lagrangeian function or Lagrangeian expression defined by

L(x,y, λ ) = f(x.y) – λ g(x,y)

And ∇ L(x,y, λ ) = 0

⇒ ∇ x , yf(x,y) = λ ∇ x, y g(x,y)

and g(x,y) = 0

Question 1:-

Max f(x,y) = x +¿ y subject to x 2 +¿ y


2
=1

Find local maxima or minima by Lagrangeian method .

Solution:-

f(x,y) = x +¿ y

g(x,y) = x 2 +¿ y −¿
2
1

Lagrangian function is

L(x,y, λ ) = f(x.y) – λ g(x,y)

L(x,y, λ ) = x +¿ y – λ ¿ +¿ y 2−¿ 1)

∂L ∂L ∂L
∂x
= 1 – 2 λx , ∂y
= 1 – 2 λy , ∂λ
= – ¿ +¿ y −¿
2
1)

Now ,
= 0 ⇒ ⇒ x=
∂L 1
∂x 1 – 2 λx = 0 2λ ……(1 ¿

= 0 ⇒ ⇒ y=
∂L 1
∂y 1 – 2 λy = 0 2λ ……(2 ¿

∂L
∂y
= 0⇒ 2 2
x +¿ y −¿ 1 = 0 ….(3)

Put (1) and (2) in (3)

1 1

2 + 4λ
2 =1

= 0 ⇒ 2 −4 λ2 = 0
2
1+ 1−4 λ
2

⇒ λ = ± √2
1 1
λ =
2
2

⇒ x = √2 , y = √2
+1 2 2
When λ = √2

⇒ x =−¿ √2 , y =−¿ √2
−1 2 2
When λ = √ 2

Which implies stationary points are

( √2 , √2 , √2 ) and (−¿ √2 , 2√ , √ 2 )
2 2 1 2 − 2 −1

Now f ( √2 , √2 ) = √2 + √2 = √ 2
2 2 2 2

f (−¿ √2 , 2√ ) = 2√ − √2 =−√ 2
2 − 2 − 2 2

The constraint maxima is √ 2 at point ( √2 , √2 ) and minimum is −√ 2


2 2

at point (−¿ √2 , 2√ ).
2 − 2
Question 2:-

Max f(x,y) = x 2 y subject to x 2 +¿ y


2
=3

Find local maxima or minima by Lagrangeian method .

Solution:-

f(x,y) = x 2 y

g(x,y) = x 2 +¿ 2
y −¿ 3

Lagrangian function is

L(x,y, λ ) = f(x.y) – λ g(x,y)

L(x,y, λ ) = x Type equation here . y – λ ¿ +¿ y 2−¿ 3)

∂L ∂L ∂L
∂x
= 2xy – 2 λx , ∂y
= x 2 – 2 λy , ∂λ
= – ¿ +¿ 2
y −¿ 3)

Now ,

= 0 ⇒ 2xy – 2 λx = 0
∂L
∂x ……(1 ¿

= 0 ⇒
∂L
∂y
2
x – 2 λy =0 ……(2 ¿

∂L
∂y
= 0⇒ 2 2
x +¿ y −¿ 3 = 0 ….(3)

From (1) 2x(y – λ ¿ = 0

⇒ x = 0 , y – λ=0 ⇒ x = 0, y = λ

Put x = 0 in (2)
0 – 2 λy = 0 ⇒ y = 0 or λ=0

Put x = 0 in (3)

0+¿ y 2−¿ 3 = 0 ⇒ y 2=¿3 ⇒ y = ± √3

⇒ (0,√ 3 , 0 ¿ and (0,−√ 3 , 0 ¿

Put y = λ in (2)
2
x – 2 λ( λ) =0 ⇒ 2
x =2 λ
2
⇒ x = √2 λ

Put x = √ 2 λ and y = λ in (3)

+( λ )2 = 3 ⇒
2
(√ 2 λ) 3λ
2
=3

⇒ λ
2
=1 ⇒ λ=± 1

Which implies Stationary points are

(0,√ 3 , 0 ¿ , (0,−√ 3 , 0 ¿ , (√ 2 ,1 , 1¿ and (−√ 2 ,−1 ,−1 ¿

Now

f (0,√ 3 ¿= ¿ =0

f (0,−√ 3 ¿= ¿ ) = 0

f (√ 2 ,1 , ¿= ¿ = 2

f (−√ 2 ,1 , ¿= ¿ = 2

The constraint have Saddle point at (0,√ 3 ¿ and (0,−√ 3 ¿

And local maxima 2 at (√ 2 ,1 , ¿ and local minima at (−√ 2 ,1 , ¿.


Question 3:-
Max f(x,y) = xy subject to 3 x 2+ y 2=6
Find local maxima or minima by Lagrange multiplier method.
Solution:
f (x,y) = xy

g (x,y) = 3 x 2+ y 2−¿ 6

Lagrangeian function is

L(x,y, λ ) = f(x.y) – λ g(x,y)

L(x,y, λ ) = xy – λ ¿ +¿ y 2−¿ 6)

∂L ∂L ∂L
∂x
= y – 6 λx , ∂y
= x – 2 λy , ∂λ
= – ¿ +¿ 2
y −¿ 6)

Now ,

= 0 ⇒ y – 6 λx = 0
∂L
∂x ……(1 ¿

= 0 ⇒
∂L
∂y
x – 2 λy =0 ……(2 ¿

∂L
∂y
= 0⇒ 2 2
3 x +¿ y −¿ 6 = 0 ….(3)

From (1) y ¿ 6 λx

put y ¿ 6 λx in (2)

x – 2 λ ¿) =0 ⇒ 2
x−12 λ x=0
⇒ x (1−12 λ )=0
2

⇒ x=0 , 1−12 λ =0
2

⇒ ⇒ λ2 =
1
x=0 , 1=12 λ
2
12


1 1
λ = √12 = 2 √3

put y ¿ 6 λx in (3)
2 2
3 x +¿ (6 λx ) −¿ 6=0
2
3 x +36 λ x
2 2
=6

1
Putting λ
2
= 12

=6 ⇒
1 2
3 x +36 (
2
12
)x 2
3 x +¿ 3 x
2
=6

⇒ 6 x =6
2
⇒ 2
x =1 ⇒ x=± 1

When x=0 ⇒ y=0

When ¿ 1 , λ = 2 √3 ⇒
1 1 3
y=6.
2 √3
(1) = √3

When ¿−1 , λ = 2 √3 ⇒
1 1 −3
y=6. (−1) = √3
2 √3

Which implies stationary points are


1 3 1 3 1
(0,0, 2 √3 ), (1, √3 , 2 √3 )and (−1 ,− √ 3 , 2 √3 )

f (0,0) = 0
3 3 3
f (1, √3 ¿=¿ (1 ¿( √3 )=¿ √3
−3 −3 3
f (−1, √ 3 ¿=¿ (−1 ¿( √ 3 )=¿ √3
3
The constraint has saddle point at (0,0) and local maxima √3 at both
3 −3
(1 , ) and (−1, ¿
√3 √3
Question 4:-
Maximize the function f(x, y) = xy subject to the constraint
x + y = 10.
Lagrangian Function is
L(x, y, λ) = xy – λ(x + y – 10)
Partial Derivatives
∂L/∂x = y – λ
∂L/∂y = x – λ
∂L/∂λ = -(x + y – 10)
System of Equations
Y – λ = 0 … (1)
X – λ = 0 … (2)
X + y – 10 = 0 … (3)
Solve the System

From (1) and (2): y = λ and x = λ ⇒ x = y


Substitute into (3):

X + x = 10 ⇒ 2x = 10 ⇒ x = 5 ⇒ y = 5

Value of λ
λ = x = 5 or λ = y = 5
Maximum Value
F(x, y) = xy = 5 × 5 = 25
Thus , Maximum value is 25 at point (5, 5)

Multiple Constraint Optimization:-


In this method, we use multiple constraints and multiple variables.
Consider the optimization problem

Max f(x₁, x₂, x₃, …, xn) = 0

Subject to: gᵢ(x₁, x₂, x₃, …, xn) = 0

Where f (x₁, x₂, x₃, …, xn) is deal only for máximum . If our question
demand is in minimum. Then we convert it into minimization
problem to maximization problem.
After this, we use following steps:
1.Write the Lagrangian expression.

L(x₁, x₂, …, xn, λᵢ) = f(x₁, x₂, …, xn) – Σᵢn₌₁ λᵢgᵢ(x₁, x₂, …, xn)
2.After this, we find partial derivatives

Of L w.r.t x₁, x₂, …, xn and λᵢ. Where I = 1, 2, 3, …, n.


3.After this, we put

∂L/∂x₁ = 0, ∂L/∂x₂ = 0, …, ∂L/∂ xn = 0

∂L/∂λ₁ = 0, ∂L/∂λ₂ = 0, …, ∂L/∂λn = 0

And then here we finding the points of x₁, x₂ , …, xn and

λ₁,λ₂, …, λn

4.Write the stationary points in the sense of x₁, x₂, …, xn and λ₁, λ₂,
…, λn
i.e. (x₁, x₂, …, xn, λ₁, λ₂, …, λn)
5.After this, we putting theStationary points in given function.
We observe that our given function is local maxima or
local minima or saddle points.
Question 1:-
Maximize f(x, y, z) = xyz2 subject to x + y + z = 6 and x + y = 4.
Solution :-
f(x, y, z) = xyz2
g1 (x, y, z) = x + y+ z - 6
g2 (x, y, z) = x + y - 4
Step 1: Form the Lagrangian function
L(x, y, z, λ1, λ2) = f(x, y, z) - λ1g1 (x, y, z) – λ2 g2 (x, y, z)
L(x, y, z, λ1, λ2) = xyz2 – λ1(x + y + z – 6) – λ2(x + y – 4)
Step 2: Find the partial derivatives
∂L/∂x = yz2 – λ1 – λ2 = 0 ……………….. (1)
∂L/∂y = xz2 – λ1 – λ2 = 0 ……………….… (2)
∂L/∂z = 2xyz – λ1 = 0 …………………….. (3)
∂L/∂λ1 = x + y + z – 6 = 0 …………………. (4)
∂L/∂λ2 = x + y – 4 = 0 ….…………………..(5)
Step 3: Solve the system of equations
From (5), we get x + y = 4.
Substituting x + y = 4 into (4), we get:
4+z=6 ⇒ z=2
From (1) and (2), we get:
yz2 – λ1 – λ2 = 0
xz2 – λ1 – λ2 = 0
Subtracting the two equations, we get:
yz2 – xz2 = 0
z2(y – x) = 0
Since z = 2, we get:

y– x = 0 ⇒ y=x
Substituting y = x into x + y = 4, we get:

x + x = 4 ⇒ 2x = 4 ⇒ x = 2
and y= 2
Step 4: Find λ1 and λ2
From (3), we get:

2xyz = λ1 ⇒ λ1 = 2(2)(2)(2) = 16
From (1), we get:
yz2 = λ1 + λ2
(2)(2)2= 16 + λ2

8 = 16 + λ 2 ⇒ λ 2=−8

Required stationary points are (2, 2, 2 16, -8).


Step 5: Find the maximum value
Now that we have the values of x, y, and z, we can find the maximum
value of F(x, y, z):
F(x, y, z) = xyz2
= (2)(2)(2)2 = (2)(2)(4) = 16
The maximum value of f (x, y, z) is 16.
The values x = 2, y = 2, and z = 2 maximize the function f(x, y, z) =
xyz2 subject to the given constraints.
Question 2:-
Maximize f(x, y, z) = x + 2y2+ 3z subject to x + y + z = 5 and
x + y = 3.
Solution :-
f(x, y, z) = x + 2y2+ 3z
g1 (x, y, z) = x+ y + z – 5
g2 (x, y, z) = x+ y- 3
Step 1: Form the Lagrangian function
L(x, y, z, λ1, λ2) = f(x, y, z) - λ1 g1 (x, y, z) – λ2 g2 (x, y, z)
L(x, y, z, λ1, λ2) = x + 2y2 + 3z – λ1(x + y + z – 5) – λ2(x + y – 3)
Step 2: Find the partial derivatives
∂L/∂x = 1 – λ1 – λ2 = 0 ………………….. (1)
∂L/∂y = 4y – λ1 – λ2 = 0 …………………. (2)
∂L/∂z = 3 – λ1 = 0 ………………………. (3)
∂L/∂λ1 = x + y + z – 5 = 0 …………….… (4)
∂L/∂λ2 = x + y – 3 = 0 …………………….. (5)
Step 3: Solve the system of equations
From (3), we get λ1 = 3.
Substituting λ2 into (1) and (2), we get:

1 – 3 – λ2 = 0 ⇒ λ2 = -2
4y – 3 – λ2 = 0
4y – 3 + 2 = 0

4y = 1 ⇒ y = ¼
From (5), we get x + y = 3.
x+ ¼ = 3
x = 11/4
From (4), we get x + y + z = 5.
11/4 + ¼ + z = 5
12/4 + z = 5

3+z=5⇒ z=2
Required stationary points are (11/4, ¼ , 2, 3, -2).
Step 4: Find the maximum value
Now that we have the values of x, y, and z, we can find the maximum
value of f(x, y, z):
F(x, y, z) = x + 2y2 + 3z
= 11/4 + 2(1/4)2 + 3(2)
= 11/4 + 2(1/16) + 6
= 11/4 + 1/8 + 6
= 22/8 + 1/8 + 48/8
= 71/8
The maximum value of f(x, y, z) is 71/8 = 8.875.
Question 3:-
Maximize f(x, y, z) = 3x + y + 2z subject to x + y + z = 4 and
x + z = 3.
Solution :-
f(x, y, z) = 3x + y + 2z
g1 (x, y, z) = x + y + z -4
g2 (x, y, z ) = x + z -3
Step 1: Form the Lagrangeian function
L(x, y, z, λ1, λ2) = f(x, y, z) - λ1 g1 (x, y, z) – λ2 g2 (x, y, z)
L(x, y, z, λ1, λ2) = 3x + y + 2z – λ1(x + y + z – 4) – λ2(x + z – 3)
Step 2: Find the partial derivatives
∂L/∂x = 3 – λ1 – λ2 = 0 ………….. (1)
∂L/∂y = 1 – λ1 = 0 ………………… (2)
∂L/∂z = 2 – λ1 – λ2 = 0 …………… (3)
∂L/∂λ1 = x + y + z – 4 = 0 … ………..(4)
∂L/∂λ2 = x + z – 3 = 0 ………………. (5)
Step 3: Solve the system of equations
From (2), we get. λ 1 = 1.
Substituting λ1 into (1) and (3), we get:

3 – 1 – λ2 = 0 ⇒ λ2 = 2
2 – 1 – λ2 = 0 ⇒ λ2 = 1
However, λ2 has two different values, which indicates an
inconsistency.
From (5), we get z = 3 – x.
Substituting z into (4), we get:
x+y+3–x=4
y=1
Now, substituting y into (4), we get:

x+1+z=4 ⇒ x +z=3
This is consistent with (5). Let’s solve for x and z.
From (5), we get z = 3 – x.
Let’s choose x = 1
Then z = 2
Step 4: Verify the solution
x+ y + z = 1 + 1 + 2 = 4 (satisfies the constraint)
x + z = 1 + 2 = 3 (satisfies the constraint)
Step 5: Find the maximum value
Now that we have the values of x, y, and z, we can find the maximum
value of f(x, y, z):
F(x, y, z) = 3x + y + 2z
= 3(1) + 1 + 2(2)
=3+1+4 =8
The maximum value of f (x, y, z) is 8.
Question 4:-
Maximize the function
f(x, y) = sin(x) + cos(y)
subject to the constraints
x + y = π/2
x−y=0
Solution:-
Step 1: Lagrangian Function
Let

L(x, y, λ₁, λ₂) = sin(x) + cos(y) − λ₁(x + y − π/2) − λ₂(x − y)


Step 2: Partial Derivatives

∂L/∂x = cos(x) − λ₁ − λ₂ = 0 ...(1)

∂L/∂y = −sin(y) − λ₁ + λ₂ = 0 ...(2)

∂L/∂λ₁ = x + y − π/2 = 0 ...(3)

∂L/∂λ₂ = x − y = 0 ...(4)

Step 3: Solve the System


From equation (4): x=y

Substitute into (3): x + x = π/2 ⇒ 2x = π/2 ⇒ x = π/4


Then: y = π/4
Now substitute into (1):
cos(π/4) − λ₁ − λ₂ = 0 ⇒ √2/2 − λ₁ − λ₂ = 0 ...(5)
From (2):

−sin(π/4) − λ₁ + λ₂ = 0 ⇒ −√2/2 − λ₁ + λ₂ = 0 ...(6)


Solving (5) and (6):
Add (5) and (6):

√2/2 − λ₁ − λ₂ − √2/2 − λ₁ + λ₂ = 0

⇒ −2λ₁ = 0 ⇒ λ₁ = 0

Then from (5) √2/2 − λ₂ = 0 ⇒ λ₂ = √2/2


Step 4:- Maximum Value
f(x, y) = sin(π/4) + cos(π/4) = √2/2 + √2/2 = √2
Thus ,the maximum value is √2, which occurs at the point (π/4, π/4)
Question 5 :-
Maximize the function
f(x, y) = x·eʸ
subject to the constraints:
x+y=1
x−y=0

Solution:-
Step 1: Lagrangian Function

L(x, y, λ₁, λ₂) = x·eʸ − λ₁(x + y − 1) − λ₂(x − y)


Step 2: Partial Derivatives
∂L/∂x = eʸ − λ₁ − λ₂ = 0 ...(1)

∂L/∂y = x·eʸ − λ₁ + λ₂ = 0 ...(2)

∂L/∂λ₁ = x + y − 1 = 0 ...(3)

∂L/∂λ₂ = x − y = 0 ...(4)
Step 3: Solve the System
From (4): x = y
Substitute into (3):

x + x = 1 ⇒ 2x = 1 ⇒ x = 2 , y =
1 1
2

Now substitute into (1):


1
e 2 − λ₁ − λ₂ = 0 ...(5)
From (2):
1
1 2
2
e − λ₁ + λ₂ = 0 ...(6)

Add (5) and (6):


3 1
·2
2 e
− 2λ₁ = 0 → λ₁ = 32 ·e 1
2

Then from (5):


1 1 1
λ₂ = e − λ₁ = 4 ·e
2 2

Step 4: Maximum Value


1 1
f(x, y) = x·eʸ = 2 ·e 2

1
( 12 , 12 )
1
Thus , the maximum value is 2 ·e 2 at the point
Practice Questions
Single Constraints problems
1. Find the maximum and minimum of f(x, y) = xy subject to
4x² + 9y² = 36.
2. Maximize f(x, y, z) = x + y + z subject to x² + y² + z² = 1.
3. Maximize f(x, y) = ln(x) + ln(y)
Subject to: x + y = 10
4. Minimize f(x, y) = sin(x) + cos(y)
Subject to: x² + y² = 1
5. Maximize f(x, y) = eˣ + eʸ
Subject to: x + 2y = 5
.
Multiple Constraints problems
6. Maximize f(x, y, z) = x·y·z
Subject to x+y+z=6 and x² + y² + z² = 14
7.Minimize f(x, y) = x² + 4y²
Subject to x+y=3 and x − 2y = 1

REFERENCES
 https://youtu.be/RYOBs5kKndE?si=h1GD73Z3F3oXhBlC
 https://youtu.be/9Q9HzpsH2pQ?si=5LZeuGjDARn85H03
 https://youtu.be/20DgYM5UYFY?si=vprXC7Ix0OQVlBWh
 https://youtu.be/iPxF9N-QVz4?si=u_17Nuqt-rneOQYo
 https://www.mathcity.org/_media/notes/theory-of-optimization-
muzammil-tanveer.pdf

You might also like