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.

This chapter is part of 201-103, Differential Calculus for Social Science

The essentials

The five steps

  • • NAME the variables, with their units.
  • • 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+bxC(x)=ax+\dfrac{b}{x}, the optimum is at x=bax=\sqrt{\dfrac{b}{a}}, 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.
neither one is minimal heretotal costthe term in xthe term in 1/xoptimum
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)\sqrt{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.
123456789102022242628303234363840free: 4.08C(6) ≈ 26.33minimum n ≥ 6+ 1.83n, service pointsC(n), thousand dollars
With the requirement n≥6n\ge 6 (green zone), 4.084.08 is no longer admissible: the optimum is at the ENDPOINT n=6n=6. The red gap, about 1.831.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.

FormOptimumSignature at the optimum
ax+bxax+\dfrac{b}{x} x=bax=\sqrt{\dfrac{b}{a}} the TWO terms are equal

Example: 2x+50x2x+\dfrac{50}{x}: optimum at x=5x=5, where each term is 1010 and the total 2020.

ax+bxax+\dfrac{b}{\sqrt{x}} x=(b2a)2/3x=\left(\dfrac{b}{2a}\right)^{2/3} the root term is TWICE the other

Example: x+16xx+\dfrac{16}{\sqrt{x}}: optimum at x=4x=4, where the terms are 44 and 88.

ax−bxa\sqrt{x}-bx x=(a2b)2x=\left(\dfrac{a}{2b}\right)^{2} the cost is HALF of the gross gain

Example: 20x−2x20\sqrt{x}-2x: optimum at x=25x=25, gross gain 100100, cost 5050, net 5050.

knan2+bn+c\dfrac{kn}{an^{2}+bn+c} n=can=\sqrt{\dfrac{c}{a}} the linear term plays NO role

Example: With a=2a=2, b=7b=7, c=50c=50: n=5n=5, and changing bb does not move the optimum.

minimize each term separately the shortcut does not exist rule that does not exist

Example: 2x2x is minimal when xx tends to 00 and 50x\dfrac{50}{x} when xx tends to infinity: neither one is minimal at x=5x=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 exist rule that does not exist

Example: Between 44 and 55, the tipping point is 20≈4.472\sqrt{20}\approx 4.472 and not 4.54.5: an optimum at 4.484.48 settles at 55.

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+50nC(n)=3n+\dfrac{50}{n}. Its derivative 3−50n23-\dfrac{50}{n^{2}} vanishes at n=503≈4.08n=\sqrt{\dfrac{50}{3}}\approx 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=9x=9, so the optimum is 99.”

What to write

“The admissible domain is [1,6][1, 6], and 99 is not in it. Since the derivative stays negative on the whole interval, the optimum is at the ENDPOINT x=6x=6.”

the optimum is at the endpointadmissible domainvertex outside the domain
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.484.48, so we keep 44.”

What to write

“We compare the two neighbouring integers: C(4)=18.05C(4)=18.05 and C(5)=18.04C(5)=18.04. The tipping point is the GEOMETRIC mean 4×5=20≈4.472\sqrt{4\times 5}=\sqrt{20}\approx 4.472, so 4.484.48 settles at 55.”

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 RC\dfrac{R}{C} and maximizing the NET EFFECT R−CR-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+knC=3n+\dfrac{k}{n} with kk also depending on nn, I differentiate.”

What to write

“I first use the CONSTRAINT to express kk in terms of nn, 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.084.08 service points.”

What to write

“Between 44 and 55 points, the total cost varies by less than 2.12.1 percent. The recommendation is therefore four or five points, and the choice will be made on other criteria.”

the cost varies by less than 5 percenta range3.656.9
The band under the dotted line is wide: between 3.63.6 and 6.96.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.08n=4.08, so the cost is minimal there.”

What to write

“C′′(n)=100n3>0C''(n)=\dfrac{100}{n^{3}}>0 for n>0n>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≥1n\ge 1.”

What to write

“The CONSTRAINT is the relation that links the variables and is used to eliminate one. n≥1n\ge 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 44 service points, the matter is settled.”

What to write

“The optimum is 44 service points IF the travel cost varies as 1n\dfrac{1}{n}, 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+50nC(n)=3n+\dfrac{50}{n}

  • If “profit”, “net profit”, “net gain” → revenue minus cost, to MAXIMIZE

    Example: 20x−2x20\sqrt{x}-2x

  • If “return”, “per dollar invested”, “the most efficient” → a RATIO of result over cost, to maximize

    Example: kn2n2+7n+50\dfrac{kn}{2n^{2}+7n+50}

  • If “from when does it stop being profitable” → this is not an optimization: solve R(x)=C(x)R(x)=C(x)

    Example: 20x=2x20\sqrt{x}=2x gives x=100x=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 nn such that C(n)≤26C(n)\le 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.

in the domainat the endpointopen: none
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.08n=4.08 in [1,+∞)[1, +\infty)

  • 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.5C(4)=24.5 versus C(5)=25C(5)=25, so 44

  • 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.83C(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.

  1. 1 Name the variables with their units, and say which one will be the final variable.
  2. 2 Write the constraint, then the objective function, each on its own line and without numbers.
  3. 3 Substitute so that only one variable remains, and STATE THE DOMAIN, justifying its bounds from the context.
  4. 4 Differentiate, set to zero, solve, and discard roots outside the domain.
  5. 5 Settle the nature by f′′f'' or by the sign of f′f', compare with the endpoints, then answer with units.

Concluding sentence

“Let nn be the number of service points, an integer at least equal to 11. The total cost is C(n)=3n+50nC(n)=3n+\dfrac{50}{n}, in thousand dollars. Then C′(n)=3−50n2C'(n)=3-\dfrac{50}{n^{2}} vanishes for n=503≈4.08n=\sqrt{\dfrac{50}{3}}\approx 4.08, and C′′(n)=100n3>0C''(n)=\dfrac{100}{n^{3}}>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.

  1. 1 First compute the FREE optimum and the value of the objective that corresponds to it.
  2. 2 Apply the constraint and determine the CONSTRAINED optimum, often at the imposed endpoint.
  3. 3 Compute the value of the objective at that point.
  4. 4 Take the DIFFERENCE of the two values, with units: it is the cost of the constraint.
  5. 5 Also 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.5C(4)=24.5 thousand dollars. With the obligation to open at least six points, it becomes C(6)≈26.33C(6)\approx 26.33 thousand. The constraint therefore costs about 1.831.83 thousand dollars per year, that is, 7.57.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 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 nn service points. Operating them costs 3n3n thousand dollars per year, and the users' travel costs 50n\dfrac{50}{n} thousand dollars per year.

Determine the number of points that minimizes the total cost, taking into account that nn is an integer, then compute what a requirement of at least six points would cost.

Step 1

Variable: nn, the number of service points, an integer at least equal to 11. Objective: C(n)=3n+50nC(n)=3n+\dfrac{50}{n}, 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−50n2C'(n)=3-\dfrac{50}{n^{2}}. Set to zero: n2=503n^{2}=\dfrac{50}{3}, so n=503≈4.08n=\sqrt{\dfrac{50}{3}}\approx 4.08.

Why

Keep the positive root only: the domain requires n≥1n\ge 1, which rules out the negative root without having to discuss it.

Step 4

Nature: C′′(n)=100n3>0C''(n)=\dfrac{100}{n^{3}}>0 for all n>0n>0, so the critical number is a MINIMUM.

Why

The second derivative is positive on the whole domain, which also makes CC concave up: there is therefore only one minimum, and no endpoint can do better.

Step 5

Signature: at n=4.08n=4.08, we have 3n≈12.253n\approx 12.25 and 50n≈12.25\dfrac{50}{n}\approx 12.25. The two terms are indeed equal, and C≈24.49C\approx 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.5C(4)=12+12.5=24.5 and C(5)=15+10=25C(5)=15+10=25. So n=4n=4.

234567232425262728C(4) = 24.5C(5) = 254.08n, service pointsC(n)

Why

We compare values, we do not round. The tipping point is 4×5=20≈4.472\sqrt{4\times 5}=\sqrt{20}\approx 4.472, and 4.084.08 is below it, which confirms 44.

Step 7

Flatness: between n=4n=4 and n=5n=5, the cost goes from 24.524.5 to 2525, a gap of less than 2.12.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≥6n\ge 6, the function is increasing beyond 4.084.08, so the constrained optimum is at the endpoint n=6n=6. C(6)=18+506≈26.33C(6)=18+\dfrac{50}{6}\approx 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′C' confirms it without a new computation.

Step 9

Difference: 26.33−24.5≈1.8326.33-24.5\approx 1.83 thousand dollars per year, about 7.57.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=503≈4.08n=\sqrt{\dfrac{50}{3}}\approx 4.08 service points, so for 44 points as a whole number, with a cost of 24.524.5 thousand dollars per year. Since the cost varies by less than 2.12.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.3326.33 thousand, that is, 1.831.83 thousand more per year, about 7.57.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=1n=1, the total cost is 3+50=533+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+bxax+\dfrac{b}{x}: optimum at x=bax=\sqrt{\dfrac{b}{a}}, and the two terms are EQUAL there.
  • • Integer optimum: compare the TWO neighbouring integers. The tipping point is n(n+1)\sqrt{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.

Practise it

Corrected exercises: Applied optimization, 201-103

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.

  • 10 corrected exercises
  • 100 points
  • 150 minutes
Do the exercises
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.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

Previous sheet Curve sketching Next sheet Trigonometric functions and their derivatives

© Ahmed Squalli Houssaini. Revision sheet published at www.letuteurscientifique.ca/en/fiches/cegep-103-applied-optimization. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

See also

Looking for a 201-103 tutor in Montreal?

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.

Site by Studio Squalli