Objective functions and constraints
Why it matters
Optimization begins by deciding what can change, what is valued and what solutions are allowed.
Learning objectives
- Formulate decision variables, objective, constraints and domain from a technical statement.
- Classify feasible, infeasible and binding cases with units.
- Validate feasibility, optimality evidence, units and limitations independently.
Prerequisites
Courses 2.1, 2.3 and 2.4; prior canonical classes where applicable.
Concept and explanation
The objective assigns a value to each candidate; constraints define the feasible set. Minimization or maximization acts only over feasible points. A numerically attractive infeasible point is never a solution.
Decision variable: a quantity the learner may choose. Parameter: a fixed quantity for one model run. Objective: the scalar quantity minimized or maximized. Constraint: a condition every feasible candidate must satisfy. Feasible set: all domain points satisfying every constraint.
Translate context → variables → objective → constraints → domain → feasible set → method → validated interpretation.
Test each constraint independently. Equality defines a surface; inequality selects a side. A constraint is active when it holds with equality at the candidate.
Formulate first; enumerate or solve only after the model is explicit. Validate by substituting the candidate into every constraint and recomputing the objective.
Key terms
decision variable; objective; minimize; maximize; constraint; domain; feasible set; binding constraint
Notation and solution strategy
Write min/max f(x) subject to gᵢ(x)≤0, hⱼ(x)=0 and x∈D. Always attach units to physical variables and parameters.
Worked optimization examples
Worked example 1
Problem: Allocate 8 machine-hours between products A and B to maximize contribution.
Decision variables: x,y = hours for A,B.
Objective: maximize 30x+20y dollars.
Constraints: x+y≤8.
Domain: x≥0,y≥0.
Given parameters: profits 30 and 20 dollars/hour; capacity 8 hours.
Method: Compare linear objective at feasible vertices.
Mathematical development: Vertices are (0,0),(8,0),(0,8); objective values 0,240,160.
Calculation: Vertices are (0,0),(8,0),(0,8); objective values 0,240,160.
Candidates: (8,0) is best among all vertices.
Feasibility check: All coordinates are nonnegative; x+y=8 is binding; linear-program theorem supports vertex comparison.
Optimality check: x=8,y=0; optimal value $240.
Validation: All coordinates are nonnegative; x+y=8 is binding; linear-program theorem supports vertex comparison.
Optimal value / solution: x=8,y=0; optimal value $240.
Interpretation: Use all hours on higher-contribution A under this simplified model.
Limitations: Ignores demand, setup and diversification constraints.
Worked example 2
Problem: Minimize material x+y for a rectangular panel with area at least 12.
Decision variables: x,y = side lengths in meters.
Objective: minimize x+y.
Constraints: xy≥12.
Domain: x>0,y>0.
Given parameters: required area 12 m².
Method: Boundary substitution y=12/x then calculus.
Mathematical development: φ(x)=x+12/x; φ′=1−12/x²=0 gives x=√12; φ″=24/x³>0.
Calculation: φ(x)=x+12/x; φ′=1−12/x²=0 gives x=√12; φ″=24/x³>0.
Candidates: Positive candidate x=y=√12.
Feasibility check: Constraint binds; endpoints tend to infinite objective; convexity on x>0 gives global minimum.
Optimality check: x=y≈3.464 m; x+y≈6.928 m.
Validation: Constraint binds; endpoints tend to infinite objective; convexity on x>0 gives global minimum.
Optimal value / solution: x=y≈3.464 m; x+y≈6.928 m.
Interpretation: The balanced sides minimize the stated proxy.
Limitations: x+y is not actual perimeter unless factor two is included; engineering details omitted.
Common mistake and counterexample
Mistake: choosing x=10,y=0 because it has a high objective while ignoring xy≥12. It seems attractive numerically but is infeasible.
Incorrect reasoning
candidate=(10,0) # objective inspected, constraint ignoredCorrect method and validation
assert x>=0 and y>=0 and x*y>=12
compare_objective_only_among_feasible_candidates()Guided practice
Guided problem 1
A shop makes x tables and y shelves. Profit is 50x+30y dollars; carpentry requires 4x+2y≤40 hours; finishing requires x+2y≤16 hours; x,y≥0. Write the complete maximization model and test (8,4).
Solution / evidence
max 50x+30y subject to 4x+2y≤40, x+2y≤16, x,y≥0. (8,4) violates finishing: 8+8=16 is feasible there, but carpentry is 32+8=40; therefore it is feasible and both resources bind.
Guided problem 2
Minimize C(x)=200/x+5x dollars for x∈[2,20]. Find the candidate and compare boundaries.
Solution / evidence
x*=√40≈6.325; C≈63.246. Boundaries give C(2)=110 and C(20)=110, so the interior candidate is the global minimum on the interval.
A/B/C/D optimization practice
A · Foundation
Label objective and constraints in three models.
B · Application
Formulate a small energy-allocation model with units.
C · Reasoning and error detection
Detect an infeasible attractive candidate.
D · Challenge / transfer
Create a model whose boundary must be examined.
Validation, knowledge check and summary
- Mastery check 1: Distinguish a decision variable from a parameter in a production model.
Answer / evidence
Choice changes; coefficient stays fixed for the model run.
- Mastery check 2: Formulate a minimization model with units.
Answer / evidence
Evidence includes min direction, units, constraints and domain.
- Mastery check 3: Test a candidate against two inequalities and a domain.
Answer / evidence
Show both substitutions and slack or violation.
- Mastery check 4: Explain why objective value cannot rescue infeasibility.
Answer / evidence
Optimization compares only feasible candidates.
Mastery criterion: 4/4 correct plus one independently formulated and validated optimization artifact. Repair each major misconception and complete a fresh equivalent check.
Related laboratory
Next class: Convexity
Sources and references
OpenStax Calculus, optimization applications; Boyd and Vandenberghe, Convex Optimization, §4.1.
Science & Mathematics Tutor
Tutor context: Course 8.1 · Module 1 · Class 8.1.1 · Objective functions and constraints. Ask for help with the active example, guided problem, practice or laboratory; require model, feasibility and validation evidence.
Academic review
VERIFIED
Version and review history
v2 · REFERENCE-CLONE REBUILD · 2026-09-21
Material rebuild event: reauthored bilingual body, class-specific guided problems, answers, feedback, mastery checks, sources and Tutor context. Earlier review retained in administrative history only.