Finding the Local Max/Min of f(x,y) on C

In summary: I did not claim the method was definitely not valid; I just said it might be invalid. In some problems it will still be valid, in other problems it will definitely not be valid. The problem is that there are theorems about validity of the method that posit certain hypotheses about the objective ##f(x,y)## and the constraint function ##g(x,y)##; typically, we assume that ##f(x,y)## is continuously once-differentiable, at least in a neighbourhood of the solution.
  • #1
Archimedess
23
0
Hi everyone, I'm struggling with this problem:

Let ##f(x,y) =
\begin{cases}
(x-y)\ln(y-x) & \text{if } y>x \\
0 & \text{if } y\leq x
\end{cases}## and let ##C=\{(x,y)\in \mathbb{R}^2|x^2+y^2=1\}##

Then proof that ##max_Cf=1/e## and ##min_Cf=-(\ln2)/\sqrt2##

My solution:

I used Lagrange multiplier, so I have ##(x-y)\ln(y-x)-\lambda(x^2+y^2-1)=0##, then i have:

##
\begin{cases}
\ln(y-x)+1-2\lambda x=0\\
-\ln(y-x)-1-2\lambda y=0 \\
x^2+y^2-1=0
\end{cases}##

By solving the system (I also checked it with compiler) I only get the local minima which is ##-(ln2)/\sqrt2##, but by solving the system of equation I don't find the local maxima, I don't understand why. Any suggestions?
 
Last edited:
Physics news on Phys.org
  • #2
Archimedess said:
Hi everyone, I'm struggling with this problem:

Let ##f(x,y) =
\begin{cases}
(x-y)ln(y-x) & \text{if } y>x \\
0 & \text{if } y\leq x
\end{cases}## and let ##C=\{(x,y)\in \mathbb{R}^2|x^2+y^2=1\}##

Then proof that ##max_Cf=1/e## and ##min_Cf=-(ln2)/\sqrt2##

My solution:

I used Lagrange multiplier, so I have ##(x-y)ln(y-x)-\lambda(x^2+y^2-1)=0##, then i have:

##
\begin{cases}
ln(y-x)+1-2\lambda x=0\\
-ln(y-x)-1-2\lambda y=0 \\
x^2+y^2-1=0
\end{cases}##

By solving the system (I also checked it with compiler) I only get the local minima which is ##-(ln2)/\sqrt2##, but by solving the system of equation I don't find the local maxima, I don't understand why. Any suggestions?

Your lagrangian expressions are valid only when ##x < y##. In fact, there is some doubt that the Lagrangian method is even valid at all near the "boundary" ##x = y##, because the objective ##f## has discontinuous first-derivatives along that boundary.

BT: please type "\ln" instead of "ln", because the results are more readable: you would get the properly-typeset form ##\ln(y-x)## instead of ##ln(y-x).##
 
  • #3
Ray Vickson said:
Your lagrangian expressions are valid only when ##x < y##. In fact, there is some doubt that the Lagrangian method is even valid at all near the "boundary" ##x = y##, because the objective ##f## has discontinuous first-derivatives along that boundary.

BT: please type "\ln" instead of "ln", because the results are more readable: you would get the properly-typeset form ##\ln(y-x)## instead of ##ln(y-x).##

Thanks for your answer, so the theorem is not valid here. The problem is that I don't know any other method to solve this when Lagrange's theorem is not valid.
 
  • #4
Archimedess said:
Thanks for your answer, so the theorem is not valid here. The problem is that I don't know any other method to solve this when Lagrange's theorem is not valid.

Convert to polar coordinates?

And/or, try ##u = x-y##.
 
Last edited:
  • Like
Likes Archimedess
  • #5
Archimedess said:
Thanks for your answer, so the theorem is not valid here. The problem is that I don't know any other method to solve this when Lagrange's theorem is not valid.

I did not claim the method was definitely not valid; I just said it might be invalid. In some problems it will still be valid, in other problems it will definitely not be valid. The problem is that there are theorems about validity of the method that posit certain hypotheses about the objective ##f(x,y)## and the constraint function ##g(x,y)##; typically, we assume that ##f(x,y)## is continuously once-differentiable, at least in a neighbourhood of the solution.

Anyway, if I were tackling the problem I would avoid the Lagrange-multiplier method. First, I would change variables to ##u=y-x## and ##v = y+x,## so the objective would be ##f(u) = -u \ln(u)## if ##u > 0## and ##f(u) = 0## if ##u \leq 0##. This ##f## is continuous everywhere, but is not differentiable at ##u=0.## The constraint would be ##u^2 + v^2 = 2.## Now the nature of the solution possibilities would be easy to see from a graph of the function ##f(u), u > 0.##

However, if you want to you can get both the maximum and the minimum using Lagrange multipliers applied to the ##u,v## problem. That means that the Lagrange-multiplier method is actually valid for this problem, but for some reason is not easy to deal with in the original ##x,y## variables.

Note added in edit: your original three equations in the three variables ##x,y, \lambda## do, indeed, give both the max and the min solution (plus some extraneous, complex solutions). Maple solves the system completely. However, using the ##u,v## representation is much, much easier, being solvable almost "by inspection" (meaning that hardly any work need be done).
 
Last edited:
  • #6
Archimedess said:
My solution:

I used Lagrange multiplier, so I have ##(x-y)\ln(y-x)-\lambda(x^2+y^2-1)=0##, then i have:

##
\begin{cases}
\ln(y-x)+1-2\lambda x=0\\
-\ln(y-x)-1-2\lambda y=0 \\
x^2+y^2-1=0
\end{cases}##

By solving the system (I also checked it with compiler) I only get the local minima which is ##-(ln2)/\sqrt2##, but by solving the system of equation I don't find the local maxima, I don't understand why. Any suggestions?
I think you did not consider the case λ=0
 
  • Like
Likes PeroK
  • #7
ehild said:
I think you did not consider the case λ=0

I did but,

##\begin{cases}
\ln(y-x)=-1\\
\lambda=0\\
x^2+y^2=1
\end{cases}##

Then I'm stuck here..
 
  • #8
Archimedess said:
I did but,

##\begin{cases}
\ln(y-x)=-1\\
\lambda=0\\
x^2+y^2=1
\end{cases}##

Then I'm stuck here..

##\ln u = -1 \ \Rightarrow \ u = ?##
 
  • #9
PeroK said:
##\ln u = -1 \ \Rightarrow \ u = ?##
##1/e##... yeah, change of variables definitely helps.. thanks
 
  • #10
Ok, here's what I got

##u\ln u+\lambda(u^2+v^2-2)=0##

##\begin{cases}
\ln u+1+2\lambda u=0\\
2\lambda v=0\\
u^2+v^2-2=0
\end{cases}##

The solutions are: ##(1/e,\pm\sqrt{2-1/e^2},0)## and ##(\pm\sqrt{2},0,\frac{\ln\pm\sqrt{2}+1}{\pm2\sqrt{2}})##

By substitution I get ##-1/e## and ##\sqrt{2}\ln\sqrt{2}## but these are not the solution
 
  • #11
Archimedess said:
Ok, here's what I got

##u\ln u+\lambda(u^2+v^2-2)=0##

##\begin{cases}
\ln u+1+2\lambda u=0\\
2\lambda v=0\\
u^2+v^2-2=0
\end{cases}##

The solutions are: ##(1/e,\pm\sqrt{2-1/e^2},0)## and ##(\pm\sqrt{2},0,\frac{\ln\pm\sqrt{2}+1}{\pm2\sqrt{2}})##

By substitution I get ##-1/e## and ##\sqrt{2}\ln\sqrt{2}## but these are not the solution

That was my fault! Note that you have ##u = y - x##.

PS and ##y-x## can only have positive values.
 
Last edited:
  • #12
PeroK said:
That was my fault! Note that you have ##u = y - x##.
The thing is..
if i substitute in ##-u\ln u-\lambda(u^2+v^2-2)=0## the results are correct
else if i substitute in ##u\ln u+\lambda(u^2+v^2-2)=0## the results are not correct..
I don't understand what I'm doing wrong
 
  • #13
Archimedess said:
The thing is..
if i substitute in ##-u\ln u-\lambda(u^2+v^2-2)=0## the results are correct
else if i substitute in ##u\ln u+\lambda(u^2+v^2-2)=0## the results are not correct..
I don't understand what I'm doing wrong

You need ##y-x > 0##. And your function is:

##-(y-x)\ln(y-x)##

You found a maximum at ##y -x = 1/e##. So, you just plug that in. The values of ##x, y## aren't important.

And, you already found the minimum.

If you want to use ##u = y-x##, then ##u## must be positive.
 
  • #14
PeroK said:
You need ##y-x > 0##. And your function is:

##-(y-x)\ln(y-x)##

You found a maximum at ##y -x = 1/e##. So, you just plug that in. The values of ##x, y## aren't important.

And, you already found the minimum.

If you want to use ##u = y-x##, then ##u## must be positive.
Ok, I got it thank you so much everyone
 
  • #15
Archimedess said:
Hi everyone, I'm struggling with this problem:

Let ##f(x,y) =
\begin{cases}
(x-y)\ln(y-x) & \text{if } y>x \\
0 & \text{if } y\leq x
\end{cases}## and let ##C=\{(x,y)\in \mathbb{R}^2|x^2+y^2=1\}##

Then proof that ##max_Cf=1/e## and ##min_Cf=-(\ln2)/\sqrt2##

My solution:

I used Lagrange multiplier, so I have ##(x-y)\ln(y-x)-\lambda(x^2+y^2-1)=0##, then i have:

##
\begin{cases}
\ln(y-x)+1-2\lambda x=0\\
-\ln(y-x)-1-2\lambda y=0 \\
x^2+y^2-1=0
\end{cases}##

By solving the system (I also checked it with compiler) I only get the local minima which is ##-(ln2)/\sqrt2##, but by solving the system of equation I don't find the local maxima, I don't understand why. Any suggestions?

Now that you have the solution, here is another method: adding your two equations above gives ##-2*\lambda*(x+y) = 0,## so you need to solve
$$\begin{array}
(1) \; \ln (y-x) + 1 - 2 \lambda x = 0\\
(2) \; \lambda (x+y) = 0 \\
(3) \; x^2 + y^2 = 1
\end{array}$$
Eq. (2) implies that either ##\lambda = 0## or ##x+y = 0.##

If we set ##\lambda = 0## we have ## \ln(y-x) + 1 = 0## and ##x^2+y^2 = 1##. These are two equations in ##x,y##, so are fairly easily solvable. Instead, if we set ##x+y=0##, then ##y = -x## and so ##f = 2x \ln(-2x)## and ##2 x^2 = 1.##

All that come out automatically in the ##u,v## representation I suggested in #5:
$$ \begin{array}
{}-\ln(u) - 1 - 2 \lambda u = 0\\
\lambda v = 0\\
u^2+v^2=2
\end{array}$$
 
Last edited:

Related to Finding the Local Max/Min of f(x,y) on C

1. What is the definition of a local max/min in terms of a function of two variables?

A local max/min of a function f(x,y) on a curve C is a point (x,y) on C where the value of the function is greater/less than or equal to the values of the function at all other nearby points on C.

2. How do you determine if a critical point is a local max/min?

To determine if a critical point is a local max/min, you can use the Second Derivative Test. If the second derivative of the function evaluated at the critical point is positive, then it is a local minimum. If the second derivative is negative, then it is a local maximum. If the second derivative is zero, then the test is inconclusive and further analysis may be needed.

3. What is the role of the boundary of the curve C in finding the local max/min?

The boundary of the curve C is important because it helps to define the domain of the function f(x,y). This allows us to determine if a critical point on the boundary is a local max/min or a global max/min.

4. Can a function have multiple local max/min on the same curve C?

Yes, a function can have multiple local max/min on the same curve C. This can occur when the curve C is not closed or when there are multiple critical points on the curve.

5. How does finding the local max/min of a function on C relate to real-world applications?

Finding the local max/min of a function on a curve C is important in many real-world applications, such as optimization problems in economics, engineering, and physics. It allows us to find the most efficient or optimal solution for a given situation. For example, in economics, it can help determine the maximum profit for a company or the minimum cost for a project. In engineering, it can help design the most efficient structure. And in physics, it can help find the path of least resistance or maximum potential energy.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
631
  • Calculus and Beyond Homework Help
Replies
10
Views
651
  • Calculus and Beyond Homework Help
Replies
8
Views
579
  • Calculus and Beyond Homework Help
Replies
2
Views
584
  • Calculus and Beyond Homework Help
Replies
6
Views
649
  • Calculus and Beyond Homework Help
Replies
8
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
618
  • Calculus and Beyond Homework Help
Replies
18
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
423
Back
Top