Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given a function $g(x,y,z)$ we need to maximize it given constraints $a<x<b, a<y<b$.

If the constraints were given as a function $f(x,y,z)$ the following equation could be used.

$\nabla f(x,y,z) = \lambda \nabla g(x,y,z)$

How would I set up the initial equation given an interval constraint. Or how would I turn the interval constraint into a function constraint.

EDIT:: Added $a<y<b$ to the constraints.

share|cite|improve this question
Hint: consider a function such as $(x-(a+b)/2)^2$ – Jonathan Christensen Nov 10 '12 at 19:51

Maximize $g$ ignoring the constraint. If the solution fulfills the constraint, you're done. If not, there's no maximum, since it would have to lie on the boundary, but the boundary is excluded by the constraint.

share|cite|improve this answer
Isn't that the same as taking the first/second partial derivative test ? Thus essentially not using Lagrange? What if the question specifically asks to use Lagrange ? – Kassym Dorsel Nov 10 '12 at 19:40
@Kassym: I don't see how it could make sense for the question to specifically ask to use a Lagrange multiplier. Even if the constraint were $a\le x\le b$, so you could find a maximum on the boundary, you'd still just have to substitute $a$ and $b$ for $x$ -- the only situation in which you'd need a Lagrange multiplier would be if the constraint were of the form $a\le f(x,y,z)\le b$; then, if the unconstrained maximization wouldn't yield a maximum satisfying the constraint, you could find the maximum on the boundary by setting $f(x,y,z)$ to $a$ and $b$ and then using a Lagrange multiplier. – joriki Nov 10 '12 at 19:52
@Kassym: Often people misunderstand problems and then present them in the misunderstood form, and there's no way to know what went wrong. You may want to quote the question verbatim to make sure that's not what's happened here. – joriki Nov 10 '12 at 19:56 – Kassym Dorsel Nov 10 '12 at 20:40
@Kassym: Your question has little to do with the problem in that image, which does indeed require Lagrange multipliers. Next time please take more care in describing the problem, or provide a verbatim quote or link right away; that would have saved everyone a lot of time. – joriki Nov 11 '12 at 10:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.