Introduction
A fixed sum does not fix a product. If two real numbers must add to a specified value, their product changes as one number increases and the other decreases. Lagrange multipliers locate the stationary candidate, but the real domain requires us to check what that candidate means and whether a minimum exists.
Throughout, let \(s\) be any fixed real number. We allow \(x\) and \(y\) to be arbitrary real numbers; neither is required to be positive. The objective is \(f(x,y)=xy\), and the constraint is \(x+y=s\).
Set Up the Lagrange Equations
Write the constraint as \(g(x,y)=x+y-s=0\). The objective and constraint are differentiable, and \(\nabla g=(1,1)\), which is nonzero at every feasible point. Thus the constraint is regular everywhere on the feasible line, so the Lagrange condition applies at any constrained local extremum.
Using the convention \(\nabla f=\lambda\nabla g\), the equations are
The first two coordinate equations give \(y=\lambda\) and \(x=\lambda\), so \(x=y\). Substituting into the constraint gives \(2x=s\). Therefore there is exactly one Lagrange candidate, \((s/2,s/2)\), and its product is \(s^2/4\).
Worked Examples
Worked Example: Fixed Sum of 12
Maximize \(xy\) subject to \(x+y=12\), with \(x,y\in\mathbb{R}\). Here \(g(x,y)=x+y-12\), so \(\nabla g=(1,1)\), while \(\nabla f=(y,x)\). The Lagrange equations are \(y=\lambda\), \(x=\lambda\), and \(x+y=12\). Thus \(x=y\), and \(2x=12\), giving \(x=6\) and \(y=6\).
The candidate satisfies the constraint because \(6+6=12\). Its objective value is \(xy=6\cdot 6=36\). To check that it is the global maximum, take any feasible pair and use \(x+y=12\):
Equality holds when \(x-y=0\), that is, at \(x=y=6\). The candidate therefore attains the largest possible product, and the equality condition confirms that it is the unique maximizing pair.
Worked Example: Fixed Sum of Negative Eight
Maximize \(xy\) subject to \(x+y=-8\). As before, the constraint gradient is \((1,1)\) and the objective gradient is \((y,x)\). The equations \(y=\lambda\) and \(x=\lambda\) imply \(x=y\). Then \(2x=-8\), so \(x=-4\) and \(y=-4\).
Check the constraint: \(-4+(-4)=-8\). The candidate product is \((-4)(-4)=16\). For any feasible pair,
Equality holds only when \(x-y=0\), so \((-4,-4)\) is the unique maximizing pair. This example also shows why the sign of the sum matters: when \(s<0\), the maximizing factors are both negative, but their product is positive.
Worked Example: Fixed Sum of Zero
Maximize \(xy\) subject to \(x+y=0\). The Lagrange equations again give \(x=y\). Together with \(x+y=0\), this gives \(2x=0\), hence \(x=0\) and \(y=0\). The constraint check is \(0+0=0\), and the candidate product is \(0\cdot 0=0\).
For any feasible pair, the identity for the product gives
Thus the candidate attains the global maximum, with equality only when \(x=y\), which under the constraint means \(x=y=0\). There is no minimum: for each real \(t\), the pair \((t,-t)\) is feasible and has product \(-t^2\), which decreases without bound as \(|t|\) increases.
Why the Candidate Is a Global Maximum
The examples use the same identity. For any real \(x\) and \(y\), expanding the squares gives \((x+y)^2=x^2+2xy+y^2\) and \((x-y)^2=x^2-2xy+y^2\). Subtracting the second equation from the first yields \((x+y)^2-(x-y)^2=4xy\). Therefore, on the constraint \(x+y=s\),
Because a square is nonnegative, the inequality holds for every feasible real pair. The bound is attained when \(x-y=0\). Combining \(x-y=0\) with \(x+y=s\) gives \(x=y=s/2\). Consequently, this pair is the unique global maximizer, and the maximum product is \(s^2/4\).
This argument also explains the Lagrange condition directly. A small feasible change from \((x,y)\) has the form \((x+t,y-t)\), since the sum remains \(s\). Along this change, the product is \((x+t)(y-t)=xy+t(y-x)-t^2\). Its derivative at \(t=0\) is \(y-x\). At a constrained local extremum that derivative must be zero, so \(x=y\), exactly the condition obtained from the Lagrange equations. The identity above then establishes the global result, not merely a stationary condition.
Feasible Product Values and the Sign of the Sum
The identity determines more than the maximum. As \(x\) and \(y\) range over all real pairs with sum \(s\), their difference \(x-y\) can be any real number. Hence the product has the form \(s^2/4-d^2/4\), where \(d=x-y\) ranges over \(\mathbb{R}\). Its possible values are therefore all real numbers less than or equal to \(s^2/4\).
To check that every such value is attainable, let \(q\le s^2/4\). Then \(s^2-4q\ge 0\). Choose \(d=\sqrt{s^2-4q}\), and set \(x=(s+d)/2\), \(y=(s-d)/2\). These numbers satisfy \(x+y=s\) and \(x-y=d\), so \(xy=(s^2-d^2)/4=q\). Thus the feasible product values are exactly \((-\infty,s^2/4]\).
The sign of \(s\) affects the maximizing factors and whether the maximum is positive:
- If \(s>0\), the maximizing factors \(s/2\) and \(s/2\) are positive, and the maximum \(s^2/4\) is positive.
- If \(s<0\), the maximizing factors are negative, and their product is again positive, with maximum \(s^2/4\).
- If \(s=0\), the maximizing pair is \((0,0)\), and the maximum is \(0\). Every feasible product is nonpositive.
For any value of \(s\), the product has no minimum. To see this without relying on a compactness assumption, choose \(x=t\) and \(y=s-t\). This pair is feasible for every real \(t\), and
Thus no real number can be a lower bound for all feasible product values. The feasible set is noncompact, so finding the Lagrange candidate alone would not answer whether a minimum exists.
A Common Mistake
A tempting but incorrect conclusion is: “The Lagrange equations give equal factors, so the product has a minimum there.” The equations only identify a stationary candidate; they do not say whether it is a maximum or minimum. For example, with sum \(6\), the candidate is \((3,3)\), with product \(9\). But the feasible pair \((10,-4)\) has sum \(6\) and product \(-40\), which is less than \(9\). Taking \(x=t\) and \(y=6-t\) gives product \(6t-t^2\), which tends to \(-\infty\), so there is no minimum at all. The square identity gives the correct direction of the bound: the product is at most \(s^2/4\), not at least that amount.
Why This Problem Is Useful
This problem illustrates an important distinction in constrained optimization. The Lagrange equations locate a point where the objective has no first-order change along the feasible line. A separate argument is needed to decide the nature of that point and to address behavior far away on an unbounded constraint. Here, an exact algebraic identity supplies that global check and also reveals the full range of possible objective values.
It is also important not to add a positivity assumption that is absent from the constraint. If \(s<0\), the maximizing factors are negative; if \(s=0\), they are both zero. The result applies to real variables for every real fixed sum, including cases where the factors are not positive.
Check Your Understanding
Use the real-domain constraint \(x+y=s\) in each question.
- Write the Lagrange equations for maximizing \(xy\) subject to \(x+y=s\), and solve for the candidate.
- What identity proves that the candidate is a global maximum? When does equality hold?
- For \(s=-10\), state the maximizing pair and maximum product. Explain the signs of the factors.
- What is the full set of possible product values for a given real \(s\)?
- Why does no minimum exist, even when the Lagrange equations have a solution?