AP Calculus AB and BC

Objective Function vs Constraint

The objective function is the quantity you maximise or minimise, and the constraint is the equation you solve in order to eliminate a variable from it. In the substitution method the constraint is solved and substituted, and only the objective is differentiated.

Objective function

Use when: The sentence asks for the largest or smallest value of this quantity, so it is the one you reduce to a single variable and then differentiate.

Constraint

Use when: The sentence fixes a number that ties the variables together, so in the substitution method you solve it for one variable and substitute rather than differentiate.

Side by side

Objective functionConstraint
What it isThe quantity being maximised or minimisedA fixed relationship the variables must satisfy
Wording that signals itlargest, smallest, least material, maximum areaa fixed total: 6060 metres of fence, a volume of 10001000 cubic centimetres
What you do with itDifferentiate it, once it is down to one variableIn the substitution method, solve it for one variable and substitute into the objective
Variables it holdsTwo at the start, one after the substitutionTwo or more, and it stays that way
Pen against a barn with 6060 m of fenceA=xyA = xy, to be made as large as possible2x+y=602x + y = 60, fixed by the fencing you have

Read the problem twice and sort the sentences. One of them asks for the largest or smallest of something, and that quantity is the objective, the function you will eventually differentiate. Another fixes a number: a length of fence, a volume of tin, a point that must sit on a given curve. That one is the constraint, and its whole job is to let you rewrite the objective in a single variable.

Objective: A=xyConstraint: 2x+y=60A(x)=x(602x)\text{Objective: } A = xy \qquad \text{Constraint: } 2x + y = 60 \qquad \Longrightarrow \qquad A(x) = x(60 - 2x)

Here is the pen those two lines come from. A rectangle is fenced against a barn wall using 6060 metres of fence for the three open sides, with xx the two equal sides and yy the side parallel to the barn. The constraint gives y=602xy = 60 - 2x, so the objective becomes A(x)=60x2x2A(x) = 60x - 2x^2, and A(x)=604x=0A'(x) = 60 - 4x = 0 at x=15x = 15. Then y=30y = 30 and the greatest area is 450450 square metres. In this route the constraint was solved and substituted rather than differentiated. There is a second standard route in which you do differentiate the constraint: 2x+y=602x + y = 60 gives dydx=2\frac{dy}{dx} = -2, and feeding that into dAdx=y+xdydx=y2x=0\frac{dA}{dx} = y + x\frac{dy}{dx} = y - 2x = 0 gives y=2xy = 2x, which with the constraint returns the same x=15x = 15, y=30y = 30, A=450A = 450.

Differentiating the wrong equation

Differentiating the constraint in place of the objective is the classic wrong turn. Differentiating both sides of 2x+y=602x + y = 60 gives 2+dydx=02 + \frac{dy}{dx} = 0, that is dydx=2\frac{dy}{dx} = -2, which imposes no condition on xx or yy and so on its own cannot locate the maximum. If your derivative equation has no variable left to solve for, collapsing to a numerical identity such as dydx=2\frac{dy}{dx} = -2, you differentiated the constraint instead of the objective.

Frequently asked questions

Which equation do I differentiate in an optimisation problem?

The objective. In the substitution method you differentiate it only after the constraint has cut it down to one variable. Differentiating the constraint on its own gives a relation such as dydx=2\frac{dy}{dx} = -2 that holds at every point of the constraint, so by itself it locates nothing; it is useful only when you feed it into the derivative of the objective.

How do I find the constraint in a word problem?

Hunt for the fixed number. A total length of fence, a required volume, a budget, or a curve the point must lie on each give one equation linking the variables. The sentence asking for a maximum or a minimum is the objective and is never the constraint.

Do I still have to check the endpoints?

Yes, whenever the constraint leaves a closed interval of possible values. For the pen, y=602x0y = 60 - 2x \geq 0 puts xx in [0,30][0, 30], and the candidates test compares A(15)=450A(15) = 450 against A(0)=0A(0) = 0 and A(30)=0A(30) = 0.

In the CED: Unit 5: Analytical Applications