Tutorials › Calculus I › Maximizing A Product With A Fixed Sum

Optimization and Newton's Method · Tutorial 876 of 1495

Maximizing A Product With A Fixed Sum

Use differentiation and a global argument to show that, for a fixed positive sum, the product of positive quantities is largest when all the quantities are equal.

Advanced 10 min read

What You'll Learn

  • Set up the product objective when the sum of positive quantities is fixed
  • Differentiate the two-quantity product and locate its maximum
  • Prove that equal quantities uniquely maximize the product for any finite number of quantities
  • Calculate maximum products for specific sums and numbers of quantities
  • Recognize common errors involving derivatives and global maxima

Why Equal Shares Maximize a Product

A fixed total can be divided among several positive quantities in many ways. If the goal is to maximize their product, how should the total be divided? The answer is that equal quantities give the largest product. Differentiation shows why this is true for two quantities, and a pairwise argument extends the conclusion to any finite number.

This result concerns a product, not a sum: when the sum is fixed, every feasible allocation has the same sum, but the products can differ substantially. The result applies when the quantities may be any positive real numbers; it does not assume they must be whole numbers.

Definition: For \(n\in\mathbb{N}\) positive quantities \(x_1,\dots,x_n\) with fixed sum \(S>0\), the product objective is \(P=x_1x_2\cdots x_n\), subject to \(x_1+x_2+\cdots+x_n=S\) and \(x_i>0\) for every \(i\).

Since the sum is fixed, the variables are constrained: choosing \(n-1\) quantities determines the last one. The feasible allocations form the positive part of a simplex. We will first examine the two-quantity case, then prove the general result.

Two Quantities: Differentiate the Product

Suppose two positive quantities \(x\) and \(y\) have fixed sum \(S\). Eliminate \(y\) using \(y=S-x\). Positivity requires \(0<x<S\), and the product becomes a function of one variable:

$$ P(x)=x(S-x)=Sx-x^2. $$

Its derivative is \(P'(x)=S-2x\). The only critical point in the feasible interval is \(x=S/2\), which also gives \(y=S/2\). The second derivative is \(P''(x)=-2<0\), so the product curves downward there. At either limiting endpoint, one quantity tends to zero and so does the product. Thus the equal split is the global maximum.

Worked Example: Two Quantities with Sum 20

Let \(x>0\) and \(y>0\) satisfy \(x+y=20\). Express the objective using \(x\): \(y=20-x\), so \(P(x)=x(20-x)=20x-x^2\), with \(0<x<20\).

Differentiate: \(P'(x)=20-2x\). Set the derivative equal to zero: \(20-2x=0\), so \(2x=20\) and \(x=10\). Then \(y=20-10=10\).

The second derivative is \(P''(x)=-2<0\), and the limiting endpoint products are \(P(0)=0\) and \(P(20)=0\). The product at the critical point is \(P(10)=10\cdot10=100\), which is therefore the maximum. Check: \(10+10=20\), and the corresponding product is \(100\).

The General Result

The same conclusion holds for any finite number of positive quantities. To prove it, consider the product while varying just two quantities and keeping their sum, as well as all the other quantities, fixed. If the two selected quantities are unequal, replacing them with their average increases their product. This gives a direct way to rule out any unequal allocation as a maximum.

Theorem: Let \(n\geq 2\) and \(S>0\). Among all positive real numbers \(x_1,\dots,x_n\) satisfying \(x_1+\cdots+x_n=S\), the product \(x_1x_2\cdots x_n\) has a unique maximum. It occurs at \(x_1=\cdots=x_n=S/n\), and the maximum value is \((S/n)^n\).

Why the Theorem Is True

We give a complete argument, including why a maximum exists and why it must occur at equal quantities. First allow quantities to be zero temporarily and consider the closed feasible set

$$ K=\{(x_1,\dots,x_n):x_i\geq 0\text{ for every }i,\quad x_1+\cdots+x_n=S\}. $$

This set is closed and bounded, hence compact, and the product \(P=x_1\cdots x_n\) is continuous. By the extreme value theorem, it attains a maximum on \(K\). The equal allocation belongs to \(K\) and has positive product \((S/n)^n\). Any point on the boundary of \(K\) has at least one zero quantity and therefore product zero. Consequently, a maximizing allocation is interior: all its quantities are positive. In particular, it is a feasible allocation for the original positive-quantity problem.

Now choose any two quantities in a maximizing allocation, and call them \(a\) and \(b\). Hold all the other quantities fixed. Write \(c=a+b\); the two chosen quantities may be replaced by \(t\) and \(c-t\), where \(0\leq t\leq c\), without changing the total sum. The factor contributed by this pair is

$$ q(t)=t(c-t)=ct-t^2. $$

Differentiation gives \(q'(t)=c-2t\). Its only critical point is \(t=c/2\), and \(q''(t)=-2<0\). Equivalently, for every \(t\) in the interval, completing the square gives \(q(t)=c^2/4-(t-c/2)^2\), so the pair product is largest when both quantities equal \(c/2\).

To see strictly why unequal quantities cannot occur at a maximum, compare the original pair product with the product after averaging:

$$ \left(\frac{a+b}{2}\right)^2-ab =\frac{(a-b)^2}{4}. $$

If \(a\ne b\), this difference is positive. The product of the other \(n-2\) quantities is also positive (and, when there are no other quantities, the remaining factor is \(1\)). Therefore replacing \(a,b\) by their average strictly increases the total product while preserving the sum. That contradicts the assumption that the allocation maximizes the product. Since the argument applies to every pair, every pair of quantities at a maximum must be equal. Thus all quantities are \(S/n\), and substitution gives the maximum value \((S/n)^n\). The same reasoning shows uniqueness: any unequal allocation cannot be a maximum.

1
Establish a maximum.
On the closed feasible set, the continuous product attains a maximum. Equal positive quantities show the maximum is positive, so no boundary point with a zero quantity can maximize it.
2
Vary a pair.
For two quantities with fixed pair-sum \(c\), their pair product is \(t(c-t)\), maximized at \(t=c/2\).
3
Conclude equality.
If any pair were unequal, averaging it would increase the whole product. Hence every pair, and therefore all quantities, must be equal.

Applying the Result

Worked Example: Three Quantities with Sum 18

Let \(x,y,z>0\) satisfy \(x+y+z=18\). Eliminate \(z\): \(z=18-x-y\), so \(P(x,y)=xy(18-x-y)\), on the domain \(x>0\), \(y>0\), and \(x+y<18\).

At an interior critical point, both partial derivatives must be zero. Differentiating gives \(\frac{\partial P}{\partial x}=y(18-2x-y)\) and \(\frac{\partial P}{\partial y}=x(18-x-2y)\). Since \(x\) and \(y\) are positive, the critical-point equations reduce to \(2x+y=18\) and \(x+2y=18\).

Subtract the second equation from the first: \(x-y=0\), so \(x=y\). Substituting into \(2x+y=18\) gives \(3x=18\), hence \(x=y=6\). Then \(z=18-6-6=6\), and the product is \(6\cdot6\cdot6=216\).

The general theorem confirms this critical point is the unique global maximum; the boundary of the closed feasible set has product zero. Check: the quantities sum to \(6+6+6=18\), and their product is \(216\).

Worked Example: Four Quantities with Sum 28

Suppose four positive quantities sum to \(28\). There are \(n=4\) quantities, so the theorem gives an equal allocation of \(28/4=7\) to each. The maximum product is \(7^4=7\cdot7\cdot7\cdot7=2401\).

For comparison, the unequal allocation \(4,6,8,10\) also sums to \(28\), but its product is \(4\cdot6\cdot8\cdot10=24\cdot80=1920\). Averaging the pair \(4,10\) replaces it with \(7,7\). The other pair \(6,8\) has product \(48\), so this change raises the overall product to \(7\cdot7\cdot48=2352\). Averaging \(6,8\) next gives \(7,7\), raising the product to \(7\cdot7\cdot7\cdot7=2401\).

Check: the final allocation sums to \(7+7+7+7=28\); its product is \(2401\), which exceeds both \(1920\) and the intermediate \(2352\).

A Common Differentiation Error

When differentiating a product written as a function of one variable, forgetting the derivative of one factor gives the wrong critical point. For example, under the constraint \(x+y=12\), write \(P(x)=x(12-x)\). A common incorrect calculation is \(P'(x)=12-x\), as if the second factor were constant. Setting this equal to zero gives \(x=12\), where the product is actually zero.

The product rule, or expansion first, gives the correct derivative:

$$ P(x)=12x-x^2,\qquad P'(x)=12-2x. $$

Thus \(12-2x=0\) gives \(x=6\), and \(y=12-6=6\). The product is \(36\), while the limiting endpoint products at \(x=0\) and \(x=12\) are both zero. The correction is to differentiate the entire objective accurately, then check that the critical point is feasible and compare it with the relevant boundary behavior.

Why the Result Matters

The theorem turns a problem with many possible allocations into a simple calculation: divide the total by the number of quantities, then multiply that common value by itself \(n\) times. It is useful whenever a product is the objective and the only constraint is a fixed sum. If the quantities have units, each factor contributes one unit to the product, so the product has the corresponding units raised to the \(n\)th power.

The assumptions matter. The total must be positive, the number of quantities must be fixed, and the quantities may vary continuously over positive real values. Additional restrictions—such as different lower bounds, different costs for each quantity, or a requirement that quantities be integers—change the feasible set and may change the answer. The equal-allocation result applies to the stated fixed-sum product problem, not automatically to every allocation problem.

Takeaway: With \(n\geq2\) positive quantities of fixed sum \(S\), the product is uniquely maximized when each quantity is \(S/n\). Pairwise averaging proves global optimality: any unequal pair can be made more productive without changing the total sum.

Check Your Understanding

Use differentiation or the pairwise argument where appropriate.

  1. Two positive quantities have sum \(16\). What allocation maximizes their product, and what is the maximum product?
  2. Three positive quantities have sum \(21\). State the maximizing allocation and calculate its product.
  3. For a pair with fixed sum \(c\), explain why \(t(c-t)\) is maximized at \(t=c/2\).
  4. Why can a boundary allocation with at least one zero quantity not maximize the product when the fixed sum is positive?
  5. Four positive quantities have sum \(20\). What is the maximum product, and which allocation attains it?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon