Why Eliminate a Variable?
In an optimization problem, the objective may be written using several variables, even though an equality constraint ties those variables together. The variables are then not free to vary independently. Substituting the equality constraint into the objective can describe the same choices with fewer variables.
The important requirement is that the substitution must preserve the original feasible choices. A rewritten formula is useful only if it represents exactly the choices allowed by the original problem—not a larger set, a smaller set, or just one part of the set without saying so.
Feasible Choices and a Reduced Objective
Suppose an objective is \(F(x,y)\), and the variables must satisfy an equality constraint \(g(x,y)=0\), along with any other stated conditions. The feasible choices are the pairs \((x,y)\) that satisfy all of those requirements. The objective assigns a value \(F(x,y)\) to each such pair.
If the equality can be solved as \(y=\phi(x)\), substitution gives the one-variable expression \(F(x,\phi(x))\). This expression is called the reduced objective. It describes the objective values along the constraint, provided we also retain the conditions that specify which values of \(x\) correspond to allowed original choices.
This definition highlights two separate tasks. First, solve the equality correctly. Second, preserve all the restrictions that determine which original choices are allowed. Substitution does not remove conditions such as nonnegativity, positivity, or another constraint.
Solving the Equality Carefully
For a linear equality such as \(ax+by=c\), solving for \(y\) requires \(b\ne 0\). In that case, rearranging gives \(y=(c-ax)/b\). If \(b=0\), this rearrangement is not allowed; the equality instead places a condition directly on \(x\), or may be inconsistent.
For nonlinear equalities, solving may produce more than one expression. For example, \(y^2=q(x)\) gives \(y=\sqrt{q(x)}\) or \(y=-\sqrt{q(x)}\) when \(q(x)\ge 0\). If the original problem also requires \(y\ge 0\), only the nonnegative branch is permitted. If no such condition is given, both branches must be considered. Choosing one branch without justification can discard feasible choices.
There is also a difference between substituting into the objective and simplifying the entire problem. Substitution changes how the objective is written; it does not by itself establish which parameter values are allowed or where an optimum occurs. Any remaining conditions must still be respected.
Worked Example: A Linear Resource Constraint
Worked Example: A Linear Resource Constraint
Suppose \(x\) and \(y\) are nonnegative quantities satisfying \(x+2y=14\). The objective is \(F(x,y)=4x+7y\). Rewrite the objective using \(y\) as the parameter, and check that the substitution represents the original choices.
Start with the equality constraint:
Subtract \(2y\) from both sides to solve for \(x\):
Substitute this expression into the objective:
The reduced objective is \(56-y\). The nonnegativity conditions still matter: \(y\ge 0\), and \(x\ge 0\) becomes \(14-2y\ge 0\). For a direct check, choose \(y=3\). Then \(x=14-2(3)=8\), and the constraint gives \(8+2(3)=14\). The original objective is \(4(8)+7(3)=32+21=53\). The reduced objective gives \(56-3=53\), the same value.
Conversely, any allowed \(y\) determines exactly one \(x\) through \(x=14-2y\). Thus the substitution represents the original choices satisfying the equality, as long as the nonnegativity conditions are retained.
Why the Substitution Preserves the Choices
The reasoning behind substitution can be stated precisely. Suppose the original equality is equivalent, under its stated conditions, to \(y=\phi(x)\). Let \(S\) be the set of original feasible pairs and let \(T\) be the set of parameter values \(x\) that produce pairs satisfying all the original conditions. Define the correspondence \(P(x)=(x,\phi(x))\).
To verify the correspondence, consider both directions. For any \(x\in T\), the definition of \(T\) ensures that \((x,\phi(x))\) satisfies the equality and every other original condition. Thus \(P(x)\in S\). Conversely, take any \((x,y)\in S\). Since it satisfies the equality, the assumed equivalent expression gives \(y=\phi(x)\). Therefore \((x,y)=P(x)\), so every original feasible pair is represented. If two parameters \(x_1\) and \(x_2\) produce the same pair, their first coordinates must agree, so \(x_1=x_2\). The correspondence is one-to-one.
Finally, the reduced objective is defined by substituting the corresponding pair into the original objective, so \(R(x)=F(x,\phi(x))\) by definition. This proves that the substitution preserves both the feasible choices and their objective values. In particular, comparing objective values after substitution is meaningful only when the allowed parameter values represent the original feasible set as described.
Worked Example: A Constraint with Two Algebraic Branches
Worked Example: A Constraint with Two Algebraic Branches
Suppose \(x^2+y^2=25\), \(y\ge 0\), and the objective is \(G(x,y)=3x+4y\). Rewrite the objective in terms of \(x\), and check one feasible point.
Rearrange the equality to isolate \(y^2\):
Taking square roots gives two algebraic branches, \(y=\sqrt{25-x^2}\) and \(y=-\sqrt{25-x^2}\), when the quantity under the root is nonnegative. The original condition \(y\ge 0\) selects the nonnegative branch. The reduced objective is therefore
For a check, take \(x=3\). Then \(y=\sqrt{25-9}=\sqrt{16}=4\), which satisfies \(y\ge 0\) and \(3^2+4^2=9+16=25\). The original objective is \(3(3)+4(4)=9+16=25\). The substituted expression gives \(3(3)+4\sqrt{25-3^2}=9+4\sqrt{16}=9+16=25\).
The sign condition is essential. Without \(y\ge 0\), the equality also permits \(y=-4\) when \(x=3\). That point would give the objective value \(3(3)+4(-4)=-7\), not \(25\). Using only the nonnegative branch would therefore omit a feasible choice if the original problem had not specified \(y\ge 0\).
Worked Example: A Product Constraint
Worked Example: A Product Constraint
Suppose \(x>0\), \(y>0\), and \(xy=12\). The objective is \(H(x,y)=x^2+2y\). Eliminate \(y\), and check that division and substitution are valid for a particular feasible choice.
Because \(x>0\), in particular \(x\ne 0\), so dividing the equality \(xy=12\) by \(x\) is valid:
Substitute this expression into the objective:
The original condition \(y>0\) must still hold. With \(x>0\), the expression \(12/x\) is positive, so it satisfies that condition. For a check, take \(x=2\). Then \(y=12/2=6\), and \(xy=2(6)=12\). The original objective is \(2^2+2(6)=4+12=16\). The reduced expression gives \(2^2+24/2=4+12=16\).
Division was valid here because the problem explicitly required \(x>0\). If \(x\) could be zero, the equation would need to be checked separately at \(x=0\); one could not obtain an equivalent description of every solution merely by dividing by \(x\).
Common Mistake: Dropping a Condition or a Branch
A frequent error is to treat an algebraic expression obtained by rearranging the equality as though it automatically captures all original choices. For example, from \(x^2+y^2=25\), one might write \(y=\sqrt{25-x^2}\) and claim that this represents every pair on the circle. It does not: the square root is nonnegative, so it represents only pairs with \(y\ge 0\).
A correction must reflect the original conditions. If \(y\ge 0\) is part of the problem, the positive square-root expression is appropriate. If there is no sign restriction, both expressions \(y=\sqrt{25-x^2}\) and \(y=-\sqrt{25-x^2}\) must be accounted for. Similarly, when dividing by a variable, first establish that it cannot be zero, or treat the zero case separately.
Why This Step Matters
Eliminating a variable makes the dependence imposed by an equality explicit. It can simplify later analysis by reducing the number of independent variables in the objective. But simplification is not permission to change the problem: the conditions defining the original choices remain part of the mathematical model.
This is especially important when an equality has multiple branches, when solving requires division, or when other restrictions are present. A reliable substitution records the expression used, the conditions that justify it, and any remaining restrictions. With those details preserved, the reduced objective can be used to study the same choices as the original formulation.
Check Your Understanding
Use the equality constraint and all stated conditions when answering each question.
- If \(3x+2y=18\), what expression for \(y\) results from solving in terms of \(x\), and what condition was needed to divide?
- For \(x^2+y^2=16\) with \(y\le 0\), which square-root branch represents the allowed values of \(y\)?
- If \(xy=10\) and \(x\) is not known to be nonzero, why is dividing by \(x\) not automatically valid for describing every solution?
- What two directions must be checked to establish that a substitution preserves the feasible choices?
- If \(F(x,y)=x+3y\) and \(y=5-x\), what reduced objective results from substitution?