0% found this document useful (0 votes)
14 views

4. Optimization for Two Variables and Its Applications

Uploaded by

aliasadarifwala2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

4. Optimization for Two Variables and Its Applications

Uploaded by

aliasadarifwala2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Topics:

• Critical Points
• Second Derivative Test (D-Test) and Optimization
• Applications of Optimization
----------------------------------------------------------------------
Critical Points
• A critical point is a point on the graph where the slope changes direction,
or where the first derivative of a function is zero or undefined.
• For functions of two or more variables, the concept is essentially the same,
except for the fact that we are now working with partial derivatives.

Definition: Critical Point for Function of Two Variables

Let 𝒛 = 𝒇(𝒙, 𝒚) be a function of two variables that is defined on an interval


containing the point (𝒙𝟎 , 𝒚𝟎 ). The point is called a critical point of a function of
two variables if one of the two following conditions holds:

1. 𝒇𝒙 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎 and 𝒇𝒚 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎


OR
2. Either 𝒇𝒙 (𝒙𝟎 , 𝒚𝟎 ) or 𝒇𝒚 (𝒙𝟎 , 𝒚𝟎 ) is undefined.
Example
Second Derivative Test for Two Variables (D-Test)
Let 𝒛 = 𝒇(𝒙, 𝒚) be a function of two variables for which the first- and second-order
partial derivatives are continuous on some interval containing the critical point(s),
(𝒙𝟎 , 𝒚𝟎 ).
We know that at (𝑥0 , 𝑦0 ),

𝒇𝒙 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎 and 𝒇𝒚 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎.


We define the D-test as,
𝟐
𝑫 = 𝒇𝒙𝒙 (𝒙𝟎 , 𝒚𝟎 ) 𝒇𝒚𝒚 (𝒙𝟎 , 𝒚𝟎 ) − [ 𝒇𝒙𝒚 (𝒙𝟎 , 𝒚𝟎 ) ]

then:
1) If 𝑫 > 𝟎 and 𝒇𝒙𝒙 (𝒙𝟎 , 𝒚𝟎 ) > 𝟎, then 𝒇(𝒙, 𝒚) has a local minima or
relative minima at (𝒙𝟎 , 𝒚𝟎 ).
2) If 𝑫 > 𝟎 and 𝒇𝒙𝒙 (𝒙𝟎 , 𝒚𝟎 ) < 𝟎, then 𝒇(𝒙, 𝒚) has a local maxima or
relative maxima at (𝒙𝟎 , 𝒚𝟎 ).
3) If 𝑫 < 𝟎, then 𝒇(𝒙, 𝒚) has a saddle point (neither maximum nor
minimum) at (𝒙𝟎 , 𝒚𝟎 ).
4) If 𝑫 = 𝟎, then test is inconclusive. (Test Fails)
Example
OPTIMIZATION
To optimize a function means to find the largest or smallest value of the function.

If the function represents profit, we may want to find the conditions that maximize
profit. On the other hand, if the function represents cost, we may we may want to
find the conditions that minimize cost.

For the procedure of optimization we will follow the following steps in calculation:

1. Find 2nd order Derivatives of the given function.


2. Find Critical Points
3. Apply 2nd Derivative Test (D-Test) for each critical point.
4. Conclusion

Recall: Second Derivative Test for Functions of Two Variables


Suppose (𝑥𝑜 , 𝑦𝑜 ) is a critical point where 𝑓𝑥 (𝑥𝑜 , 𝑦𝑜 ) = 𝑓𝑦 (𝑥𝑜 , 𝑦𝑜 ) = 0.

Let
𝟐
𝑫 = 𝒇𝒙𝒙 (𝒙𝒐 , 𝒚𝒐 )𝒇𝒚𝒚 (𝒙𝒐 , 𝒚𝒐 ) − (𝒇𝒙𝒚 (𝒙𝒐 , 𝒚𝒐 ))

• If 𝑫 > 0 & 𝒇𝒙𝒙 (𝒙𝒐 , 𝒚𝒐 ) > 0, then f has a local minima at (𝒙𝒐 , 𝒚𝒐 ).
• If 𝑫 > 0 & 𝒇𝒙𝒙 (𝒙𝒐 , 𝒚𝒐 ) < 0, then f has a local maxima at
(𝒙𝒐 , 𝒚𝒐 ).
• If 𝑫 < 0 then 𝒇 has neither maxima nor minima at (𝒙𝒐 , 𝒚𝒐 ). It is
saddle point.
• If 𝑫 = 𝟎 then test is inconclusive. (Test fails).
Example 1:
Optimize the given function by determining if it has a local maxima,
local minima or neither.

𝒇(𝒙, 𝒚) = 𝒙𝟐 − 𝟐𝒙 + 𝒚𝟐 − 𝟒𝒚 + 𝟓
Solution:
The given function is

𝑓(𝑥, 𝑦) = 𝑥 2 − 2𝑥 + 𝑦 2 − 4𝑦 + 5
𝝏𝒇
Find
𝝏𝒙

Partially differentiate 𝒇(𝒙, 𝒚) w.r.t variable 𝒙, we have


𝝏𝒇 𝝏
𝒇𝒙 (𝒙, 𝒚) = = (𝒙𝟐 − 𝟐𝒙 + 𝒚𝟐 − 𝟒𝒚 + 𝟓)
𝝏𝒙 𝝏𝒙

𝝏𝒇 𝝏 𝟐 𝝏 𝝏 𝟐 𝝏 𝝏
𝒇𝒙 (𝒙, 𝒚) = = (𝒙 ) − (𝟐𝒙) + (𝒚 ) − (𝟒𝒚) + (𝟓)
𝝏𝒙 𝝏𝒙 𝝏𝒙 𝝏𝒙 𝝏𝒙 𝝏𝒙
𝝏𝒇
𝒇𝒙 (𝒙, 𝒚) = = 𝟐𝒙 − 𝟐 + 𝟎 + 𝟎 + 𝟎 = 𝟐𝒙 − 𝟐
𝝏𝒙
𝝏𝒇
𝒇𝒙 (𝒙, 𝒚) = = 𝟐𝒙 − 𝟐
𝝏𝒙
𝝏𝒇
Find
𝝏𝒚

Partially differentiate 𝒇(𝒙, 𝒚) w.r.t variable 𝒚, we have


𝝏𝒇 𝝏
𝒇𝒚 (𝒙, 𝒚) = = (𝒙𝟐 − 𝟐𝒙 + 𝒚𝟐 − 𝟒𝒚 + 𝟓)
𝝏𝒚 𝝏𝒚

𝝏𝒇 𝝏 𝟐 𝝏 𝝏 𝟐 𝝏 𝝏
𝒇𝒚 (𝒙, 𝒚) = = (𝒙 ) − (𝟐𝒙) + (𝒚 ) − (𝟒𝒚) + (𝟓)
𝝏𝒚 𝝏𝒚 𝝏𝒚 𝝏𝒚 𝝏𝒚 𝝏𝒚
𝝏𝒇
𝒇𝒚 (𝒙, 𝒚) = = 𝟎 + 𝟎 + 𝟐𝒚 − 𝟒 + 𝟎 = 𝟐𝒚 − 𝟒
𝝏𝒚
𝝏𝒇
𝒇𝒚 (𝒙, 𝒚) = = 𝟐𝒚 − 𝟒
𝝏𝒚

Find the critical point

To find critical point, put


𝝏𝒇 𝝏𝒇
= 𝒇𝒙 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎 and = 𝒇𝒚 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎
𝝏𝒙 𝝏𝒚

This implies that

𝒇𝒙 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎 𝒇𝒚 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎
⇒ 𝟐𝒙 − 𝟐 = 𝟎 ⇒ 𝟐𝒚 − 𝟒 = 𝟎
⇒ 𝟐𝒙 = 𝟐 ⇒ 𝟐𝒚 = 𝟒
𝟐 𝟒
⇒𝒙= =𝟏 ⇒𝒚= =𝟐
𝟐 𝟐
⇒𝒙=𝟏 ⇒𝒚=𝟐
Hence, the critical point is

(𝒙, 𝒚) = (𝟏, 𝟐)
Find Second Derivatives
𝝏𝟐 𝒇
Find 𝒇𝒙𝒙 (𝒙, 𝒚) =
𝝏𝒙𝟐

Partially differentiate 𝒇𝒙 (𝒙, 𝒚) w.r.t variable 𝒙, we have


𝝏𝟐 𝒇 𝝏
𝒇𝒙𝒙 (𝒙, 𝒚) = = (𝟐𝒙 − 𝟐)
𝝏𝒙𝟐 𝝏𝒙

𝝏𝟐 𝒇 𝝏 𝝏
𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟐 = 𝟐 (𝒙) − (𝟐) = 𝟐(𝟏) − 𝟎 = 𝟐
𝝏𝒙 𝝏𝒙 𝝏𝒙
𝝏𝟐 𝒇
𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟐 = 𝟐
𝝏𝒙
𝝏𝟐 𝒇
Find 𝒇𝒚𝒚 (𝒙, 𝒚) =
𝝏𝒚𝟐

Partially differentiate 𝒇𝒚 (𝒙, 𝒚) w.r.t variable 𝒚, we have

𝝏𝟐 𝒇 𝝏
𝒇𝒚𝒚 (𝒙, 𝒚) = = (𝟐𝒚 − 𝟒)
𝝏𝒚𝟐 𝝏𝒚

𝝏𝟐 𝒇 𝝏 𝝏
𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟐 = 𝟐 (𝒚) − (𝟒) = 𝟐(𝟏) − 𝟎 = 𝟐
𝝏𝒚 𝝏𝒚 𝝏𝒚

𝝏𝟐 𝒇
𝒇𝒚𝒚 (𝒙, 𝒚) = =𝟐
𝝏𝒚𝟐
𝝏𝟐 𝒇
Find 𝒇𝒙𝒚 (𝒙, 𝒚) =
𝝏𝒚 𝝏𝒙

Partially differentiate 𝒇𝒙 (𝒙, 𝒚) w.r.t variable 𝒚, we have


𝝏𝟐 𝒇 𝝏
𝒇𝒙𝒚 (𝒙, 𝒚) = = (𝟐𝒙 − 𝟐)
𝝏𝒚 𝝏𝒙 𝝏𝒚

𝝏𝟐 𝒇 𝝏 𝝏
𝒇𝒙𝒚 (𝒙, 𝒚) = =𝟐 ( 𝒙) − (𝟐) = 𝟐(𝟎) − 𝟎 = 𝟎
𝝏𝒚 𝝏𝒙 𝝏𝒚 𝝏𝒚

𝝏𝟐 𝒇
𝒇𝒙𝒚 (𝒙, 𝒚) = =𝟎
𝝏𝒚 𝝏𝒙

Find Second Derivative value at critical point(s)


As there is one critical point that is obtained (𝒙, 𝒚) = (𝟏, 𝟐), so
𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟐 ⇒ 𝒇𝒙𝒙 (𝟏, 𝟐) = 𝟐 > 𝟎

𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟐 ⇒ 𝒇𝒚𝒚 (𝟏, 𝟐) = 𝟐

𝒇𝒙𝒚 (𝒙, 𝒚) = 𝟎 ⇒ 𝒇𝒙𝒚 (𝟏, 𝟐) = 𝟎


Apply Second Derivative Test
𝟐
𝑫 = 𝒇𝒙𝒙 (𝟏, 𝟐) 𝒇𝒚𝒚 (𝟏, 𝟐) − [ 𝒇𝒙𝒚 (𝟏, 𝟐) ]

Putting values in the formula, we get

𝑫 = [𝟐][𝟐] − [ 𝟎 ]𝟐
⇒𝑫=𝟒−𝟎
⇒𝑫=𝟒>𝟎

Check the function has local maxima/minima or neither


Since 𝑫 = 𝟒 > 𝟎 and 𝒇𝒙𝒙 (𝟏, 𝟐) = 𝟐 > 𝟎, so by using 2nd derivative
test, the given function 𝒇(𝒙, 𝒚) has a local minima at critical point (𝟏, 𝟐).

---------------------------------------------------------------------------------------

Example 2:
Determine whether the function has a local maxima, local minima or
neither.
𝒇(𝒙, 𝒚) = 𝒚𝟑 − 𝟑𝒙𝒚 + 𝟔𝒙

Solution:
The given function is

𝒇(𝒙, 𝒚) = 𝒚𝟑 − 𝟑𝒙𝒚 + 𝟔𝒙
𝝏𝒇
Step 1: Find
𝝏𝒙

Partially differentiate 𝒇(𝒙, 𝒚) w.r.t variable 𝒙, we have


𝝏𝒇 𝝏
𝒇𝒙 (𝒙, 𝒚) = = (𝒚𝟑 − 𝟑𝒙𝒚 + 𝟔𝒙)
𝝏𝒙 𝝏𝒙
𝝏𝒇 𝝏 𝟑 𝝏 𝝏
𝒇𝒙 (𝒙, 𝒚) = = (𝒚 ) − (𝟑𝒙𝒚) + (𝟔𝒙)
𝝏𝒙 𝝏𝒙 𝝏𝒙 𝝏𝒙
𝝏𝒇
𝒇𝒙 (𝒙, 𝒚) = = 𝟎 − 𝟑𝒚(𝟏) + 𝟔 = −𝟑𝒚 + 𝟔
𝝏𝒙
𝝏𝒇
𝒇𝒙 (𝒙, 𝒚) = = −𝟑𝒚 + 𝟔 -------------(1)
𝝏𝒙

𝝏𝒇
Step 2: Find
𝝏𝒚

Partially differentiate 𝒇(𝒙, 𝒚) w.r.t variable 𝒚, we have


𝝏𝒇 𝝏
𝒇𝒚 (𝒙, 𝒚) = = (𝒚𝟑 − 𝟑𝒙𝒚 + 𝟔𝒙)
𝝏𝒚 𝝏𝒚

𝝏𝒇 𝝏 𝟑 𝝏 𝝏
𝒇𝒚 (𝒙, 𝒚) = = (𝒚 ) − (𝟑𝒙𝒚) + (𝟔𝒙)
𝝏𝒚 𝝏𝒚 𝝏𝒚 𝝏𝒚
𝝏𝒇
𝒇𝒚 (𝒙, 𝒚) = = 𝟑𝒚𝟐 − 𝟑𝒙(𝟏) + 𝟎 = 𝟑𝒚𝟐 − 𝟑𝒙
𝝏𝒚
𝝏𝒇
𝒇𝒚 (𝒙, 𝒚) = 𝝏𝒚 = 𝟑𝒚𝟐 − 𝟑𝒙 -------------(2)

Step 3: Find the critical point

To find critical point, put


𝝏𝒇 𝝏𝒇
= 𝒇𝒙 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎 and = 𝒇𝒚 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎
𝝏𝒙 𝝏𝒚

This implies that

𝒇𝒙 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎 𝒇𝒚 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎
⇒ −𝟑𝒚 + 𝟔 = 𝟎 ⇒ 𝟑𝒚𝟐 − 𝟑𝒙 = 𝟎
⇒ −𝟑𝒚 = −𝟔 ⇒ −𝟑𝒙 = −𝟑𝒚𝟐
−𝟔 −𝟑𝒚𝟐
⇒𝒚= =𝟐 ⇒𝒙= = 𝒚𝟐
−𝟑 −𝟑
⇒ 𝒚 = 𝟐 -------------(3) ⇒ 𝒙 = 𝒚𝟐 -------------(4)
From equation (3), substitute
value of 𝒚 in equation (4), we get
⇒ 𝒙 = (𝟐)𝟐 = 𝟒
⇒ 𝒙 = 𝟒 -------- (5)
Hence,

𝒙 = 𝟒, 𝒚 = 𝟐

So, the critical point is

(𝒙, 𝒚) = (𝟒, 𝟐)
Step 4: Find Second Derivatives
𝝏𝟐 𝒇
Find 𝒇𝒙𝒙 (𝒙, 𝒚) =
𝝏𝒙𝟐

Partially differentiate 𝒇𝒙 (𝒙, 𝒚) w.r.t variable 𝒙, we have


𝝏𝟐 𝒇 𝝏
𝒇𝒙𝒙 (𝒙, 𝒚) = = (−𝟑𝒚 + 𝟔)
𝝏𝒙𝟐 𝝏𝒙

𝝏𝟐 𝒇 𝝏 𝝏
𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟐 = −𝟑 (𝒚) + (𝟔) = −𝟑(𝟎) + 𝟎 = 𝟎
𝝏𝒙 𝝏𝒙 𝝏𝒙
𝝏𝟐 𝒇
𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟐 = 𝟎
𝝏𝒙
𝝏𝟐 𝒇
Find 𝒇𝒚𝒚 (𝒙, 𝒚) =
𝝏𝒚𝟐

Partially differentiate 𝒇𝒚 (𝒙, 𝒚) w.r.t variable 𝒚, we have

𝝏𝟐 𝒇 𝝏
𝒇𝒚𝒚 (𝒙, 𝒚) = = (𝟑𝒚𝟐 − 𝟑𝒙)
𝝏𝒚𝟐 𝝏𝒚

𝝏𝟐 𝒇 𝝏 𝝏
𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟐 = 𝟑 (𝒚𝟐 ) − 𝟑 (𝒙) = 𝟑(𝟐𝒚) − 𝟑(𝟎) = 𝟔𝒚
𝝏𝒚 𝝏𝒚 𝝏𝒚
𝝏𝟐 𝒇
𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟐 = 𝟔𝒚
𝝏𝒚
𝝏𝟐 𝒇
Find 𝒇𝒙𝒚 (𝒙, 𝒚) =
𝝏𝒚 𝝏𝒙

Partially differentiate 𝒇𝒙 (𝒙, 𝒚) w.r.t variable 𝒚, we have


𝝏𝟐 𝒇 𝝏
𝒇𝒙𝒚 (𝒙, 𝒚) = = (−𝟑𝒚 + 𝟔)
𝝏𝒚 𝝏𝒙 𝝏𝒚

𝝏𝟐 𝒇 𝝏 𝝏
𝒇𝒙𝒚 (𝒙, 𝒚) = = −𝟑 ( 𝒚) + (𝟔) = −𝟑(𝟏) + 𝟎 = −𝟑
𝝏𝒚 𝝏𝒙 𝝏𝒚 𝝏𝒚

𝝏𝟐 𝒇
𝒇𝒙𝒚 (𝒙, 𝒚) = = −𝟑
𝝏𝒚 𝝏𝒙

Step 5: Find Second Derivative value at critical point(s)


As there is one critical point that is obtained (𝒙, 𝒚) = (𝟒, 𝟐), so
𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟎 ⇒ 𝒇𝒙𝒙 (𝟒, 𝟐) = 𝟎

𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟔𝒚 ⇒ 𝒇𝒚𝒚 (𝟒, 𝟐) = 𝟔(𝟐) = 𝟏𝟐

𝒇𝒙𝒚 (𝒙, 𝒚) = −𝟑 ⇒ 𝒇𝒙𝒚 (𝟒, 𝟐) = −𝟑

Step 6: Apply Second Derivative Test


𝟐
𝑫 = 𝒇𝒙𝒙 (𝟒, 𝟐) 𝒇𝒚𝒚 (𝟒, 𝟐) − [ 𝒇𝒙𝒚 (𝟒, 𝟐) ]

Putting values in the formula, we get

𝑫 = [𝟎][𝟏𝟐] − [−𝟑 ]𝟐
⇒𝑫=𝟎−𝟗
⇒ 𝑫 = −𝟗 < 𝟎
Step 7: Check the function has local maxima/minimum or
neither
Since 𝑫 = −𝟗 < 𝟎, so by using 2nd derivative test, the given function
𝒇(𝒙, 𝒚) has neither local maxima nor local minima at critical point (𝟒, 𝟐). The
function 𝒇(𝒙, 𝒚) has saddle point at critical point (𝟐, −𝟏).

---------------------------------------------------------------------------------------

Example:
Determine whether the function has a local maxima, local minima or
neither.
𝒇(𝒙, 𝒚) = 𝒙𝟑 + 𝒚𝟑 − 𝟑𝒙𝟐 − 𝟑𝒚 + 𝟏𝟎

Solution:
The given function is

𝒇(𝒙, 𝒚) = 𝒙𝟑 + 𝒚𝟑 − 𝟑𝒙𝟐 − 𝟑𝒚 + 𝟏𝟎
𝝏𝒇
Step 1: Find
𝝏𝒙

Partially differentiate 𝒇(𝒙, 𝒚) w.r.t variable 𝒙, we have


𝝏𝒇 𝝏
𝒇𝒙 (𝒙, 𝒚) = = (𝒙𝟑 + 𝒚𝟑 − 𝟑𝒙𝟐 − 𝟑𝒚 + 𝟏𝟎)
𝝏𝒙 𝝏𝒙

𝝏𝒇 𝝏 𝟑 𝝏 𝟑 𝝏 𝝏 𝝏
𝒇𝒙 (𝒙, 𝒚) = = (𝒙 ) + (𝒚 ) − (𝟑𝒙𝟐 ) − (𝟑𝒚) + (𝟏𝟎)
𝝏𝒙 𝝏𝒙 𝝏𝒙 𝝏𝒙 𝝏𝒙 𝝏𝒙
𝝏𝒇
𝒇𝒙 (𝒙, 𝒚) = = 𝟑𝒙𝟐 + 𝟎 − 𝟑(𝟐𝒙) − 𝟎 + 𝟎 = 𝟑𝒙𝟐 − 𝟔𝒙
𝝏𝒙
𝝏𝒇
𝒇𝒙 (𝒙, 𝒚) = = 𝟑𝒙𝟐 − 𝟔𝒙
𝝏𝒙
𝝏𝒇
Step 2: Find
𝝏𝒚
Partially differentiate 𝒇(𝒙, 𝒚) w.r.t variable 𝒚, we have
𝝏𝒇 𝝏
𝒇𝒚 (𝒙, 𝒚) = = (𝒙𝟑 + 𝒚𝟑 − 𝟑𝒙𝟐 − 𝟑𝒚 + 𝟏𝟎)
𝝏𝒚 𝝏𝒚

𝝏𝒇 𝝏 𝝏 𝟑 𝝏 𝝏 𝝏
𝒇𝒚 (𝒙, 𝒚) = = (𝒙𝟑 ) + (𝒚 ) − (𝟑𝒙𝟐 ) − (𝟑𝒚) + (𝟏𝟎)
𝝏𝒚 𝝏𝒚 𝝏𝒚 𝝏𝒚 𝝏𝒚 𝝏𝒚
𝝏𝒇
𝒇𝒚 (𝒙, 𝒚) = = 𝟎 + 𝟑𝒚𝟐 − 𝟎 − 𝟑 + 𝟎 = 𝟑𝒚𝟐 − 𝟑
𝝏𝒚

𝝏𝒇
𝒇𝒚 (𝒙, 𝒚) = = 𝟑𝒚𝟐 − 𝟑
𝝏𝒚

Step 3: Find the critical point

To find critical point, put


𝝏𝒇 𝝏𝒇
= 𝒇𝒙 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎 and = 𝒇𝒚 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎
𝝏𝒙 𝝏𝒚

This implies that

𝒇𝒙 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎 𝒇𝒚 (𝒙𝟎 , 𝒚𝟎 ) = 𝟎
⇒ 𝟑𝒙𝟐 − 𝟔𝒙 = 𝟎 ⇒ 𝟑𝒚𝟐 − 𝟑 = 𝟎
⇒ 𝟑𝒙(𝒙 − 𝟐) = 𝟎 ⇒ 𝟑(𝒚𝟐 − 𝟏) = 𝟎
⇒ 𝒙(𝒙 − 𝟐) = 𝟎 ⇒ 𝒚𝟐 − 𝟏 = 𝟎
⇒ 𝒙 = 𝟎, 𝒙−𝟐=𝟎 ⇒ (𝒚 + 𝟏)(𝒚 − 𝟏) = 𝟎
⇒ 𝒙 = 𝟎, 𝒙=𝟐 ⇒ 𝒚 = −𝟏, 𝒚=𝟏
Since we obtained the values of 𝒙 and 𝒚 as below

𝒙 = 𝟎, 𝒙=𝟐, and 𝒚 = −𝟏, 𝒚=𝟏


• Now, fix first value of 𝒙 and make ordered pairs will all values of 𝒚, that is

(𝟎, −𝟏), (𝟎, 𝟏)

• Now, fix second value of 𝒙 and make ordered pairs will all values of 𝒚, that is
(𝟐, −𝟏), (𝟐, 𝟏)

Hence, we obtain the four (4) critical points. The critical points are as follows:

1. (𝒙, 𝒚) = (𝟎, −𝟏)


2. (𝒙, 𝒚) = (𝟎, 𝟏)
3. (𝒙, 𝒚) = (𝟐, −𝟏)
4. (𝒙, 𝒚) = (𝟐, 𝟏)
Note: In this case we get 4 critical points. It means that, for
every critical point, you have to find that where function has
local maxima, local minima, or neither separately, i.e. we
compute D-Test for all critical points separately.
Step 4: Find Second Derivatives
𝝏𝟐 𝒇
Find 𝒇𝒙𝒙 (𝒙, 𝒚) =
𝝏𝒙𝟐

Partially differentiate 𝒇𝒙 (𝒙, 𝒚) w.r.t variable 𝒙, we have


𝝏𝟐 𝒇 𝝏
𝒇𝒙𝒙 (𝒙, 𝒚) = = (𝟑𝒙𝟐 − 𝟔𝒙)
𝝏𝒙𝟐 𝝏𝒙

𝝏𝟐 𝒇 𝝏 𝝏
𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟐 = 𝟑 (𝒙𝟐 ) − 𝟔 (𝒙) = 𝟑(𝟐𝒙) − 𝟔(𝟏) = 𝟔𝒙 − 𝟔
𝝏𝒙 𝝏𝒙 𝝏𝒙
𝝏𝟐 𝒇
𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟐 = 𝟔𝒙 − 𝟔
𝝏𝒙
𝝏𝟐 𝒇
Find 𝒇𝒚𝒚 (𝒙, 𝒚) =
𝝏𝒚𝟐

Partially differentiate 𝒇𝒚 (𝒙, 𝒚) w.r.t variable 𝒚, we have

𝝏𝟐 𝒇 𝝏
𝒇𝒚𝒚 (𝒙, 𝒚) = = (𝟑𝒚𝟐 − 𝟑)
𝝏𝒚𝟐 𝝏𝒚
𝝏𝟐 𝒇 𝝏 𝝏
𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟐 = 𝟑 (𝒚𝟐 ) − (𝟑) = 𝟑(𝟐𝒚) − 𝟎 = 𝟔𝒚
𝝏𝒚 𝝏𝒚 𝝏𝒚

𝝏𝟐 𝒇
𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟐 = 𝟔𝒚
𝝏𝒚
𝝏𝟐 𝒇
Find 𝒇𝒙𝒚 (𝒙, 𝒚) =
𝝏𝒚 𝝏𝒙

Partially differentiate 𝒇𝒙 (𝒙, 𝒚) w.r.t variable 𝒚, we have


𝝏𝟐 𝒇 𝝏
𝒇𝒙𝒚 (𝒙, 𝒚) = = (𝟑𝒙𝟐 − 𝟔𝒙)
𝝏𝒚 𝝏𝒙 𝝏𝒚

𝝏𝟐 𝒇 𝝏 𝝏
𝒇𝒙𝒚 (𝒙, 𝒚) = =𝟑 ( 𝒙𝟐 ) − 𝟔 (𝒙) = 𝟑(𝟎) − 𝟔(𝟎) = 𝟎
𝝏𝒚 𝝏𝒙 𝝏𝒚 𝝏𝒚

𝝏𝟐 𝒇
𝒇𝒙𝒚 (𝒙, 𝒚) = =𝟎
𝝏𝒚 𝝏𝒙

Step 5: Find Second Derivative value at critical point(s)


𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟔𝒙 − 𝟔

𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟔𝒚

𝒇𝒙𝒚 (𝒙, 𝒚) = 𝟎

For critical point (𝒙, 𝒚) = (𝟎, −𝟏)


𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟔𝒙 − 𝟔 ⇒ 𝒇𝒙𝒙 (𝟎, −𝟏) = 𝟔(𝟎) − 𝟔 = 𝟎 − 𝟔 = −𝟔 < 𝟎

𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟔𝒚 ⇒ 𝒇𝒚𝒚 (𝟎, −𝟏) = 𝟔(−𝟏) = −𝟔

𝒇𝒙𝒚 (𝒙, 𝒚) = 𝟎 ⇒ 𝒇𝒙𝒚 (𝟎, −𝟏) = 𝟎


For critical point (𝒙, 𝒚) = (𝟎, 𝟏)
𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟔𝒙 − 𝟔 ⇒ 𝒇𝒙𝒙 (𝟎, 𝟏) = 𝟔(𝟎) − 𝟔 = 𝟎 − 𝟔 = −𝟔 < 𝟎

𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟔𝒚 ⇒ 𝒇𝒚𝒚 (𝟎, 𝟏) = 𝟔(𝟏) = 𝟔

𝒇𝒙𝒚 (𝒙, 𝒚) = 𝟎 ⇒ 𝒇𝒙𝒚 (𝟎, 𝟏) = 𝟎

For critical point (𝒙, 𝒚) = (𝟐, −𝟏)


𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟔𝒙 − 𝟔 ⇒ 𝒇𝒙𝒙 (𝟐, −𝟏) = 𝟔(𝟐) − 𝟔 = 𝟏𝟐 − 𝟔 = 𝟔 > 𝟎

𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟔𝒚 ⇒ 𝒇𝒚𝒚 (𝟐, −𝟏) = 𝟔(−𝟏) = −𝟔

𝒇𝒙𝒚 (𝒙, 𝒚) = 𝟎 ⇒ 𝒇𝒙𝒚 (𝟐, −𝟏) = 𝟎

For critical point (𝒙, 𝒚) = (𝟐, 𝟏)


𝒇𝒙𝒙 (𝒙, 𝒚) = 𝟔𝒙 − 𝟔 ⇒ 𝒇𝒙𝒙 (𝟐, 𝟏) = 𝟔(𝟐) − 𝟔 = 𝟏𝟐 − 𝟔 = 𝟔 > 𝟎

𝒇𝒚𝒚 (𝒙, 𝒚) = 𝟔𝒚 ⇒ 𝒇𝒚𝒚 (𝟐, 𝟏) = 𝟔(𝟏) = 𝟔

𝒇𝒙𝒚 (𝒙, 𝒚) = 𝟎 ⇒ 𝒇𝒙𝒚 (𝟐, 𝟏) = 𝟎

Step 6: Apply Second Derivative Test


For critical point (𝒙, 𝒚) = (𝟎, −𝟏)
• 𝒇𝒙𝒙 (𝟎, −𝟏) = −𝟔 < 𝟎
• 𝒇𝒚𝒚 (𝟎, −𝟏) = −𝟔
• 𝒇𝒙𝒚 (𝟎, −𝟏) = 𝟎

Since
𝟐
𝑫 = 𝒇𝒙𝒙 (𝟎, −𝟏) 𝒇𝒚𝒚 (𝟎, −𝟏) − [ 𝒇𝒙𝒚 (𝟎, −𝟏) ]

Putting values in the formula, we get

𝑫 = [−𝟔][−𝟔] − [ 𝟎 ]𝟐
⇒ 𝑫 = 𝟑𝟔 − 𝟎
⇒ 𝑫 = 𝟑𝟔 > 𝟎
For critical point (𝒙, 𝒚) = (𝟎, 𝟏)
• 𝒇𝒙𝒙 (𝟎, 𝟏) = −𝟔 < 𝟎
• 𝒇𝒚𝒚 (𝟎, 𝟏) = 𝟔
• 𝒇𝒙𝒚 (𝟎, 𝟏) = 𝟎

Since
𝟐
𝑫 = 𝒇𝒙𝒙 (𝟎, 𝟏) 𝒇𝒚𝒚 (𝟎, 𝟏) − [ 𝒇𝒙𝒚 (𝟎, 𝟏) ]

Putting values in the formula, we get

𝑫 = [−𝟔][𝟔] − [ 𝟎 ]𝟐
⇒ 𝑫 = −𝟑𝟔 − 𝟎
⇒ 𝑫 = −𝟑𝟔 < 𝟎
For critical point (𝒙, 𝒚) = (𝟐, −𝟏)
• 𝒇𝒙𝒙 (𝟐, −𝟏) = 𝟔 > 𝟎
• 𝒇𝒚𝒚 (𝟐, −𝟏) = −𝟔
• 𝒇𝒙𝒚 (𝟐, −𝟏) = 𝟎

Since
𝟐
𝑫 = 𝒇𝒙𝒙 (𝟐, −𝟏) 𝒇𝒚𝒚 (𝟐, −𝟏) − [ 𝒇𝒙𝒚 (𝟐, −𝟏) ]

Putting values in the formula, we get

𝑫 = [𝟔][−𝟔] − [ 𝟎 ]𝟐
⇒ 𝑫 = −𝟑𝟔 − 𝟎
⇒ 𝑫 = −𝟑𝟔 < 𝟎
For critical point (𝒙, 𝒚) = (𝟐, 𝟏)
• 𝒇𝒙𝒙 (𝟐, 𝟏) = 𝟔 > 𝟎
• 𝒇𝒚𝒚 (𝟐, 𝟏) = 𝟔
• 𝒇𝒙𝒚 (𝟐, 𝟏) = 𝟎

Since
𝟐
𝑫 = 𝒇𝒙𝒙 (𝟐, 𝟏) 𝒇𝒚𝒚 (𝟐, 𝟏) − [ 𝒇𝒙𝒚 (𝟐, 𝟏) ]

Putting values in the formula, we get

𝑫 = [𝟔][𝟔] − [ 𝟎 ]𝟐
⇒ 𝑫 = 𝟑𝟔 − 𝟎
⇒ 𝑫 = 𝟑𝟔 > 𝟎

Step 7: Check the function has local maxima/minimum or


neither
For critical point (𝒙, 𝒚) = (𝟎, −𝟏)

Since 𝑫 = 𝟑𝟔 > 𝟎 and 𝒇𝒙𝒙 (𝟎, −𝟏) = −𝟔 < 𝟎, so by using 2nd


derivative test, the given function 𝒇(𝒙, 𝒚) has a local maxima at critical point
(𝟎, −𝟏).

For critical point (𝒙, 𝒚) = (𝟎, 𝟏)

Since 𝑫 = −𝟑𝟔 < 𝟎, so by using 2nd derivative test, the given function
𝒇(𝒙, 𝒚) has neither local maxima nor local minima at critical point (𝟎, 𝟏). The
function 𝒇(𝒙, 𝒚) has saddle point at critical point (𝟎, 𝟏).
For critical point (𝒙, 𝒚) = (𝟐, −𝟏)

Since 𝑫 = −𝟑𝟔 < 𝟎, so by using 2nd derivative test, the given function
𝒇(𝒙, 𝒚) has neither local maxima nor local minima at critical point (𝟐, −𝟏). The
function 𝒇(𝒙, 𝒚) has saddle point at critical point (𝟐, −𝟏).

For critical point (𝒙, 𝒚) = (𝟐, 𝟏)

Since 𝑫 = 𝟑𝟔 > 𝟎 and 𝒇𝒙𝒙 (𝟐, 𝟏) = 𝟔 > 𝟎, so by using 2nd


derivative test, the given function 𝒇(𝒙, 𝒚) has a local minima at critical point
(𝟐, 𝟏).

Conclusion:

(𝒙, 𝒚) = (𝟎, −𝟏) ⇒ Function has Local Maxima.


(𝒙, 𝒚) = (𝟎, 𝟏) ⇒ Function has Saddle Point.
(𝒙, 𝒚) = (𝟐, −𝟏) ⇒ Function has Saddle Point.
(𝒙, 𝒚) = (𝟐, 𝟏) ⇒ Function has Local Minima.
---------------------------------------------------------------------------------------
Example:
In regions with severe winter weather, the wind-chill index is often used to describe the apparent
severity of the cold. This index 𝑾 is a subjective temperature that depends on the actual
temperature 𝑻 and the wind speed 𝒗. So 𝑾 is a function of 𝑻 and 𝒗, and we can write

𝑾 = 𝒇(𝑻, 𝒗)

The wind-chill index 𝑾 compiled by the National Weather Service of the US and the
Meteorological Service of Canada is given in the form of the function.

𝑾 = 𝒇(𝑻, 𝒗) = 𝟒𝟎𝟎 − 𝟑 𝑻𝟐 − 𝟒 𝑻 + 𝟐 𝑻 𝒗 − 𝟓𝒗𝟐 + 𝟒𝟖 𝒗

a) Find the optimal wind-chill index for the given function.


b) Find the optimal value of wind chill index.
Solution:
Practice Questions
Question 1:

The terminal velocity (meters/second) that a two-stage rocket achieves is a function


of the amount of fuel 𝒙 and 𝒚 (measured in liters) loaded into the two stages such
that

𝒇(𝒙, 𝒚) = 𝒙𝟑 𝒚 + 𝟏𝟐𝒙𝟐 − 𝟖𝒚

Minimize the total quantity of fuel required to achieve a specified terminal velocity.

Question 2:

A company designing a video streaming application that relies on two key


parameters, denoted as 𝒙 and 𝒚, to control the video quality and buffer size. Let the
function 𝒇(𝒙, 𝒚) represent the user wait time.

𝟑
𝒚𝟑
𝒇(𝒙, 𝒚) = 𝟗𝒙 + − 𝟒𝒙𝒚
𝟑
Find the optimal solutions and minimizes the user wait in the video streaming
application.
Practice Questions:
Determine whether the following functions have a local maxima, local
minima or neither.

1) 𝒇(𝒙, 𝒚) = 𝒙𝟐 + 𝟒𝒙 + 𝒚𝟐
2) 𝒇(𝒙, 𝒚) = 𝒙𝟐 + 𝒙𝒚 + 𝟑𝒚
3) 𝒇(𝒙, 𝒚) = 𝒙𝟐 + 𝒚𝟐 + 𝟔𝒙 − 𝟏𝟎𝒚 + 𝟖
4) 𝒇(𝒙, 𝒚) = 𝒙𝟐 − 𝟐𝒙𝒚 + 𝟑𝒚𝟐 − 𝟖𝒚
5) 𝒇(𝒙, 𝒚) = 𝒙𝟑 − 𝟑𝒙 + 𝒚𝟑 − 𝟑𝒚
6) 𝒇(𝒙, 𝒚) = 𝒙𝟑 + 𝒚𝟐 − 𝟑𝒙𝟐 + 𝟏𝟎𝒚 + 𝟔
7) 𝒇(𝒙, 𝒚) = 𝒙𝟑 + 𝒚𝟑 − 𝟔𝒚𝟐 − 𝟑𝒙 + 𝟗
8) 𝒇(𝒙, 𝒚) = 𝒙𝟑 + 𝒚𝟑 − 𝟑𝒙𝟐 − 𝟑𝒚 + 𝟏𝟎
9) 𝒇(𝒙, 𝒚) = 𝟒𝟎𝟎 − 𝟑𝒙𝟐 − 𝟒𝒙 + 𝟐𝒙𝒚 − 𝟓𝒚𝟐 + 𝟒𝟖𝒚
Optimization Using Gradient-Based
Algorithms in PYTHON
Example: Optimize the cost function 𝒇(𝒙, 𝒚) = 𝒙𝟐 + 𝒚𝟐 + 𝟓 using
gradient descent.
Python Code:

import numpy as np
import matplotlib.pyplot as plt
# Define a multivariate function (e.g., a simple quadratic
function)
def cost_function(x, y):
return x**2 + y**2 + 5
# Partial derivatives of the cost function
def gradient(x, y):
df_dx = 2 * x
df_dy = 2 * y
return np.array([df_dx, df_dy])
# Gradient Descent Algorithm
def gradient_descent(starting_point, learning_rate, iterations):
point = np.array(starting_point, dtype=float)
path = [point.copy()]
for _ in range(iterations):
grad = gradient(*point)
point -= learning_rate * grad
path.append(point.copy())
return np.array(path)
# Parameters
starting_point = [10, 10]
learning_rate = 0.1
iterations = 50
# Execute gradient descent
path = gradient_descent(starting_point, learning_rate, iterations)
# Plotting
x_vals = np.linspace(-12, 12, 100)
y_vals = np.linspace(-12, 12, 100)
X, Y = np.meshgrid(x_vals, y_vals)
Z = cost_function(X, Y)
plt.contour(X, Y, Z, levels=50)
plt.plot(path[:, 0], path[:, 1], marker='o', color='red')
plt.title('Gradient Descent Optimization')
plt.xlabel('X')
plt.ylabel('Y')
plt.show()

Output:
Note: Now find the critical points of the given exercises and
verify using the gradient descent code.
Applications of Optimization
Example 1:
A manufacturing company produces two products which are sold in
two separate markets. The company’s economists analyze the two
markets and determine that the two quantities 𝒒𝟏 and 𝒒𝟐 demanded by the
consumers and prices 𝑷𝟏 and 𝑷𝟐 (in $) of each item are related by the
equation
Price of 1st product = 𝒑𝟏 (𝒒𝟏 , 𝒒𝟐 ) = 𝟔𝟎𝟎 − 𝟎. 𝟑 𝒒𝟏
Price of 2nd product =𝒑𝟐 (𝒒𝟏 , 𝒒𝟐 ) = 𝟓𝟎𝟎 − 𝟎. 𝟐 𝒒𝟐
If the price for either item increases, the demand for it decreases. The
company’s total production cost is given by
𝑪𝒐𝒔𝒕 𝒇𝒖𝒏𝒄𝒕𝒊𝒐𝒏 = 𝑪(𝒒𝟏 , 𝒒𝟐 ) = 𝟏𝟔 + 𝟏. 𝟐 𝒒𝟏 + 𝟏. 𝟓 𝒒𝟐 + 𝟎. 𝟐 𝒒𝟏 𝒒𝟐
a) If the company wants to maximize its total profit, how much of
each product should it produce?
b) What is the maximum profit?

Solution:
Given information:

Price of 1st product: 𝒑𝟏

Price of 2nd product: 𝒑𝟐

Quantity produced of 1st product: 𝒒𝟏

Quantity produced of 2nd product: 𝒒𝟐


𝑷𝒓𝒊𝒄𝒆 𝒐𝒇 𝒑𝒓𝒐𝒅𝒖𝒄𝒕 𝟏 = 𝒑𝟏 (𝒒𝟏 , 𝒒𝟐 ) = 𝟔𝟎𝟎 − 𝟎. 𝟑 𝒒𝟏 -------- (1)

𝑷𝒓𝒊𝒄𝒆 𝒐𝒇 𝒑𝒓𝒐𝒅𝒖𝒄𝒕 𝟐 = 𝒑𝟐 (𝒒𝟏 , 𝒒𝟐 ) = 𝟓𝟎𝟎 − 𝟎. 𝟐 𝒒𝟐 -------- (2)


𝑪𝒐𝒔𝒕 𝒇𝒖𝒏𝒄𝒕𝒊𝒐𝒏 = 𝑪 = 𝟏𝟔 + 𝟏. 𝟐 𝒒𝟏 + 𝟏. 𝟓 𝒒𝟐 + 𝟎. 𝟐 𝒒𝟏 𝒒𝟐 -------- (3)

Since we know that

𝑷𝒓𝒐𝒇𝒊𝒕 = 𝑷 = 𝑹𝒆𝒗𝒆𝒏𝒖𝒆 − 𝑪𝒐𝒔𝒕 -------(4)


and

𝑹𝒆𝒗𝒆𝒏𝒖𝒆 𝒇𝒖𝒏𝒄𝒕𝒊𝒐𝒏 = 𝑹 = 𝑷𝒓𝒊𝒄𝒆 × 𝒒𝒖𝒂𝒏𝒕𝒊𝒕𝒚 -------(5)


Since, in this case, the company produces two products which are sold in
two separate markets. This implies that

𝑹𝒆𝒗𝒆𝒏𝒖𝒆 = 𝑹(𝒒𝟏 , 𝒒𝟐 ) = 𝒑𝟏 𝒒𝟏 + 𝒑𝟐 𝒒𝟐 -------(6)

Putting equation (1) and (2) in equation (4), we get


𝑹(𝒒𝟏 , 𝒒𝟐 ) = (𝟔𝟎𝟎 − 𝟎. 𝟑𝒒𝟏 )𝒒𝟏 + (𝟓𝟎𝟎 − 𝟎. 𝟐𝒒𝟐 )𝒒𝟐

𝑹(𝒒𝟏 , 𝒒𝟐 ) = 𝟔𝟎𝟎𝒒𝟏 − 𝟎. 𝟑𝒒𝟐𝟏 + 𝟓𝟎𝟎𝒒𝟐 − 𝟎. 𝟐𝒒𝟐𝟐 -------(7)

So, putting equation (3) and (7) in equation (4), we get


𝐏𝐫𝐨𝐟𝐢𝐭 = 𝐏 = 𝐑𝐞𝐯𝐞𝐧𝐮𝐞 – 𝐂𝐨𝐬𝐭
𝑷 = [𝟔𝟎𝟎𝒒𝟏 − 𝟎. 𝟑𝒒𝟐𝟏 + 𝟓𝟎𝟎𝒒𝟐 − 𝟎. 𝟐𝒒𝟐𝟐 ] − [𝟏𝟔 + 𝟏. 𝟐𝒒𝟏 + 𝟏. 𝟓𝒒𝟐 + 𝟎. 𝟐𝒒𝟏 𝒒𝟐 ]

𝑷 = 𝟔𝟎𝟎𝒒𝟏 − 𝟎. 𝟑𝒒𝟐𝟏 + 𝟓𝟎𝟎𝒒𝟐 − 𝟎. 𝟐𝒒𝟐𝟐 − 𝟏𝟔 − 𝟏. 𝟐𝒒𝟏 − 𝟏. 𝟓𝒒𝟐 − 𝟎. 𝟐𝒒𝟏 𝒒𝟐

𝑷(𝒒𝟏 , 𝒒𝟐 ) = −𝟎. 𝟑𝒒𝟐𝟏 − 𝟎. 𝟐𝒒𝟐𝟐 + 𝟓𝟗𝟖. 𝟖𝒒𝟏 + 𝟒𝟗𝟖. 𝟓𝒒𝟐 − 𝟎. 𝟐𝒒𝟏 𝒒𝟐 − 𝟏𝟔 ----(8)

Note: This is your simple function. You can apply 2nd derivative test on this
profit function given in equation (8).
𝝏𝑷
Find
𝝏𝒒𝟏

Partially differentiate 𝑷(𝒒𝟏 , 𝒒𝟐 ) w.r.t variable 𝒒𝟏 , we have


𝝏𝑷 𝝏
𝑷𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = 𝝏𝒒 = 𝝏𝒒 (−𝟎. 𝟑𝒒𝟐𝟏 − 𝟎. 𝟐𝒒𝟐𝟐 + 𝟓𝟗𝟖. 𝟖𝒒𝟏 + 𝟒𝟗𝟖. 𝟓𝒒𝟐 − 𝟎. 𝟐𝒒𝟏 𝒒𝟐 − 𝟏𝟔)
𝟏 𝟏

𝝏𝑷
𝑷𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟑(𝟐𝒒𝟏 ) − 𝟎 + 𝟓𝟗𝟖. 𝟖(𝟏) + 𝟎 − 𝟎. 𝟐𝒒𝟐 (𝟏) − 𝟎
𝝏𝒒𝟏

𝝏𝑷
𝑷𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟔 𝒒𝟏 + 𝟓𝟗𝟖. 𝟖 − 𝟎. 𝟐𝒒𝟐
𝝏𝒒𝟏
𝝏𝑷
𝑷𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟔 𝒒𝟏 − 𝟎. 𝟐 𝒒𝟐 + 𝟓𝟗𝟖. 𝟖
𝝏𝒒𝟏

𝝏𝑷
𝑷𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟔 𝒒𝟏 − 𝟎. 𝟐 𝒒𝟐 + 𝟓𝟗𝟖. 𝟖 ----------(9)
𝝏𝒒𝟏

𝝏𝑷
Find
𝝏𝒒𝟐

Partially differentiate 𝑷(𝒒𝟏 , 𝒒𝟐 ) w.r.t variable 𝒒𝟐 , we have


𝝏𝑷 𝝏
𝑷𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = 𝝏𝒒 = 𝝏𝒒 (−𝟎. 𝟑𝒒𝟐𝟏 − 𝟎. 𝟐𝒒𝟐𝟐 + 𝟓𝟗𝟖. 𝟖𝒒𝟏 + 𝟒𝟗𝟖. 𝟓𝒒𝟐 − 𝟎. 𝟐𝒒𝟏 𝒒𝟐 − 𝟏𝟔)
𝟐 𝟐

𝝏𝑷
𝑷𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = 𝟎 − 𝟎. 𝟐(𝟐𝒒𝟐 ) + 𝟎 + 𝟒𝟗𝟖. 𝟓(𝟏) − 𝟎. 𝟐𝒒𝟏 (𝟏) − 𝟎
𝝏𝒒𝟐

𝝏𝑷
𝑷𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟒 𝒒𝟐 + 𝟒𝟗𝟖. 𝟓 − 𝟎. 𝟐𝒒𝟏
𝝏𝒒𝟐
𝝏𝑷
𝑷𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟐 𝒒𝟏 − 𝟎. 𝟒 𝒒𝟐 + 𝟒𝟗𝟖. 𝟓
𝝏𝒒𝟐

𝝏𝑷
𝑷𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟐 𝒒𝟏 − 𝟎. 𝟒 𝒒𝟐 + 𝟒𝟗𝟖. 𝟓 ----------(10)
𝝏𝒒𝟐

Find the critical point

To find critical point, put


𝝏𝑷 𝝏𝑷
𝑷𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) =
𝝏𝒒𝟏
=𝟎 and 𝑷𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) =
𝝏𝒒𝟐
=𝟎

This implies that


𝑷𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = 𝟎 𝑷𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = 𝟎
⇒ −𝟎. 𝟔 𝒒𝟏 − 𝟎. 𝟐 𝒒𝟐 + 𝟓𝟗𝟖. 𝟖 = 𝟎 ⇒ −𝟎. 𝟐 𝒒𝟏 − 𝟎. 𝟒 𝒒𝟐 + 𝟒𝟗𝟖. 𝟓 = 𝟎
⇒ −𝟎. 𝟔 𝒒𝟏 − 𝟎. 𝟐 𝒒𝟐 = −𝟓𝟗𝟖. 𝟖 ⇒ −𝟎. 𝟐 𝒒𝟏 − 𝟎. 𝟒 𝒒𝟐 = −𝟒𝟗𝟖. 𝟓

⇒ 𝟎. 𝟔 𝒒𝟏 + 𝟎. 𝟐 𝒒𝟐 = 𝟓𝟗𝟖. 𝟖 -------(11) ⇒ 𝟎. 𝟐 𝒒𝟏 + 𝟎. 𝟒 𝒒𝟐 = 𝟒𝟗𝟖. 𝟓----------(12)

We obtained two equations in two variables. These are two simultaneous equations.

𝟎. 𝟔 𝒒𝟏 + 𝟎. 𝟐 𝒒𝟐 = 𝟓𝟗𝟖. 𝟖 -------(11)

𝟎. 𝟐 𝒒𝟏 + 𝟎. 𝟒 𝒒𝟐 = 𝟒𝟗𝟖. 𝟓----------(12)

Multiply equation (12) by “𝟑” & subtract from equation (11), we get

𝑒𝑞(11) ⇒ 𝟎. 𝟔 𝒒𝟏 + 𝟎. 𝟐 𝒒𝟐 = 𝟓𝟗𝟖. 𝟖

[𝑒𝑞(12) × 3] ⇒ 𝟎. 𝟔 𝒒𝟏 + 𝟏. 𝟐 𝒒𝟐 = 𝟏𝟒𝟗𝟓. 𝟓

[𝑒𝑞(12) × 3] − 𝑒𝑞(11) ⇒ 𝟎. 𝟔 𝒒𝟏 + 𝟏. 𝟐 𝒒𝟐 − [𝟎. 𝟔 𝒒𝟏 + 𝟎. 𝟐 𝒒𝟐 ] = 𝟏𝟒𝟗𝟓. 𝟓 − 𝟓𝟗𝟖. 𝟖

⇒ 𝟎. 𝟔 𝒒𝟏 + 𝟏. 𝟐 𝒒𝟐 − 𝟎. 𝟔 𝒒𝟏 − 𝟎. 𝟐 𝒒𝟐 = 𝟏𝟒𝟗𝟓. 𝟓 − 𝟓𝟗𝟖. 𝟖

⇒ 𝟏. 𝟐 𝒒𝟐 − 𝟎. 𝟐 𝒒𝟐 = 𝟖𝟗𝟕

⇒ 𝒒𝟐 = 𝟖𝟗𝟕 ---------(13)

Putting value of equation (13) in equation (11), we get

𝟎. 𝟔 𝒒𝟏 + 𝟎. 𝟐 𝒒𝟐 = 𝟓𝟗𝟖. 𝟖

⇒ 𝟎. 𝟔 𝒒𝟏 + 𝟎. 𝟐 (𝟖𝟗𝟕) = 𝟓𝟗𝟖. 𝟖

⇒ 𝟎. 𝟔 𝒒𝟏 + 𝟏𝟕𝟗. 𝟒 = 𝟓𝟗𝟖. 𝟖

⇒ 𝟎. 𝟔 𝒒𝟏 = 𝟓𝟗𝟖. 𝟖 − 𝟏𝟕𝟗. 𝟒

⇒ 𝟎. 𝟔 𝒒𝟏 = 𝟒𝟏𝟗. 𝟒
𝟒𝟏𝟗.𝟒
⇒ 𝒒𝟏 =
𝟎.𝟔

⇒ 𝒒𝟏 = 𝟔𝟗𝟗 ---------(14)

Hence,

• 𝒒𝟏 = 𝟔𝟗𝟗
• 𝒒𝟐 = 𝟖𝟗𝟕

So, the critical point is

(𝒒𝟏 , 𝒒𝟐 ) = (𝟔𝟗𝟗, 𝟖𝟗𝟕)

Step 4: Find Second Derivatives


𝝏𝟐 𝑷
Find 𝑷𝒒𝟏 𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) =
𝝏𝒒𝟏 𝟐

Partially differentiate 𝑷𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) w.r.t variable 𝒒𝟏 , we have

𝝏𝟐 𝑷 𝝏
𝑷𝒒𝟏 𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = 𝟐
= (−𝟎. 𝟔 𝒒𝟏 − 𝟎. 𝟐 𝒒𝟐 + 𝟓𝟗𝟖. 𝟖)
𝝏𝒒𝟏 𝝏𝒒𝟏

𝝏𝟐 𝑷
𝑷𝒒𝟏 𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟔(𝟏) − 𝟎 + 𝟎 = −𝟎. 𝟔
𝝏𝒒𝟏 𝟐

𝝏𝟐 𝑷
𝑷𝒒𝟏 𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟔
𝝏𝒒𝟏 𝟐
𝝏𝟐 𝑷
Find 𝑷𝒒𝟐 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) =
𝝏𝒒𝟐 𝟐

Partially differentiate 𝑷𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) w.r.t variable 𝒒𝟐 , we have

𝝏𝟐 𝑷 𝝏
𝑷𝒒𝟐 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = 𝟐
= (−𝟎. 𝟐 𝒒𝟏 − 𝟎. 𝟒 𝒒𝟐 + 𝟒𝟗𝟖. 𝟓)
𝝏𝒒𝟐 𝝏𝒒𝟐

𝝏𝟐 𝑷
𝑷𝒒𝟐 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = 𝟎 − 𝟎. 𝟒(𝟏) = −𝟎. 𝟒
𝝏𝒒𝟐 𝟐
𝝏𝟐 𝑷
𝑷𝒒𝟐 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟒
𝝏𝒒𝟐 𝟐
𝝏𝟐 𝑷
Find 𝑷𝒒𝟏 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) =
𝝏𝒒𝟐 𝝏𝒒𝟏

Partially differentiate 𝑷𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) w.r.t variable 𝒒𝟐 , we have

𝝏𝟐 𝑷 𝝏
𝑷𝒒𝟏 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = (−𝟎. 𝟔 𝒒𝟏 − 𝟎. 𝟐 𝒒𝟐 + 𝟓𝟗𝟖. 𝟖)
𝝏𝒒𝟐 𝝏𝒒𝟏 𝝏𝒒𝟐

𝝏𝟐 𝑷
𝑷𝒒𝟏 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = 𝟎 − 𝟎. 𝟐(𝟏) = −𝟎. 𝟐
𝝏𝒒𝟐 𝝏𝒒𝟏

𝝏𝟐 𝑷
𝑷𝒒𝟏𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟐
𝝏𝒒𝟐 𝝏𝒒𝟏

Step 5: Find Second Derivative value at critical point(s)


𝝏𝟐 𝑷
𝑷𝒒𝟏 𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟔
𝝏𝒒𝟏 𝟐

𝝏𝟐 𝑷
𝑷𝒒𝟐 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟒
𝝏𝒒𝟐 𝟐

𝝏𝟐 𝑷
𝑷𝒒𝟏 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = = −𝟎. 𝟐
𝝏𝒒𝟐 𝝏𝒒𝟏

For critical point (𝒒𝟏 , 𝒒𝟐 ) = (𝟔𝟗𝟗, 𝟖𝟗𝟕)


𝑷𝒒𝟏 𝒒𝟏 (𝒒𝟏 , 𝒒𝟐 ) = −𝟎. 𝟔 ⇒ 𝑷𝒒𝟏𝒒𝟏 (𝟔𝟗𝟗, 𝟖𝟗𝟕) = −𝟎. 𝟔 < 𝟎

𝑷𝒒𝟐 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = −𝟎. 𝟒 ⇒ 𝑷𝒒𝟐𝒒𝟐 (𝟔𝟗𝟗, 𝟖𝟗𝟕) = −𝟎. 𝟒

𝑷𝒒𝟏 𝒒𝟐 (𝒒𝟏 , 𝒒𝟐 ) = −𝟎. 𝟐 ⇒ 𝑷𝒒𝟏𝒒𝟐 (𝟔𝟗𝟗, 𝟖𝟗𝟕) = −𝟎. 𝟐

Step 6: Apply Second Derivative Test


𝟐
𝑫 = 𝑷𝒒𝟏𝒒𝟏 (𝟔𝟗𝟗, 𝟖𝟗𝟕)𝑷𝒒𝟐𝒒𝟐 (𝟔𝟗𝟗, 𝟖𝟗𝟕) − [ 𝑷𝒒𝟏𝒒𝟐 (𝟔𝟗𝟗, 𝟖𝟗𝟕) ]
Putting values in the formula, we get

𝑫 = [−𝟎. 𝟔][−𝟎. 𝟒] − [−𝟎. 𝟐 ]𝟐


⇒ 𝑫 = 𝟎. 𝟐𝟒 − 𝟎. 𝟎𝟒
⇒ 𝑫 = 𝟎. 𝟐 > 𝟎

Check the function has local maxima/minimum or neither


Since 𝑫 = 𝟎. 𝟐 > 𝟎 and 𝑷𝒒𝟏 𝒒𝟏 (𝟔𝟗𝟗, 𝟖𝟗𝟕) = −𝟎. 𝟔 < 𝟎, so by using
2nd derivative test, the given function 𝑷(𝒒𝟏 , 𝒒𝟐 ) has a local maxima at critical
point (𝟔𝟗𝟗, 𝟖𝟗𝟕). This means that the company should produce 𝟔𝟗𝟗 units of
product 𝒒𝟏 and 𝟖𝟗𝟕 units of 𝒒𝟐 .

Find the Maximum Profit


Since the profit function is

𝑷(𝒒𝟏 , 𝒒𝟐 ) = −𝟎. 𝟑𝒒𝟐𝟏 − 𝟎. 𝟐𝒒𝟐𝟐 + 𝟓𝟗𝟖. 𝟖𝒒𝟏 + 𝟒𝟗𝟖. 𝟓𝒒𝟐 − 𝟎. 𝟐𝒒𝟏 𝒒𝟐 − 𝟏𝟔

Substituting the values 𝒒𝟏 = 𝟔𝟗𝟗 and 𝒒𝟐 = 𝟖𝟗𝟕 in above function, we get


𝑷(𝒒𝟏 , 𝒒𝟐 ) = −𝟎. 𝟑(𝟔𝟗𝟗)𝟐 − 𝟎. 𝟐(𝟖𝟗𝟕)𝟐 + 𝟓𝟗𝟖. 𝟖(𝟔𝟗𝟗) + 𝟒𝟗𝟖. 𝟓(𝟖𝟗𝟕) − 𝟎. 𝟐(𝟔𝟗𝟗)(𝟖𝟗𝟕) − 𝟏𝟔

⇒ 𝑷(𝒒𝟏 , 𝒒𝟐 ) = −𝟏𝟒𝟔𝟓𝟖𝟎. 𝟑 − 𝟏𝟔𝟎𝟗𝟐𝟏. 𝟖 + 𝟒𝟏𝟖𝟓𝟔𝟏. 𝟐 + 𝟒𝟒𝟕𝟏𝟓𝟒. 𝟓 − 𝟏𝟐𝟓𝟒𝟎𝟎. 𝟔 − 𝟏𝟔

⇒ 𝑷(𝒒𝟏 , 𝒒𝟐 ) = 𝟒𝟑𝟐𝟕𝟗𝟕

Hence, the maximum profit would be

Maximum Profit = 𝑷(𝟔𝟗𝟗, 𝟖𝟗𝟕) = $ 𝟒𝟑𝟐, 𝟕𝟗𝟕.

----------------------------------------------------------------------------------------------------
Example:
A company operates two plants which manufacture the same item and whose total
functions are

𝐶1 = 8.5 + 0.03𝑞12 and 𝐶2 = 5.2 + 0.04𝑞22

where 𝑞1 and 𝑞2 are the quantities produced by each plant. The company is a
monopoly. The total quantity demanded, 𝑞 = 𝑞1 + 𝑞2 , is related to the price, 𝑃, by

𝑃 = 60 − 0.04𝑞.

How much should each plant produce in order to maximize the company’s profit?

Solution:

Profit = Revenue − Cost

As Revenue = Price × Quantity

= 𝑃 × 𝑞 = (60 − 0.04𝑞) × (𝑞)

= 60𝑞 − 0.04𝑞 2

= 60(𝑞1 + 𝑞2 ) − 0.04(𝑞1 + 𝑞2 )2

= 60𝑞1 + 60𝑞2 − 0.04(𝑞12 + 𝑞22 + 2𝑞1 𝑞2 )

Revenue = 60𝑞1 + 60𝑞2 − 0.04𝑞12 − 0.04𝑞22 − 0.08𝑞1 𝑞2

Profit = 60𝑞1 + 60𝑞2 − 0.04𝑞12 − 0.04𝑞22 − 0.08𝑞1 𝑞2 − (8.5 + 0.03𝑞12 + 5.2


+ 0.04𝑞22 )

= 60𝑞1 + 60𝑞2 − 0.04𝑞12 − 0.04𝑞22 − 0.08𝑞1 𝑞2 − 13.7 − 0.03𝑞12 − 0.04𝑞22

𝑓(𝑞1 , 𝑞2 ) = −0.07𝑞12 − 0.08𝑞22 − 0.08𝑞1 𝑞2 + 60𝑞1 + 60𝑞2 − 13.7

𝑓𝑞1 = −0.14𝑞1 − 0.08𝑞2 + 60


𝑓𝑞2 = −0.16𝑞2 − 0.08𝑞1 + 60

𝑓𝑞1 = 𝑓𝑞2 = 0 implies

−0.14𝑞1 − 0.08𝑞2 + 60 = 0

−0.16𝑞2 − 0.08𝑞1 + 60 = 0

0.14𝑞1 + 0.08𝑞2 = 60 … (1)

0.08𝑞1 + 0.16𝑞2 = 60 … (2)

Multiply equation (1) by 0.08 & equation (2) by 0.14 then subtract it from equation
(1).

0.0112𝑞1 + 0.0064𝑞2 = 4.8

±0.0112𝑞1 ± 0.0224𝑞2 = ±8.4

−0.016𝑞2 = −3.6

𝑞2 = 225

Put in (1)

0.14𝑞1 + 0.08(225) = 60

0.14𝑞1 = 60 − 18
42
𝑞1 = = 300
0.14
𝑞1 = 300

So (𝑞1 , 𝑞2 ) = (300, 225) is a critical point of 𝑓.

𝑓𝑞1𝑞1 = −0.14 𝑓𝑞1𝑞2 = −0.08 𝑓𝑞2𝑞2 = −0.16


2
𝐷 = 𝑓𝑞1𝑞1 ∗ 𝑓𝑞2𝑞2 − (𝑓𝑞1𝑞2 ) = (−0.14) ∗ (−0.16) − (−0.8)2
= −0.0224 − 0.0064 = 0.016 > 0

As, 𝐷 > 0 and 𝑓𝑞1𝑞1 = −0.14 < 0 so, 𝑓 has a local maxima at (300, 225)

The plant should produce 300 units of 𝑞1 and 225 units of 𝑞2 .

Textbook Practice Problems

Applied Calculus (4ht Edition) by Huges Hallet Ex. 9.5: 18 – 21.

Practice Problems
Question: An automobile manufacturer sells cars in America and Europe, charging
different prices in the two markets. The price function for cars sold in America is
𝒑 = 𝟐𝟎 − 𝟎. 𝟐𝒙 thousand dollars (for 𝟎 ≤ 𝒙 ≤ 𝟏𝟎𝟎), and the price function
for cars sold in Europe is 𝒒 = 𝟏𝟔 − 𝟎. 𝟏𝒚 thousand dollars (for 𝟎 ≤ 𝒚 ≤ 𝟏𝟔𝟎),
where 𝒙 is the quantity of cars sold per day in America and 𝒚 is the quantity of cars
sold per day in Europe, respectively. The company’s cost function in per thousand
dollars is 𝑪 = 𝟐𝟎 + 𝟒(𝒙 + 𝒚).

a) Find the company’s profit function. [Hint: Profit is revenue from America
plus revenue from Europe minus costs, where each revenue is price times
quantity.]

b) Find how many cars should be sold in each market to maximize profit.
Also find the price for each market.

You might also like