Differential Calculus for Social Science 201-103 • CEGEP, Montreal
Revision sheet: applied optimization (201-103)
Optimization is the most rewarding question of the course: it is worth a lot of marks and it is decided almost entirely on the first two lines, the ones where you set down the objective function and the domain. A perfect differentiation of the wrong function earns nothing.
This sheet gives the five steps, the four standard forms of the Social Science program with the signature that lets you check your result without recomputing, the nine mistakes that come back every exam period, and the complete write-up of a service-points problem.
Mark this sheet as read or add it to your favourites: a free account, no password, keeps your read sheets and favourites from one visit to the next, tells you which chapter to tackle next and lets you ask for the method or exercise you are missing. Create your space, an email is enough.
The thread of the chapter
At the optimum of a sum of two opposing costs, NEITHER of them is minimal: this is what students refuse to admit, and it is why they differentiate the terms separately instead of differentiating the sum.
•Write the CONSTRAINT, the relation that links the variables to each other.
•Write the OBJECTIVE FUNCTION, the one the problem asks you to maximize or minimize.
•SUBSTITUTE the constraint into the objective so that only one variable remains, and state the DOMAIN.
•Differentiate, set to zero, decide the nature of the point, then compare with the ENDPOINTS of the domain.
The constraint serves only to eliminate a variable. The domain comes from the context, and it is often what decides the final answer.
Two opposing costs: the central idea
•Almost every problem in the course pits two costs against each other: the more you do of one, the less you pay for the other.
•Minimizing a SUM of two opposing costs NEVER amounts to minimizing each of them.
•At the optimum, neither term is at its minimum: it is their sum that is.
•For C(x)=ax+xb, the optimum is at x=ab, and the TWO terms are equal there.
•A total cost curve is FLAT around its minimum: the right recommendation is a range, not a figure to the tenth.
At the dotted line, the increasing term is still rising and the decreasing term is still falling: only their sum, the top curve, reaches its minimum there.
The equality of the two terms at the optimum is the most rewarding check of the chapter: you do it in your head and it catches almost every differentiation error.
What the domain decides
•If no critical number lies in the admissible domain, the optimum is at an ENDPOINT, and the sign of the derivative says which one.
•INTEGER optimum: evaluate at the two neighbouring integers and compare the values. The tipping point is the GEOMETRIC mean n(n+1), not the midpoint.
•COST OF A CONSTRAINT: the difference between the free optimum and the constrained optimum. It is the number you bring to a negotiation.
•Maximizing the RETURN, result per dollar, and maximizing the NET EFFECT, result minus spending, give two different answers.
•A scarce budget calls for the return, need calls for the net effect. The problem always says which of the two it wants.
With the requirement n≥6 (green zone), 4.08 is no longer admissible: the optimum is at the ENDPOINT n=6. The red gap, about 1.83 thousand dollars, is the cost of the requirement.
Every conclusion is reread against the model: a flawless optimum on an unchecked assumption is still an optimum on an unchecked assumption.
The rules in table form
Each row reads from left to right: the assumptions, then the result. A red cell is not an answer, it is the finding that the form settles nothing and the instruction to rewrite it. Every case is followed by a worked example.
The four standard forms and their signature
The last column gives the SIGNATURE, that is, the relation that must hold at the optimum. It is used to check your result without redoing the computation. The two red cells are shortcuts that do not exist.
Form
Optimum
Signature at the optimum
ax+xb
x=ab
the TWO terms are equal
Example: 2x+x50: optimum at x=5, where each term is 10 and the total 20.
ax+xb
x=(2ab)2/3
the root term is TWICE the other
Example: x+x16: optimum at x=4, where the terms are 4 and 8.
ax−bx
x=(2ba)2
the cost is HALF of the gross gain
Example: 20x−2x: optimum at x=25, gross gain 100, cost 50, net 50.
an2+bn+ckn
n=ac
the linear term plays NO role
Example: With a=2, b=7, c=50: n=5, and changing b does not move the optimum.
minimize each term separately
the shortcut
does not existrule that does not exist
Example: 2x is minimal when x tends to 0 and x50 when x tends to infinity: neither one is minimal at x=5.
What to do: Differentiate the SUM, never the terms one by one.
round the optimum to the nearest integer
the arithmetic midpoint
does not existrule that does not exist
Example: Between 4 and 5, the tipping point is 20≈4.472 and not 4.5: an optimum at 4.48 settles at 5.
What to do: Evaluate the function at the TWO neighbouring integers and compare the values obtained.
The four signatures are not to be learned by heart like formulas: you rediscover them in one line by setting the derivative to zero, and they then serve as an instant check.
The mistakes that cost marks
These are the errors I correct most often in session. Each one costs marks on a paper, even when the reasoning behind it is right.
1.Minimizing each of the two costs instead of their sum
the whole question, and a recommendation that points the wrong way
What not to write
“The operating cost is minimal with few service points, so we need as few as possible.”
What to write
“We minimize the SUM C(n)=3n+n50. Its derivative 3−n250 vanishes at n=350≈4.08, where neither term is at its minimum.”
Why: This is the central idea of the chapter. Two opposing costs trade off: gaining on one costs on the other, and the optimum is a balance point, not an extreme.
2.Forgetting that the optimum can fall outside the admissible domain
3 marks, and an answer outside the limits of the problem
What not to write
“The derivative vanishes at x=9, so the optimum is 9.”
What to write
“The admissible domain is [1,6], and 9 is not in it. Since the derivative stays negative on the whole interval, the optimum is at the ENDPOINT x=6.”
The vertex of the parabola is clearly visible, but it lies to the right of the dotted line: on the admissible part, the curve only goes down, so the minimum is at the edge.
Why: The domain comes from the context, not from the algebra. A number of places, a budget, a duration have bounds that the problem sets and that the derivative ignores.
3.Rounding an integer optimum to the nearest integer
2 marks, and a wrong recommendation one time in three
What not to write
“The optimum is 4.48, so we keep 4.”
What to write
“We compare the two neighbouring integers: C(4)=18.05 and C(5)=18.04. The tipping point is the GEOMETRIC mean 4×5=20≈4.472, so 4.48 settles at 5.”
Why: The curve is not symmetric about its minimum: it rises faster on one side than on the other. The arithmetic midpoint therefore has no reason to be the tipping point.
4.Confusing return and net effect
3 marks on the recommendation question, which is the last and the heaviest
What not to write
“The program that produces the most results is the one to fund.”
What to write
“Maximizing the RETURN CR and maximizing the NET EFFECT R−C give two different answers. A scarce budget calls for the first, a need to be met calls for the second.”
Why: Both criteria are legitimate and almost never coincide. Choosing without saying which one you optimize is answering a question the problem did not ask.
5.Differentiating before eliminating the second variable
the whole question, since the derivative obtained is not that of the objective
What not to write
“C=3n+nk with k also depending on n, I differentiate.”
What to write
“I first use the CONSTRAINT to express k in terms of n, I substitute, and only then do I differentiate a function of a single variable.”
Why: Differentiating in one variable assumes that everything else is constant. As long as a second variable still depends on the first, that assumption is false.
6.Giving an optimum to the tenth on a flat curve
1 interpretation mark, and a recommendation that loses credibility
What not to write
“We must open exactly 4.08 service points.”
What to write
“Between 4 and 5 points, the total cost varies by less than 2.1 percent. The recommendation is therefore four or five points, and the choice will be made on other criteria.”
The band under the dotted line is wide: between 3.6 and 6.9, the total cost stays within five percent of its minimum.
Why: Near a minimum the derivative is zero, so the function varies at second order: an error in position produces a much smaller error in value. The precision displayed should reflect this.
7.Not checking the nature of the extremum
1 mark, systematically deducted
What not to write
“The derivative vanishes at n=4.08, so the cost is minimal there.”
What to write
“C′′(n)=n3100>0 for n>0, so the critical number is indeed a MINIMUM.”
Why: A zero derivative gives a candidate. In a cost problem, a maximum and a minimum are both plausible a priori, and the marking scheme pays for the line that settles it.
8.Confusing the constraint and the domain
1 mark, and a step of the method that gets skipped
What not to write
“The constraint is n≥1.”
What to write
“The CONSTRAINT is the relation that links the variables and is used to eliminate one. n≥1 is the DOMAIN, which comes from the context and is used to filter the candidates.”
Why: The two have opposite roles in the method: one enters the function, the other decides which results are acceptable. Confusing them loses one of the two.
9.Delivering the optimum without rereading the assumption of the model
1 to 2 recommendation marks in Social Science
What not to write
“The optimum is 4 service points, the matter is settled.”
What to write
“The optimum is 4 service points IF the travel cost varies as n1, which is what the model assumes. On a long, narrow territory, that assumption does not hold.”
Why: A flawless computation on an unchecked assumption is still a computation on an unchecked assumption. Naming the assumption is part of the expected answer.
Which method to choose
Which objective function, according to what the problem asks
The objective function is what the problem asks you to optimize, and the vocabulary points to it without ambiguity. This is the step that decides the whole question.
If “total cost”, “total spending”, “the cheapest” → sum of the costs, to MINIMIZE
Example: C(n)=3n+n50
If “profit”, “net profit”, “net gain” → revenue minus cost, to MAXIMIZE
Example: 20x−2x
If “return”, “per dollar invested”, “the most efficient” → a RATIO of result over cost, to maximize
Example: 2n2+7n+50kn
If “from when does it stop being profitable” → this is not an optimization: solve R(x)=C(x)
Example: 20x=2x gives x=100
the break-even point and the optimum are two different points, and the problem often asks for both
If “how much is needed at minimum to reach” → an inequality to solve, not a derivative to set to zero
Example: find n such that C(n)≤26
Two legitimate criteria can coexist in the same problem, the return and the net effect. When that happens, treat both and say which one answers the question asked.
Where the optimum is
Once the derivative is set to zero, only a few cases remain, and the domain sorts them out.
On the left, the critical number is in the domain: it is the optimum. In the middle, it falls outside (red): the optimum is at the endpoint. On the right, open domain, endpoint never reached: no optimum.
If a critical number is in the domain and the test confirms it → it is the optimum, but still compare it with the endpoints
Example: n=4.08 in [1,+∞)
If no critical number is in the domain → the optimum is at an ENDPOINT, and the sign of the derivative says which one
Example: derivative negative everywhere: right endpoint
If the variable must be an integer → evaluate at the two neighbouring integers and compare the values
Example: C(4)=24.5 versus C(5)=25, so 4
If the domain is OPEN → check that the extremum exists: there may be none
Example: a function that decreases toward an excluded endpoint
If a regulation imposes a minimum or maximum value → compute the constrained optimum AND the cost of the constraint
Example: C(6)−C(4)=1.83 thousand dollars
Comparing with the endpoints costs two evaluations of the function and is often worth two marks. It is the best effort-to-marks ratio of the whole chapter.
How the answer is expected to be written
A marker ticks steps. Here they are in order, with the concluding sentence expected word for word.
Writing up an optimization in five steps
When to use it: As soon as the problem asks for the maximum, the minimum, the most advantageous value, or the best choice.
1Name the variables with their units, and say which one will be the final variable.
2Write the constraint, then the objective function, each on its own line and without numbers.
3Substitute so that only one variable remains, and STATE THE DOMAIN, justifying its bounds from the context.
4Differentiate, set to zero, solve, and discard roots outside the domain.
5Settle the nature by f′′ or by the sign of f′, compare with the endpoints, then answer with units.
Concluding sentence
“Let n be the number of service points, an integer at least equal to 1. The total cost is C(n)=3n+n50, in thousand dollars. Then C′(n)=3−n250 vanishes for n=350≈4.08, and C′′(n)=n3100>0 confirms a minimum.”
The trap: Stating the domain after differentiating, or not at all. Without a domain, you do not know which roots to keep or whether to compare with endpoints, and the next question becomes impossible.
Marking: 1 mark for the variables, 2 marks for the objective and the constraint, 1 mark for the domain, 2 marks for the differentiation, 1 mark for the nature, 1 mark for the answer in units.
Writing up the cost of a constraint
When to use it: As soon as a rule, a standard or a policy decision imposes a value different from the optimum, and the problem asks what that costs.
1First compute the FREE optimum and the value of the objective that corresponds to it.
2Apply the constraint and determine the CONSTRAINED optimum, often at the imposed endpoint.
3Compute the value of the objective at that point.
4Take the DIFFERENCE of the two values, with units: it is the cost of the constraint.
5Also express it as a percentage, and conclude with a sentence usable in a discussion.
Concluding sentence
“Without the constraint, the minimum cost is C(4)=24.5 thousand dollars. With the obligation to open at least six points, it becomes C(6)≈26.33 thousand. The constraint therefore costs about 1.83 thousand dollars per year, that is, 7.5 percent more.”
The trap: Comparing the constrained optimum with zero rather than with the free optimum. The cost of a constraint is always a GAP between two scenarios, never an absolute value.
Marking: 1 mark for the free optimum, 1 mark for the constrained optimum, 1 mark for the difference, 1 mark for the interpretation.
Check before you hand in
Five minutes of checking recover more marks than one more problem started in a hurry.
The signature of the form
Check the relation expected at the optimum: two equal terms for ax+xb, a ratio of two for the root form, half of the gross gain for the root profit.
At n=4.08: 3n=12.25 and n50=12.25. Two different values would signal a differentiation error.
The two neighbouring integers
When the variable is an integer, evaluate the function at the two integers that bracket the continuous optimum and compare. Never round without computing.
C(4)=24.5 and C(5)=25: the winning integer is 4, whereas on another example the continuous optimum 4.08 could suggest the opposite.
The endpoints of the domain
Evaluate the objective at both endpoints, even when a critical number seems to win. It is two computations, and it closes the question of absolute extrema.
When minimizing, if the objective is smaller at an endpoint than at the critical number, the endpoint wins, and the critical number was at best a local minimum.
The meaning of the answer in context
Reread the value you found asking whether it is achievable: a negative number of places, a duration of three seconds, a sample of a hundred thousand people signal an error.
An optimum of 0.3 service points says that the variable was not set in the right unit, or that the constraint was substituted wrongly.
Flatness around the minimum
Compute the objective one unit on either side of the optimum. If the three values are very close, say so in the conclusion and recommend a range.
24.5, 24.49 and 25 for n=4, 4.08 and 5: less than 2.1 percent apart, so a recommendation to the tenth would make no sense.
The typical problem, taken apart
How many service points to open: continuous optimum, integer optimum, cost of a requirement
A public agency serves a territory with n service points. Operating them costs 3n thousand dollars per year, and the users' travel costs n50 thousand dollars per year.
Determine the number of points that minimizes the total cost, taking into account that n is an integer, then compute what a requirement of at least six points would cost.
Step 1
Variable: n, the number of service points, an integer at least equal to 1. Objective: C(n)=3n+n50, in thousand dollars per year.
Why
Stating the domain on the first line, integer and bounded below, spares you from coming back to it when it is time to decide, when it will be too late.
Step 2
The two costs are OPPOSED: opening more points raises the first term and lowers the second. There is therefore a balance to find.
Why
Naming the opposition before computing is what keeps you from concluding that you need as few or as many points as possible.
Step 3
C′(n)=3−n250. Set to zero: n2=350, so n=350≈4.08.
Why
Keep the positive root only: the domain requires n≥1, which rules out the negative root without having to discuss it.
Step 4
Nature: C′′(n)=n3100>0 for all n>0, so the critical number is a MINIMUM.
Why
The second derivative is positive on the whole domain, which also makes C concave up: there is therefore only one minimum, and no endpoint can do better.
Step 5
Signature: at n=4.08, we have 3n≈12.25 and n50≈12.25. The two terms are indeed equal, and C≈24.49.
Why
The check takes five seconds and catches any differentiation error. Unequal terms would have flagged a mistake before going any further.
Step 6
INTEGER optimum: C(4)=12+12.5=24.5 and C(5)=15+10=25. So n=4.
Why
We compare values, we do not round. The tipping point is 4×5=20≈4.472, and 4.08 is below it, which confirms 4.
Step 7
Flatness: between n=4 and n=5, the cost goes from 24.5 to 25, a gap of less than 2.1 percent.
Why
Near a minimum the derivative is zero, so the function varies at second order. The honest recommendation is a range, not a figure to the tenth.
Step 8
Cost of the requirement: with n≥6, the function is increasing beyond 4.08, so the constrained optimum is at the endpoint n=6. C(6)=18+650≈26.33.
Why
When the constraint pushes you away from the critical number, the optimum always takes refuge at the endpoint closest to it. The sign of C′ confirms it without a new computation.
Step 9
Difference: 26.33−24.5≈1.83 thousand dollars per year, about 7.5 percent more.
Why
It is the number you bring to a negotiation. It is always compared with the free optimum, never with zero.
The conclusion, written out
“The total cost is minimal for n=350≈4.08 service points, so for 4 points as a whole number, with a cost of 24.5 thousand dollars per year. Since the cost varies by less than 2.1 percent between four and five points, the reasonable recommendation is four or five. A requirement of six points would bring the cost to about 26.33 thousand, that is, 1.83 thousand more per year, about 7.5 percent.”
The classic mistake on this problem: Concluding that you should open as few points as possible because operating them is expensive. At n=1, the total cost is 3+50=53 thousand, more than double the optimum: minimizing only one of the two terms is exactly what you must not do.
Learn by heart
•Five steps: variables, constraint, objective, substitution with DOMAIN, differentiation and comparison with the endpoints.
•The constraint eliminates a variable; the DOMAIN comes from the context and decides the answer.
•Minimizing a sum of two opposing costs is never minimizing each of them.
•For ax+xb: optimum at x=ab, and the two terms are EQUAL there.
•Integer optimum: compare the TWO neighbouring integers. The tipping point is n(n+1), not the midpoint.
•If no critical number is in the domain, the optimum is at an ENDPOINT.
•Cost of a constraint: constrained optimum MINUS free optimum, never minus zero.
•A cost curve is flat around its minimum: recommend a range.
Frequently asked questions
How do you set up an optimization problem?
In five steps. You name the variables with their units, write the constraint that links them, write the function to optimize, substitute the constraint so that only one variable remains, and state the domain. Only then do you differentiate. Most of the marks are decided on the first two steps, not on the computation.
Why can't you minimize each cost separately?
Because the two costs oppose each other: gaining on one loses on the other. The operating cost is minimal with very few facilities, the travel cost with many. At the optimum of the sum, neither one is at its minimum. That is precisely why you differentiate the sum and never the terms one by one.
What is the difference between the constraint and the domain?
The constraint is the relation that links the variables to each other, and it is used to eliminate one of them to get a function of a single variable. The domain comes from the context of the problem and says which values are acceptable. The constraint enters the function; the domain filters the results. The two steps are distinct.
How do you handle an optimum that must be a whole number?
First compute the continuous optimum, then evaluate the function at the two integers that bracket it and compare the values obtained. You never round to the nearest, because the curve is not symmetric about its minimum. The true tipping point is the geometric mean of the two integers, not their midpoint.
What do you do when the derivative vanishes outside the domain?
The optimum is then at an endpoint of the domain, and the sign of the derivative says which one. If the derivative stays negative on the whole admissible interval, the function only decreases and the minimum is at the right endpoint. The critical number is simply discarded because it corresponds to no possible situation.
How do you compute the cost of a regulatory constraint?
You compute the free optimum and the value of the objective that corresponds to it, then the optimum under the constraint, which is almost always at the imposed endpoint. The difference between the two values is the cost of the constraint. You express it in units and as a percentage, because it is the figure used in a public policy discussion.
A method is proved on a paper, not on a sheet. The set for the same chapter takes each of these traps into a problem, with the solution written out step by step.
Something missing from this sheet?A method, a trap, an exercise to practise it, a mistake you spotted: tell me, I read every request.
Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space.
Rather not create an account? Write to me directly.
Get in touch for a first session. We go back over the moves that cost marks on the calculus exam, then we test them on exercises at the level of real CEGEP tests.