Tutorials › Calculus I › Building And Simplifying The Objective Function

Optimization and Newton's Method · Tutorial 864 of 1495

Building And Simplifying The Objective Function

Build objective functions from constraints and component quantities, then use valid simplifications while keeping track of which choices remain optimal.

Advanced 10 min read

What You'll Learn

  • Identify the quantity to minimize or maximize and express it as a function of a decision variable.
  • Combine component costs, times, revenues, or errors into one objective.
  • Check units and the feasible domain while constructing a formula.
  • Recognize when adding a constant or multiplying by a positive constant preserves optimizer locations.
  • Use strictly increasing transformations, such as squaring a nonnegative distance, without changing minimizers.
  • Avoid transformations that reverse rankings or introduce extra ties.

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.

Definition: An objective function is a function \(f:D\to\mathbb{R}\) whose value represents the quantity being minimized or maximized. The set \(D\) is the feasible domain: the choices allowed by the problem's constraints.

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.

1
Name the choice.
Specify what the variable represents, including its units.
2
Identify the measured quantity.
Decide whether the problem asks for a cost, time, area, profit, or another quantity, and whether it is to be minimized or maximized.
3
Assemble its components.
Write the relevant formulas and combine them using the relationships described in the problem.
4
Check and simplify.
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

$$ T(x)=\frac{x}{30}+\frac{12-x}{60}, \qquad 0\le x\le 12. $$

Using a common denominator gives

$$ T(x)=\frac{2x}{60}+\frac{12-x}{60} =\frac{2x+12-x}{60} =\frac{x+12}{60}. $$

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.

Theorem: Let \(f:D\to\mathbb{R}\), and let \(g\) be strictly increasing on a set containing all values \(f(x)\) for \(x\in D\). Then \(f\) and \(g\circ f\) have exactly the same minimizers on \(D\) and exactly the same maximizers on \(D\). Here, a minimizer \(x_*\) satisfies \(f(x_*)\le f(x)\) for every \(x\in D\); a maximizer is defined by the reversed inequality.

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:

$$ R(q)=q(80-3q)=80q-3q^2. $$

Weekly profit is revenue minus weekly cost. Therefore,

$$ P(q)=R(q)-(200+20q) =(80q-3q^2)-200-20q =-3q^2+60q-200. $$

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

$$ E(b)=(b-1)^2+(b-3)^2+(b-5)^2. $$

Expanding each square gives

$$ E(b)=(b^2-2b+1)+(b^2-6b+9)+(b^2-10b+25) =3b^2-18b+35. $$

Completing the square,

$$ E(b)=3(b^2-6b)+35 =3\bigl((b-3)^2-9\bigr)+35 =3(b-3)^2+8. $$

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:

$$ P(q)=q(80-3q)-(200+20q). $$

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.

Key takeaway: A safe simplification preserves the ordering of feasible choices in the direction relevant to the problem. Exact algebraic rewrites preserve every objective value; strictly increasing transformations preserve optimizer locations; negative scaling and strictly decreasing transformations reverse minimization and maximization.

Check Your Understanding

Answer these questions using the definitions and examples above.

  1. A weekly objective is written as revenue minus cost. What units should the two terms have before they are subtracted?
  2. Why does adding the same constant to every value of an objective preserve its minimizers?
  3. What happens to the optimization direction when an objective is multiplied by a negative constant?
  4. When can squaring an objective preserve its minimizers, and why is nonnegativity important?
  5. A price is stated in dollars per unit and a quantity in units per week. What expression gives weekly revenue?

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