From a Situation to an Objective
In an optimization problem, the objective is the quantity we want to make as small or as large as possible. It might represent cost, area, volume, distance, time, or profit. Writing down that quantity as a function of a decision variable is a mathematical model of the situation.
Constructing the formula is more than translating words into symbols. The formula must reflect how the real quantity is assembled, use variables consistently with the constraints, and be evaluated on the feasible domain. Once it is correct, algebra can often make it easier to work with. The key is to simplify without changing which feasible choices are best.
The feasible domain and the objective are related but distinct. Constraints determine which choices are allowed; the objective assigns a value to each allowed choice. A formula that is correct outside the feasible domain may be irrelevant there, while a formula that ignores a constraint may describe impossible choices.
Build the Objective in Pieces
A reliable construction starts by naming the decision variable and identifying what the objective counts. Then express each component in terms of that variable, combine the components according to the situation, and check that the resulting formula has the intended units. If an equality constraint has already been used to express one quantity in terms of another, use that relationship consistently rather than treating both quantities as independent.
Specify what the variable represents, including its units.
Decide whether the problem asks for a cost, time, area, profit, or another quantity, and whether it is to be minimized or maximized.
Write the relevant formulas and combine them using the relationships described in the problem.
Verify units and the feasible domain, then simplify only in ways that preserve the optimization being asked for.
For example, a total cost made from several charges is their sum. Profit is revenue minus cost. A total travel time from several route segments is the sum of the times for those segments. These relationships are part of the model, not optional algebraic choices.
Worked Example: Combining Segment Times
A 12-kilometer journey is divided between two types of road. A distance of \(x\) kilometers is traveled at 30 kilometers per hour, and the remaining distance is traveled at 60 kilometers per hour. Suppose \(x\) can range from 0 to 12 kilometers. Build and simplify the total travel-time objective.
The first segment takes distance divided by speed, so its time is \(x/30\) hours. The remaining distance is \(12-x\) kilometers, so its time is \((12-x)/60\) hours. Thus the total time is
Using a common denominator gives
Both terms in the original formula are in hours, and the simplified expression is in hours because its numerator is a distance in kilometers and its denominator is a speed in kilometers per hour. To check the simplification at \(x=6\), the original formula gives \(6/30+6/60=1/5+1/10=3/10\) hours. The simplified formula gives \((6+12)/60=18/60=3/10\) hours. The two expressions agree.
What Simplification Can Preserve
For a fixed feasible domain, the important feature of an objective is its ranking of feasible choices. If a choice has a smaller value than another choice before simplification, a transformation is safe for minimization when it keeps that ordering. For maximization, it must keep the ordering in the direction of larger values.
Proof. Suppose \(x_*\) minimizes \(f\). Then \(f(x_*)\le f(x)\) for every \(x\in D\). Since \(g\) is increasing, applying \(g\) preserves this inequality: \(g(f(x_*))\le g(f(x))\). Therefore \(x_*\) minimizes \(g\circ f\). Conversely, if \(x_*\) minimizes \(g\circ f\), then \(g(f(x_*))\le g(f(x))\) for every \(x\in D\). Strict increase means that this inequality implies \(f(x_*)\le f(x)\). Thus \(x_*\) minimizes \(f\). The proof for maximizers uses the same argument with the inequalities reversed. This establishes equality of the optimizer sets, not just agreement at one particular choice.
Several useful simplifications follow. Adding a constant, \(g(u)=u+C\), is strictly increasing. Multiplying by a positive constant, \(g(u)=cu\) for \(c>0\), is also strictly increasing. Therefore, these operations preserve both minimizers and maximizers. Multiplication by a negative constant reverses the order: it turns minimizers into maximizers and maximizers into minimizers.
A strictly decreasing transformation reverses rankings as well. In particular, if \(f\) is positive, minimizing \(f\) is equivalent to maximizing \(1/f\), because \(u\mapsto 1/u\) is strictly decreasing for \(u>0\). This can be useful, but it changes the direction of the optimization. A transformation must be checked on the values actually taken by the objective, not assumed safe in every setting.
Worked Example: Building and Simplifying Profit
A business sells \(q\) units per week at a price of \(80-3q\) dollars per unit. Its weekly cost is \(200+20q\) dollars, and feasible production satisfies \(0\le q\le 20\). Build the profit function and simplify it.
Weekly revenue is price per unit multiplied by units sold:
Weekly profit is revenue minus weekly cost. Therefore,
Every term in the profit expression is measured in dollars per week: \(q\) is in units per week and the stated price and cost rates produce weekly dollar amounts. To check the formula at \(q=4\), the price is \(80-3(4)=68\) dollars per unit. Revenue is \(4(68)=272\) dollars per week, and cost is \(200+20(4)=280\) dollars per week, so profit is \(272-280=-8\) dollars per week. The simplified formula gives \(-3(4^2)+60(4)-200=-48+240-200=-8\), as required.
The simplified form is the same profit objective, not a different target: it was obtained by expanding and collecting terms. Such algebraic rewrites preserve values at every feasible \(q\), and hence preserve all optimal choices.
Equivalent Objectives for Nonnegative Quantities
Sometimes an objective includes a square root that makes the formula less convenient. If the quantity is known to be nonnegative, squaring it can simplify the expression without changing its minimizers: the function \(u\mapsto u^2\) is strictly increasing for \(u\ge 0\). The nonnegativity condition matters. On all real numbers, squaring is not strictly increasing, since, for example, \((-2)^2=2^2\). It can therefore merge distinct objective values and introduce additional minimizers.
Worked Example: Simplifying a Squared-Error Objective
A calibration choice \(b\) is assessed against three recorded readings, 1, 3, and 5. Define its total squared error as the sum of the squared differences from those readings. Build the objective and rewrite it in a simpler form.
The three errors are \(b-1\), \(b-3\), and \(b-5\), so the total squared error is
Expanding each square gives
Completing the square,
This form makes the role of the constant clear. Since \(3(b-3)^2\ge 0\), the objective is at least 8, and equality occurs when \(b=3\). As a direct check, the original expression at \(b=3\) is \((3-1)^2+(3-3)^2+(3-5)^2=4+0+4=8\); the completed-square expression gives \(3(3-3)^2+8=8\). The rewritten expression agrees with the original and displays the same lowest value.
Units, Constants, and Common Errors
Units are a practical check on an objective. A sum such as “distance plus time” is not a meaningful total unless the problem defines a conversion that makes the quantities comparable. Likewise, cost and revenue can be subtracted to define profit because both are monetary amounts over the same period. Expressions in an objective should have compatible units, and the variable should retain the meaning assigned to it when earlier constraints were used.
Adding a constant to an objective does not affect which feasible choice is best, but the constant must really be the same for every feasible choice. If a supposed “constant” depends on the decision variable, it is not constant and cannot simply be discarded. Similarly, multiplying an objective by a positive constant preserves its optimizer locations, while a negative constant changes a minimization into a maximization, or vice versa.
A frequent modeling error is forgetting that revenue is a rate per unit multiplied by the number of units. For the sales model above, a tempting but incorrect calculation is to write profit as \(80-3q-(200+20q)\). This subtracts weekly cost from a price per unit, so the units do not match; it also fails to calculate total revenue. The correction is to form revenue first as \(q(80-3q)\), then subtract the weekly cost:
Before relying on an objective, check that it counts the requested quantity, uses the constraints consistently, and has sensible units throughout. Then verify any simplified expression by reversing or checking the algebra, or by testing a feasible value in both forms. Testing a value does not prove two formulas identical, but it can expose an error.
Check Your Understanding
Answer these questions using the definitions and examples above.
- A weekly objective is written as revenue minus cost. What units should the two terms have before they are subtracted?
- Why does adding the same constant to every value of an objective preserve its minimizers?
- What happens to the optimization direction when an objective is multiplied by a negative constant?
- When can squaring an objective preserve its minimizers, and why is nonnegativity important?
- A price is stated in dollars per unit and a quantity in units per week. What expression gives weekly revenue?