Results 1 to 11 of 11

Thread: Question about Lagrange multipliers for maximizing a function with two constraints

  1. #1
    Newbie
    Joined
    Nov 2017
    From
    Europe
    Posts
    4

    Question about Lagrange multipliers for maximizing a function with two constraints

    Hi everyone.

    I'm not that familiar with English math terminology so I hope that you'll bear with me.

    Currently, I'm trying to maximize a function with two constraints, but I got stuck because of one of my constraints. My first constraint has both the variables x and y, but my second constraint only has the variabley. The reason why I'm confused by this is that when I proceed to solve the problem, I have no use for the Lagrange multiplier λ. I can simply solve the partial differential for λ1 and λ2. This will enough to yield my results (the x and y coordinates). It is frustrating me because I need to put it into words, what I am doing (in terms of using Lagrange multipliers) and why I apparently had to skip the λ all together.

    The function that I'm trying to maximize is as follows:
    𝑓(𝑥, &#119910 = −0,01𝑥2 + 395𝑥 + 100

    My constraints are these:
    2𝑥 + 𝑦 ≤ 44,000
    𝑦 ≤ 20,000

    I know that the correct answer (through using other methods) is:
    x = 12,000
    y = 20,000

    The way that I've proceeded to solve this problem is by putting the respective functions and constraints into an algorithm:
    L(x ,y, λ1, λ2) = −0,01𝑥2 + 395𝑥 + 100 - λ1 * (2𝑥 + 𝑦 - 44,000) - λ2 * (𝑦 - 20,000)

    Then finding the partial differentials of x, y, λ1 and λ2 to ultimately isolate x and y. I am getting the correct results, but there's no need to find the partial differentials of x and y?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Feb 2014
    From
    United States
    Posts
    1,748
    Thanks
    808

    Re: Question about Lagrange multipliers for maximizing a function with two constraint

    $2 + \le 44000$ means what? Is there supposed to be a variable in there?

    $\le 20000$ does not mean anything. There is nothing on the left hand side of the inequation.

    If you have two constraints, you will have $\lambda_1$ and $\lambda_2$ And no $\lambda.$

    But of course you are not multiplying your lambdas by anything except a constant so they have no effect on anything.

    Please indicate what the constraints are, and we can proceed from there.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor

    Joined
    Apr 2005
    Posts
    19,843
    Thanks
    3064

    Re: Question about Lagrange multipliers for maximizing a function with two constraint

    The original post does not seem to have been edited but I see "$\displaystyle 2x+ y\le 44000$" and "$\displaystyle y\le 20000$".
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Feb 2014
    From
    United States
    Posts
    1,748
    Thanks
    808

    Re: Question about Lagrange multipliers for maximizing a function with two constraint

    Quote Originally Posted by HallsofIvy View Post
    The original post does not seem to have been edited but I see "$\displaystyle 2x+ y\le 44000$" and "$\displaystyle y\le 20000$".
    Actually I do not even see a function with variables.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor

    Joined
    Apr 2005
    Posts
    19,843
    Thanks
    3064

    Re: Question about Lagrange multipliers for maximizing a function with two constraint

    I see (minus some strange characters) the object function $\displaystyle f(x, y)= -0.01x^2+ 395x+ 100$ which, oddly, is a function of x only!

    johndoe69, differentiating the object function minus $\displaystyle \lamda_1$ and $\displaystyle \lambda_2$ times the constraints with respect to $\displaystyle \lambda_1$ and $\displaystyle \lambda_2$ just give the constraints again which does not really help- you already know them. It is the derivatives with respect to x and y that are crucial! I do not understand why you say "there's no need to find the partial derivatives o x and y" (I assume you mean "with respect to x and y).
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Nov 2017
    From
    Europe
    Posts
    4

    Re: Question about Lagrange multipliers for maximizing a function with two constraint

    Yes, I see that there's been some problems with the formatting and some "spelling" issues when writing the equations. I'm not used to using LaTeX, but I'll try to rewrite some of the confusing things. Is there a way to edit/delete my original post, or do I have to write another reply to this thread?

    EDIT: For now, I suppose I'll add it to the rest of this reply:


    Hi everyone.

    I'm not that familiar with English math terminology so I hope that you'll bear with me.

    Currently, I'm trying to maximize a function with two constraints, but I got stuck because of one of my constraints. My first constraint has both the variables $\displaystyle x$ and $\displaystyle y$, but my second constraint only has the variabley. The reason why I'm confused by this is that when I proceed to solve the problem, I have no use for the Lagrange multiplier $\displaystyle \lambda$. I can simply solve $\displaystyle L_{\lambda_{1}} = 0$ and $\displaystyle L_{\lambda_{2}} = 0$. This will enough to yield my results (the $\displaystyle x$ and $\displaystyle y$ coordinates). It is frustrating me because I need to put it into words, what I am doing (in terms of using Lagrange multipliers) and why I apparently had to skip the $\displaystyle \lambda$ all together.

    The function that I'm trying to maximize is as follows:

    $\displaystyle f(x,y) = -0,01x^2 + 395x + 100y$


    My constraints are these:

    $\displaystyle 2x + y \leq 44,000$

    $\displaystyle y \leq 20,000$


    I know that the correct answer (through using other methods) is:

    $\displaystyle x = 12,000$

    $\displaystyle y = 20,000$


    The way that I've proceeded to solve this problem is by putting the respective functions and constraints into an algorithm:

    $\displaystyle L(x, y, \lambda_{1}, \lambda_{2}) = -0,01x^2 + 395x + 100y - \lambda_{1} * (2x + y - 44,000) - \lambda_{2} * (y - 20,000)$

    Then figuring out the partial differentials with respect to $\displaystyle x$, $\displaystyle y$, $\displaystyle \lambda_{1}$ and $\displaystyle \lambda_{2}$ to ultimately isolate $\displaystyle \lambda_{1}$ and $\displaystyle \lambda_{2}$. I am getting the correct results, but there's no need to solve $\displaystyle L_x = 0$ and $\displaystyle L_y = 0$?


    My partial derivatives are as follows:

    $\displaystyle L_x = -0.02x + 395 - 2\lambda_{1}$

    $\displaystyle L_y = 100 - \lambda_{1}$

    $\displaystyle L_{\lambda_{1}} = -2x - y + 44,000$

    $\displaystyle L_{\lambda_{2}} = -y + 20,000$
    Last edited by johndoe69; Nov 18th 2017 at 12:15 PM.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor
    Joined
    Nov 2013
    From
    California
    Posts
    6,164
    Thanks
    2618

    Re: Question about Lagrange multipliers for maximizing a function with two constraint

    You've set $L$ up correctly

    $\nabla L = \left(-2 \lambda _1-\dfrac{x}{50}+395,-\lambda _1-\lambda _2+100,-2 x-y+44000,20000-y\right)$

    and each term must be set to 0 and the system solved .

    The partials with respect to the $\lambda$'s are just the constraint conditions.

    This system is easily solved as

    $(x,y,\lambda_1, \lambda_2) = \left( 12000,20000,\dfrac{155}{2}, \dfrac{45}{2} \right)$
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Super Member
    Joined
    Jun 2013
    From
    Lebanon
    Posts
    842
    Thanks
    395

    Re: Question about Lagrange multipliers for maximizing a function with two constraint

    The method of Lagrange multipliers (with two constraints)

    max or min $\displaystyle f(x,y)$ subject to the constraints $\displaystyle g(x,y)=0$ and $\displaystyle h(x,y)=0$

    The constraints are supposed to be equations not inequalities

    So how can we apply Lagrange multipliers if the constraints are inequalities?
    Last edited by Idea; Nov 18th 2017 at 11:26 PM.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Nov 2017
    From
    Europe
    Posts
    4

    Re: Question about Lagrange multipliers for maximizing a function with two constraint

    Quote Originally Posted by Idea View Post
    The constraints are supposed to be equations not inequalities
    Yeah, so what’s happened there is that I’ve copied over the inequalities from a different method of optimization. But yes, the inequalities are supposed to be equalities for the sake of using Lagrange multipliers.
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Super Member
    Joined
    Jun 2013
    From
    Lebanon
    Posts
    842
    Thanks
    395

    Re: Question about Lagrange multipliers for maximizing a function with two constraint

    Quote Originally Posted by johndoe69 View Post
    Yeah, so what’s happened there is that I’ve copied over the inequalities from a different method of optimization. But yes, the inequalities are supposed to be equalities for the sake of using Lagrange multipliers.
    so now the problem becomes trivial
    because the solution of the system of equations

    $\displaystyle 2x+y=44000$

    $\displaystyle y=20000$

    is a single point $\displaystyle (x=12000,y=20000)$

    no need for Lagrange multipliers or anything else to find the max/min of f
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Newbie
    Joined
    Nov 2017
    From
    Europe
    Posts
    4

    Re: Question about Lagrange multipliers for maximizing a function with two constraint

    Quote Originally Posted by Idea View Post
    no need for Lagrange multipliers or anything else to find the max/min of f
    Could there be an excuse, however, to use Lagrange multipliers? I'm doing it as part of some school work, but I don't have time to rewrite the whole paper using different numbers and equations to make it not so trivial. I could just go ahead and explain after the fact that there was no need for Lagrange multipliers?
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Question about Lagrange Multipliers
    Posted in the Calculus Forum
    Replies: 3
    Last Post: Dec 2nd 2015, 06:31 AM
  2. Replies: 9
    Last Post: Jul 12th 2014, 09:44 PM
  3. Lagrange Multipliers: Two Constraints.
    Posted in the Calculus Forum
    Replies: 1
    Last Post: Nov 24th 2013, 02:45 AM
  4. Lagrange Multipliers (Question)
    Posted in the Calculus Forum
    Replies: 4
    Last Post: Mar 7th 2010, 03:57 AM
  5. Lagrange multipliers with 2 constraints
    Posted in the Calculus Forum
    Replies: 1
    Last Post: Aug 9th 2008, 09:14 AM

Search Tags


/mathhelpforum @mathhelpforum