Maximizing a multivariate function under a constraint

In summary: The Attempt at a SolutionSolve for y: x + y = 11 .Plug that into \displaystyle f(x,y) = \frac{1}{x} - \frac{1}{y} , so that you have a function of x only. Solve for y: x + y = 11 .Plug that into \displaystyle f(x,y) = \frac{1}{x} - \
  • #1
Bipolarity
776
2

Homework Statement




Consider [itex] f(x,y) = \frac{1}{x} - \frac{1}{y} [/itex]

You need to maximize [itex] f(x,y) [/itex] given the constraint:
[itex] x + y = 11 [/itex]


Homework Equations


I have never solved a problem like this before. In fact I made up a problem a few minutes ago.


The Attempt at a Solution


I can only imagine graphing f(x,y) on the x,y plane and seeing the maximum point of intersection with the plane of constraint. Actually I am not even sure if that is right.

BiP
 
Physics news on Phys.org
  • #2
Bipolarity said:

Homework Statement



Consider [itex] f(x,y) = \frac{1}{x} - \frac{1}{y} [/itex]

You need to maximize [itex] f(x,y) [/itex] given the constraint:
[itex] x + y = 11 [/itex]

Homework Equations


I have never solved a problem like this before. In fact I made up a problem a few minutes ago.

The Attempt at a Solution


I can only imagine graphing f(x,y) on the x,y plane and seeing the maximum point of intersection with the plane of constraint. Actually I am not even sure if that is right.

BiP

Homework Statement



Homework Equations



The Attempt at a Solution

Solve for y: [itex] x + y = 11 [/itex] .

Plug that into [itex]\displaystyle f(x,y) = \frac{1}{x} - \frac{1}{y} [/itex], so that you have a function of x only.
 
  • #3
SammyS said:
Solve for y: [itex] x + y = 11 [/itex] .

Plug that into [itex]\displaystyle f(x,y) = \frac{1}{x} - \frac{1}{y} [/itex], so that you have a function of x only.

I see. The single-variate function of x that is obtained once I do that: what is its visual relationship to the graphs of f(x,y) and x+y=11 ?

Is it their intersection? It would be helpful to have a visual reference for each step so I can clearly understand what's going on.

BiP
 
  • #4
Bipolarity said:
I see. The single-variate function of x that is obtained once I do that: what is its visual relationship to the graphs of f(x,y) and x+y=11 ?

Is it their intersection? It would be helpful to have a visual reference for each step so I can clearly understand what's going on.

BiP

Say you have a problem of the form max f(x,y), subject to g(x,y) = 0, with both f and g at least once continuously differentiable. In your case
[tex] f(x,y) = \frac{1}{x} - \frac{1}{y} \text{ and } g(x,y) = x+y-11[/tex]
but the basic idea is more general. The constraint g=0 gives a curve C in the (x,y)-plane from which we want to select the point (x,y) giving the largest f. What conditions must hold at the optimal solution p* = (x*,y*) (assuming there IS a finite solution)? Basically, the gradient vectors [itex]Df =\nabla f [/itex] and [itex] Dg = \nabla g[/itex] must be parallel or antiparallel at p*. The reason is this: if [itex]Df[/itex] and [itex]Dg[/itex] point along different lines, there is a nonzero component of [itex]Df [/itex] that is perpendicular to [itex]Dg[/itex], so is tangent to C at the point p*; and that means that by going away from p* (but staying in C), we can make f go up a bit. That would mean that f(p*) is not the maximum. Therefore, to prevent this from happening we need the two gradient vectors to point along the same line (but maybe in opposite directions).

If you imagine a plot of "level curves" of f and g (like the constant-altitude contours in a hiker's area map), then at the point p* the level curves of f and g are parallel---that is, they have the same tangent line.

The geometric property above can be expressed by saying that at p* there is a scalar λ such that [itex] \nabla f = \lambda \nabla g[/itex]. The scalar is usually called the Lagrange Multiplier, and the optimization rule amounts to saying that the so-called Lagrangian
[itex] L = f - \lambda g[/itex] must be stationary at p*; that is, we need [itex] \nabla L = 0[/itex] at p* = (x*,y*). Note that λ is not a function of x or y.

So, let's do this for your problem:
[tex] L = \frac{1}{x}-\frac{1}{y} - \lambda(x+y-11).[/tex]
We have
[tex] \frac{\partial L}{\partial x} = 0 \longrightarrow -\frac{1}{x^2} - \lambda = 0,\\
\frac{\partial L}{\partial y} = 0 \longrightarrow +\frac{1}{y^2} - \lambda = 0.
[/tex]
From this, we see that [itex] x^2 = -y^2[/itex] at [itex] x = x^*,\, y = y^*,[/itex] and that can only happen if [itex] x^* = y^* = 0.[/itex] But f(0,0) is not defined, so there is no optimal solution. You can also see that this is the case by substituting y = 11-x into f and looking at a plot of the result.

A nicer example would be to take [tex] f = \frac{1}{x} + \frac{2}{y}[/tex] and keeping the same g as before. Now you would get [tex] L = \frac{1}{x} + \frac{2}{y} - \lambda (x+y-11), [/tex] and so
[tex] \frac{\partial L}{\partial x} = -\frac{1}{x^2} - \lambda = 0,\\
\frac{\partial L}{\partial y} = -\frac{2}{y^2} - \lambda = 0,\\
x+y=11,[/tex]
so either (1)
[tex] x = 11\sqrt{2}-11, \; y = 22 - 11\sqrt{2}, \; \lambda = -\frac{3+2\sqrt{2}}{121},[/tex]
or (2)
[tex] x = -11 - 11 \sqrt{2}, \; y = 22 + 11\sqrt{2}, \; \lambda = -\frac{3 - 2\sqrt{2}}{121}.[/tex]

It turns out that point (1) is a maximum while point (2) is a minimum. In general we would need to perform second-order tests to check whether a point is a max or a min (or neither), because just looking at gradients equal to zero does not tell us whether the point is a max or a min. However, in this case we can just evaluate f at the two points to see which is which.

Note: by max and min above, we mean local max and min, not global. In this case there are no global max or min values, because we can have [itex] f \rightarrow + \infty[/itex] by letting x go to zero from above (keeping y = 11-x), or letting x go to 11 from below (so y goes to zero from above). Similarly, we can have [itex] f \rightarrow -\infty[/itex] by letting x go to zero from below or go to 11 from above.

RGV
 
Last edited:

1. What is a multivariate function?

A multivariate function is a mathematical function that depends on more than one variable. This means that the output of the function is determined by multiple input variables, rather than just one.

2. How do you maximize a multivariate function?

To maximize a multivariate function, you must find the values of the input variables that result in the highest possible output value. This is typically done by taking the partial derivatives of the function with respect to each input variable and setting them equal to 0. Solving this system of equations will give you the maximum values for each input variable.

3. What is a constraint in relation to a multivariate function?

A constraint is a condition or limitation that must be satisfied when maximizing a multivariate function. This can be in the form of an inequality or an equation that must be true for the solution to be valid. Constraints can represent real-world limitations or boundaries on the input variables.

4. How do you incorporate a constraint when maximizing a multivariate function?

To incorporate a constraint, you can either add it to the multivariate function as an additional term or use it to eliminate one of the variables in the system of equations used to find the maximum values. This will ensure that the solution satisfies the constraint.

5. What are some real-world applications of maximizing a multivariate function under a constraint?

Maximizing a multivariate function under a constraint is a common problem in various fields, including economics, engineering, and operations research. It can be used to optimize production processes, allocate resources, and make strategic decisions in business. It is also important in mathematical modeling and scientific research to find the best solutions to complex problems.

Similar threads

  • Calculus and Beyond Homework Help
Replies
8
Views
455
  • Calculus and Beyond Homework Help
Replies
2
Views
531
  • Calculus and Beyond Homework Help
Replies
4
Views
969
  • Calculus and Beyond Homework Help
Replies
2
Views
452
  • Calculus and Beyond Homework Help
Replies
18
Views
1K
  • Calculus and Beyond Homework Help
Replies
17
Views
1K
  • Calculus and Beyond Homework Help
Replies
10
Views
2K
  • Calculus and Beyond Homework Help
Replies
13
Views
250
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
Replies
9
Views
703
Back
Top